240 likes | 325 Views
233-234. Sedgewick & Wayne (2004); Chazelle (2005). How to check if adding an edge creates a cycle?. Label i all nodes of i-th tree. 2. 1. 1. 2. 1. 2. 2. How to check if adding an edge creates a cycle?. Label i all nodes of i-th tree. 2. 1. 1. 2. 1. 2. 2.
E N D
233-234 Sedgewick & Wayne (2004); Chazelle (2005)
How to check if adding an edge creates a cycle? Label i all nodes of i-th tree 2 1 1 2 1 2 2
How to check if adding an edge creates a cycle? Label i all nodes of i-th tree 2 1 1 2 1 2 2
How to check if adding an edge creates a cycle? Label i all nodes of i-th tree 2 1 1 2 1 2 2 Relabel smaller tree
How to check if adding an edge creates a cycle? Label i all nodes of i-th tree 2 2 2 2 2 2 2 Relabel smaller tree
How to check if adding an edge creates a cycle? Label i all nodes of i-th tree 2 2 2 2 2 2 2 Each node relabeled at most log V times
edge of the MST correctness 9 3 Bnodes 7 8 Anodes
B 3 A
B 3 A A B A A 8
How much time ? 1. Sorting: 2. Cycle detection:
How much time ? 1. Sorting: 2. Cycle detection: Time proportional to
Ackermann’s function number of particles in the universe If E = 2
The amazing function Tower of height equal to tower of x Two times x Tower of x Two to the x-th