Problem 3
A social network has users, some pairs of whom are friends (friendship is a symmetric relation). Events of the following kind may happen repeatedly, one at a time: three users , , and such that is friends with both and , but and are not friends, change their friendship statuses such that and are now friends, but is no longer friends with , and no longer friends with . All other friendship statuses remain unchanged. Initially, users have friends each, and users have friends each. Prove that there exists a sequence of such events after which each user is friends with at most one other user.
Step 5 of 6: Toggle inside the tree without creating a cycle
Detailed analysis
Now let be the spanning tree obtained above. Whenever a vertex has two neighbors , the unique path from to is , so and are not adjacent and the toggle is legal. Removing and from the tree separates it into three components, and adding joins the two components containing and ; therefore the result is a forest (with one fewer edge) and no cycle is created. The same argument applies to every later forest.