MathLabs

Problem 3

A social network has 20192019 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 AA, BB, and CC such that AA is friends with both BB and CC, but BB and CC are not friends, change their friendship statuses such that BB and CC are now friends, but AA is no longer friends with BB, and no longer friends with CC. All other friendship statuses remain unchanged. Initially, 10101010 users have 10091009 friends each, and 10091009 users have 10101010 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
T a tree,AB,AC∈E(T), BC∉E(T)⟹ T′=(T∖{AB,AC})∪{BC} is a forestT\text{ a tree},\quad AB,AC\in E(T),\ BC\notin E(T)\Longrightarrow\ T'=(T\setminus\{AB,AC\})\cup\{BC\}\text{ is a forest}
Detailed analysis

Now let TT be the spanning tree obtained above. Whenever a vertex AA has two neighbors B,CB,C, the unique path from BB to CC is B−A−CB-A-C, so BB and CC are not adjacent and the toggle is legal. Removing ABAB and ACAC from the tree separates it into three components, and adding BCBC joins the two components containing BB and CC; therefore the result is a forest (with one fewer edge) and no cycle is created. The same argument applies to every later forest.