Given a set of N objects, main operations are:
-Union Command: Connect 2 objects: union( a, b )
-Find/Connected query: is there a path connecting the 2 objects? connect ( a, b )
Answer the question if there is a path between 2 points in the map, not to find out the path( in Part 2 ).
Applications
Modelling the Connection
-Reflexive
-Symmetric
-Transitive
Connected Component
Maximal set of objects that have mutually connected.
Find Query
Check if 2 objects are in the same connected component.
Union Command
Replace components containing 2 objects with their union.