A social network has users, some pairs of whom are friends. Whenever user is friends with user , user is also friends with user . 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 are 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.
A sequence of operations exists reducing the graph to a matching (each vertex has degree ).
A sequence of operations exists reducing the graph to a matching (each vertex has degree ).
A sequence of operations exists reducing the graph to a matching (each vertex has degree ).
A sequence of operations exists reducing the graph to a matching (each vertex has degree ).
Hint 1: Analyze what happens to vertex degrees in each operation: loses 2 friends while and each lose and gain one. What quantities are preserved?
Hint 2: The parity of each individual vertex's degree is invariant under the operation. Initially 1010 vertices have odd degree and 1009 have even degree — this never changes.
Hint 3: Show that the process terminates (use as a monovariant). At termination, every component is a clique. Use the parity invariant to show every clique has size .
Step 1 (Operation analysis): When user (with friends where are not friends) triggers an event, loses 2 friends, and each lose 1 friend (losing ) but gain 1 friend (gaining each other). So decreases by 2, while and are unchanged.
Step 2 (Monovariant): Consider . After one operation, , so the change in is whenever . The monovariant strictly decreases with every operation (and an operation is possible whenever some vertex has degree with two non-adjacent neighbors).
Step 3 (Parity invariant): The total number of edges changes: we remove 2 edges (, ) and add 1 edge (), so the number of edges decreases by 1 each operation. Initially, the total degree is , so there are edges.
Step 4 (Termination and target): Since is a nonneg integer that strictly decreases, the process terminates. At termination, every vertex with must have all its neighbors mutually adjacent (forming a clique among neighbors). We need to show termination gives .
At a terminal state, every connected component is a clique (since if has neighbors with not friends, we could still operate). In a clique of size , each vertex has degree .
Step 5 (Parity argument): Each operation decreases the edge count by 1, so the terminal edge count has the same parity as , which is even. A matching on vertices has at most edges. We verify that the process can reach a state of all cliques of size : observe that in a clique of size , we can pick any and two of its neighbors and perform the operation (since and are friends in a clique — wait, they ARE friends, so the operation requires NOT friends).
So actually at a terminal state, every vertex with has all neighbors pairwise friends. In a clique of size , we CANNOT operate because all pairs are already friends. So we must argue more carefully that terminal states are matchings.
Step 5 (Revised — Component analysis): At termination, each component is a clique. Suppose a terminal clique has size . Consider the graph invariant: for each vertex , — the product is invariant. Also, each operation preserves the parity of each individual vertex's degree modulo 2 (since changes by , and are unchanged). So the parity of each vertex's degree is invariant!
Initially: 1010 users have odd degree (1009) and 1009 users have even degree (1010). In a terminal clique of size , each member has degree . The vertices that initially had odd degree must still have odd degree, so is odd, i.e., is even. Similarly for even-degree vertices. Since we have 1010 odd-parity vertices and 1009 even-parity vertices, and cliques must be uniform in parity, the odd-parity vertices form cliques of even size and even-parity vertices form cliques of odd size. The only even clique size with odd degree per vertex is , and the only odd clique size with even degree per vertex is . So terminal state has the 1010 odd-parity vertices in 505 pairs (edges) and 1009 even-parity vertices as isolates.
This is a matching with 505 edges and every vertex has degree .
Ready to track your progress and master these topics?
Create a free account