Graph Theory37 sections · 1633 units
Open in Course

Pattern - Transitivity

Swapping Logic

If you can swap item AA with BB, and swap BB with CC, can you swap AA with CC? Yes. You swap ABA \leftrightarrow B, then BCB \leftrightarrow C, effectively swapping AA and CC.

Transitivity means swap relationships form groups. Any two items in the same group can be swapped (eventually). DSU tracks these groups perfectly.

This observation solves problems about rearranging elements through allowed swaps.