5 /// which points of a graph are connected?
7 void connect(int i
, int j
);
9 bool equiv(int i
, int j
) { return find(i
) == find(j
); }
17 Union find, a standard algorithm:
19 Union_find represents an undirected graph of N points. You can
20 connect two points using #connect()#. #find(i)# finds a uniquely
21 determined representant of the equivalence class of points