Maths Olympiad Prep

Library / /1 of 3

Combinatorics Difficulty 7.5 National Olympiad, round 2 Prove it Romania

Let Γ\Gamma be a connected graph on r+g+b+1r + g + b + 1 vertices. The edges of Γ\Gamma bear three colours: red, green, and blue. It turns out that Γ\Gamma has a spanning tree with exactly rr red edges, a spanning tree with exactly gg green edges, and a spanning tree with exactly bb blue edges. Prove that Γ\Gamma has a spanning tree with exactly rr red edges, exactly gg green edges, and exactly bb blue edges.

Solutions — 2

Solution 1

Induct on n=r+g+bn = r + g + b. The base case, n=1n = 1, is clear.

Let now n>1n > 1. Let VV denote the vertex set of Γ\Gamma, and let Tr,TgT_r, T_g, and TbT_b be the trees with exactly rr red edges, gg green edges, and bb blue edges, respectively. Consider two cases.

Case 1: There exists a partition V=ABV = A \cup B of the vertex set into two non-empty parts such that the edges joining the parts all bear the same colour, say, blue.

Since Γ\Gamma is connected, it has a (necessarily blue) edge connecting AA and BB. Let ee be one such.

Assume that TT, one of the three trees, does not contain ee. Then the graph T{e}T \cup \{e\} has a cycle CC through ee. The cycle CC should contain another edge ee' connecting AA and BB; the edge ee' is also blue. Replace ee' by ee in TT to get another tree TT' with the same number of edges of each colour as in TT, but containing ee.

Performing such an operation to all three trees, we arrive at the situation where the three trees Tr,TgT'_r, T'_g, and TbT'_b all contain ee. Now shrink ee by identifying its endpoints to obtain a graph Γ\Gamma^*, and set r=r,g=gr^* = r, g^* = g, and b=b1b^* = b - 1. The new graph satisfies the conditions in the statement for those new values — indeed, under the shrinking, each of the trees Tr,TgT'_r, T'_g, and TbT'_b loses a blue edge. So Γ\Gamma^* has a spanning tree with exactly rr red, exactly gg green, and exactly b1b - 1 blue edges. Finally, pass back to Γ\Gamma by restoring ee, to obtain the desired spanning tree in Γ\Gamma.

Case 2: There is no such a partition.

Consider all possible collections (R,G,B)(R, G, B), where R,GR, G and BB are acyclic sets consisting of rr red edges, gg green edges, and bb blue edges, respectively. By the problem assumptions, there is at least one such collection. Amongst all such collections, consider one such that the graph on VV with edge set RGBR \cup G \cup B has the smallest number kk of components. If k=1k = 1, then the collection provides the edges of a desired tree (the number of edges is one less than the number of vertices).

Assume now that k2k \ge 2; then in the resulting graph some component KK contains a cycle CC. Since R,GR, G, and BB are acyclic, CC contains edges of at least two colours, say, red and green. By assumption, the edges joining V(K)V(K) to VV(K)V \setminus V(K) bear at least two colours; so one of these edges is either red or green. Without loss of generality, consider a red such edge ee.

Let ee' be a red edge in CC and set R=R{e}{e}R' = R \setminus \{e'\} \cup \{e\}. Then (R,G,B)(R', G, B) is a valid collection providing a smaller number of components. This contradicts minimality of the choice above and concludes the proof.

Solution 2

For a spanning tree TT in Γ\Gamma, denote by r(T)r(T), g(T)g(T), and b(T)b(T) the number of red, green, and blue edges in TT, respectively.

Assume that CC is some collection of spanning trees in Γ\Gamma. Write
r(C)=minTCr(T),g(C)=minTCg(T),b(C)=minTCb(T),R(C)=maxTCr(T),G(C)=maxTCg(T),B(C)=maxTCb(T). r(C) = \min_{T \in C} r(T), \quad g(C) = \min_{T \in C} g(T), \quad b(C) = \min_{T \in C} b(T), \\ R(C) = \max_{T \in C} r(T), \quad G(C) = \max_{T \in C} g(T), \quad B(C) = \max_{T \in C} b(T).
Say that a collection CC is good if r[r(C),R(C)]r \in [r(C), R(C)], g[g(C),G(C)]g \in [g(C), G(C)], and b[b(C),B(C)]b \in [b(C), B(C)]. By the problem conditions, the collection of all spanning trees in Γ\Gamma is good.

For a good collection CC, say that an edge ee of Γ\Gamma is suspicious if ee belongs to some tree in CC but not to all trees in CC. Choose now a good collection CC minimizing the number of suspicious edges. If CC contains a desired tree, we are done. Otherwise, without loss of generality, r(C)<rr(C) < r and G(C)>gG(C) > g.

We now distinguish two cases.

Case 1: B(C)=bB(C) = b.

Let T0T^0 be a tree in CC with g(T0)=g(C)gg(T^0) = g(C) \le g. Since G(C)>gG(C) > g, there exists a green edge ee contained in some tree in CC but not in T0T^0; clearly, ee is suspicious. Fix one such green edge ee.

Now, for every TT in CC, define a spanning tree T1T_1 of Γ\Gamma as follows. If TT does not contain ee, then T1=TT_1 = T; in particular, (T0)1=T0(T^0)_1 = T^0. Otherwise, the graph T{e}T \setminus \{e\} falls into two components. The tree T0T^0 contains some edge ee' joining those components; this edge is necessarily suspicious. Choose one such edge and define T1=T{e}{e}T_1 = T \setminus \{e\} \cup \{e'\}.

Let C1={T1:TC}C_1 = \{T_1 : T \in C\}. All edges suspicious for C1C_1 are also suspicious for CC, but no tree in C1C_1 contains ee. So the number of suspicious edges for C1C_1 is strictly smaller than that for CC.

We now show that C1C_1 is good, reaching thereby a contradiction with the choice of CC. For every TT in CC, the tree T1T_1 either coincides with TT or is obtained from it by removing a green edge and adding an edge of some colour. This already shows that g(C1)g(C)gg(C_1) \le g(C) \le g, G(C1)G(C)1gG(C_1) \ge G(C) - 1 \ge g, R(C1)R(C)rR(C_1) \ge R(C) \ge r, r(C1)r(C)+1rr(C_1) \le r(C) + 1 \le r, and B(C1)B(C)bB(C_1) \ge B(C) \ge b. Finally, we get b(T0)B(C)=bb(T^0) \le B(C) = b; since C1C_1 contains T0T^0, it follows that b(C1)b(T0)bb(C_1) \le b(T^0) \le b, which concludes the proof.

Case 2: B(C)>bB(C) > b.

Consider a tree T0T^0 in CC satisfying r(T0)=R(C)rr(T^0) = R(C) \ge r. Since r(C)<rr(C) < r, the tree T0T^0 contains a suspicious red edge. Fix one such edge ee.

Now, for every TT in CC, define a spanning tree T2T_2 of Γ\Gamma as follows. If TT contains ee, then T2=TT_2 = T; in particular, (T0)2=T0(T^0)_2 = T^0. Otherwise, the graph T{e}T \cup \{e\} contains a cycle CC through ee. This cycle contains an edge ee' absent from T0T^0 (otherwise T0T^0 would contain the cycle CC), so ee' is suspicious. Choose one such edge and define T2=T{e}{e}T_2 = T \setminus \{e'\} \cup \{e\}.

Let C2={T2:TC}C_2 = \{T_2: T \in C\}. All edges suspicious for C2C_2 are also suspicious for CC, but all trees in C2C_2 contain ee. So the number of suspicious edges for C2C_2 is strictly smaller than that for CC.

We now show that C2C_2 is good, reaching again a contradiction. For every TT in CC, the tree T2T_2 either coincides with TT or is obtained from it by removing some edge and adding a red edge. This shows that r(C2)r(C)+1rr(C_2) \le r(C) + 1 \le r, R(C2)R(C)rR(C_2) \ge R(C) \ge r, G(C2)G(C)1gG(C_2) \ge G(C) - 1 \ge g, g(C2)g(C)gg(C_2) \le g(C) \le g, b(C2)b(C)bb(C_2) \le b(C) \le b and B(C2)B(C)1bB(C_2) \ge B(C) - 1 \ge b. This concludes the proof.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.