0

http://en.wikipedia.org/wiki/Disjoint_sets

http://en.wikipedia.org/wiki/Kruskal's_algorithm

Union/Find data structure being used for disjoint sets...

templatetypedef
  • 362,284
  • 104
  • 897
  • 1,065
Devoted
  • 177,705
  • 43
  • 90
  • 110

1 Answers1

2

It is stated in the entry for Kruskal's algorithm, but you can use the union/find structure to test (via FIND) if the edge connects two different trees or whether it will form a cycle when added.

The same structure can be updated (via UNION) if the edge does not form a cycle and is added to the spanning tree.

lijie
  • 4,811
  • 22
  • 26