Run time backwards
transcript
Links are removed one by one. A network loses links over time. After each, find the largest group. Union-find cannot split a group. Run time backwards instead.
Union-find can merge groups. That is the whole rule. It can never split them. So turn removals into merges.
Start after the last removal. Think of the network as nearly empty. Join the links never removed. Read the largest group.
Largest group as links come back. Start with two. Record, then add a link. It grows to four, then six. Each value answers one removal.
Links never removed stay. They form the starting groups. Join them before anything else. They never change again. Then the walk can begin.
Record before adding the link. The link is still gone then. Adding first records too early. The count is wrong by one step.
Run removals backwards. Record, then add the link. Never the other way round. Groups only grow. Full breakdown in the lecture.