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.
9 int dsf_canonify(int *dsf
, int val
)
13 while (dsf
[val
] != val
)
25 void dsf_merge(int *dsf
, int v1
, int v2
)
27 v1
= dsf_canonify(dsf
, v1
);
28 v2
= dsf_canonify(dsf
, v2
);