Olympiad Maths Prep

Track / Stage 8 / 132 of 180 #1832 of 2000

Problem 1832

IMO Shortlist mid-range; USAMO P2/P5
Combinatorics Difficulty 8.7 Prove it Balkan Mathematical Olympiad Shortlisted Problems · Balkan Mathematical Olympiad

A graph is *good* if its edges can be colored with 2 colors so that no cycle has two consecutive edges of the same color. What is the maximum number of edges in a *good* graph with 1000 vertices?

This one wants a proof. Work it on paper, read the official solution, then mark yourself honestly — the ladder only means something if the record is true.

Official solution

We will prove the answer to be 4333=13324 \cdot 333 = 1332.
First we prove that a *good* graph with nn vertices has at most 4(n1)3\frac{4(n-1)}{3} edges.

*Claim 1.* If we have 3 paths going from vertex AA to vertex BB, then 2 of them have a common vertex different from AA, BB.
*Proof.* Suppose not. By the Pigeonhole principle, observe that 2 of them have the same color attributed to AA's edge in them. But if they have no other common points than AA and BB, they form a cycle where the 2 edges next to AA have the same color, contradiction. □

*Claim 2.* No edge lies in more than 1 cycle.
*Proof.* Suppose edge XYXY lies in cycle C1C_1 and cycle C2C_2. If C1C_1 and C2C_2 have no common vertices except XX and YY, observe that we can get from XX to YY from 3 disjoint paths: on C1C_1, on C2C_2 and directly on edge XYXY, contradicting Claim 1.
Thus, C1C_1 and C2C_2 have other common vertices. We can walk on C2C_2 going in the direction from YY to XX and suppose VV is the first such vertex we encounter. Then we have 3 disjoint paths from XX to VV: this path we just walked from XX to VV on C2C_2, and the 2 paths given by C1C_1, and all are disjoint by the way we chose VV, again contradicting Claim 1. □

Figure 1

Consider a connected and *good* graph with mm vertices and pp edges. It has a spanning tree containing m1m - 1 edges, and every other edge then lies in a cycle where all other edges are edges of the tree, so no 2 such cycles coincide.
However, by Claim 2, no two cycles share an edge, and from the statement, all have even lengths, thus at least 4. Furthermore, we have p+1mp + 1 - m such cycles, so we have at least 4(p+1m)4(p + 1 - m) edges. This means p4(p+1m)p \geq 4(p + 1 - m), which gives p4(m1)3p \leq \frac{4(m-1)}{3}.
Now that we've proven the result for connected graphs, all we need to do for non-connected ones is to just apply it for all connected components and sum it up, yielding the result.
We are left with providing the example for 1000 vertices:
We have a vertex VV and 333 triplets (Ai,Bi,Ci)(A_i, B_i, C_i) with edges VAiVA_i, AiBiA_iB_i, BiCiB_iC_i, CiVC_iV, which can be colored alternatively. This is easily seen to work as these are the only cycles.

We will prove by mathematical induction that 4(n1)3\lfloor \frac{4(n-1)}{3} \rfloor is the maximum number of edges for any nn.
We can check the base cases for n=1,2,3n = 1, 2, 3 by hand.
Assume the claim holds for all integers smaller than nn. Suppose that the claim does not hold for nn.
Since the number of edges is larger than n1n-1 the graph contains a cycle. The cycle has to be of even length, as the consecutive edges must be of different colors. If 2 non-consecutive vertices of a cycle are connected, 2 additional cycles would exist, and it is clear that at least one of these would contain consecutive edges of the same color.
Similarly, if there exists a path between 2 vertices belonging to the cycle using only edges that are not on the cycle, 2 additional cycles would exist, and one of them would have consecutive edges of the same color.
Notice that if we replace the cycle by a vertex connected to a vertex outside the cycle if and only if one of the vertices in the cycle is connected to it, the condition would be true for the new graph. Let 2t2t be the length of the cycle. Since the new graph has n2t+1n - 2t + 1 edges, by induction we know that it has at most 4(n2t+11)3\lfloor \frac{4(n-2t+1-1)}{3} \rfloor edges. Our original graph thus has at most 4(n2t+11)3+2t\lfloor \frac{4(n-2t+1-1)}{3} \rfloor + 2t edges. Since 2t4(2t1)32t \leq \frac{4(2t-1)}{3} for t2t \geq 2 we get that the graph has at most 4(n1)3\lfloor \frac{4(n-1)}{3} \rfloor which is contradiction, so the claim holds for nn.

Source: MathNet, licensed CC-BY-4.0. Statement and solution reproduced as published; topic, difficulty and ordering added by this site.