2 * dsf.c: two small functions to handle a disjoint set forest,
3 * which is a data structure useful in any solver which has to
4 * worry about avoiding closed loops.
7 int dsf_canonify(int *dsf, int val)
11 while (dsf[val] != val)
23 void dsf_merge(int *dsf, int v1, int v2)
25 v1 = dsf_canonify(dsf, v1);
26 v2 = dsf_canonify(dsf, v2);