Subfield: Combinatorics


Question: Let $r, g, b$ be non-negative integers. Let $\Gamma$ be a connected graph on $r+g+b+1$ vertices. The edges of $\Gamma$ are each coloured red, green or blue. It turns out that $\Gamma$ has



- a spanning tree in which exactly $r$ of the edges are red,

- a spanning tree in which exactly $g$ of the edges are green and

- a spanning tree in which exactly $b$ of the edges are blue.



Prove that $\Gamma$ has a spanning tree in which exactly $r$ of the edges are red, exactly $g$ of the edges are green and exactly $b$ of the edges are blue.

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



Let now $n>1$. Let $V$ denote the vertex set of $\Gamma$, and let $T_{r}, T_{g}$, and $T_{b}$ be the trees with exactly $r$ red edges, $g$ green edges, and $b$ blue edges, respectively. Consider two cases.



Case 1: There exists a partition $V=A \sqcup 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 $A$ and $B$. Let $e$ be one such.



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



Performing such an operation to all three trees, we arrive at the situation where the three trees $T_{r}^{\prime}$, $T_{g}^{\prime}$, and $T_{b}^{\prime}$ all contain $e$. Now shrink $e$ by identifying its endpoints to obtain a graph $\Gamma^{*}$, and set $r^{*}=r, g^{*}=g$, and $b^{*}=b-1$. The new graph satisfies the conditions in the statement for those new values - indeed, under the shrinking, each of the trees $T_{r}^{\prime}, T_{g}^{\prime}$, and $T_{b}^{\prime}$ loses a blue edge. So $\Gamma^{*}$ has a spanning tree with exactly $r$ red, exactly $g$ green, and exactly $b-1$ blue edges. Finally, pass back to $\Gamma$ by restoring $e$, to obtain the a desired spanning tree in $\Gamma$.



Case 2: There is no such a partition.



Consider all possible collections $(R, G, B)$, where $R, G$ and $B$ are acyclic sets consisting of $r$ red edges, $g$ green edges, and $b$ 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 $V$ with edge set $R \cup G \cup B$ has the smallest number $k$ of components. If $k=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 $k \geq 2$; then in the resulting graph some component $K$ contains a cycle $C$. Since $R, G$, and $B$ are acyclic, $C$ contains edges of at least two colours, say, red and green. By assumption, the edges joining $V(K)$ to $V \backslash 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 $e$.



Let $e^{\prime}$ be a red edge in $C$ and set $R^{\prime}=R \backslash\left\{e^{\prime}\right\} \cup$ $\{e\}$. Then $\left(R^{\prime}, G, B\right)$ is a valid collection providing a smaller number of components. This contradicts minimality of the choice above and concludes the proof.
For a spanning tree $T$ in $\Gamma$, denote by $r(T), g(T)$, and $b(T)$ the number of red, green, and blue edges in $T$, respectively.



Assume that $\mathcal{C}$ is some collection of spanning trees in $\Gamma$. Write



$$
\begin{aligned}

r(\mathcal{C}) & =\min _{T \in \mathcal{C}} r(T), & g(\mathcal{C}) & =\min _{T \in \mathcal{C}} g(T), \\

b(\mathcal{C}) & =\min _{T \in \mathcal{C}} b(T), & R(\mathcal{C}) & =\max _{T \in \mathcal{C}}(T), \\

G(\mathcal{C}) & =\max _{T \in \mathcal{C}} g(T), & B(\mathcal{C}) & =\max _{T \in \mathcal{C}} b(T) .

\end{aligned}
$$



Say that a collection $\mathcal{C}$ is good if $r \in[r(\mathcal{C}, R(\mathcal{C})]$, $g \in[g(\mathcal{C}, G(\mathcal{C})]$, and $b \in[b(\mathcal{C}, B(\mathcal{C})]$. By the problem conditions, the collection of all spanning trees in $\Gamma$ is good.



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



We now distinguish two cases.



Case 1: $B(\mathcal{C})=b$.



Let $T^{0}$ be a tree in $\mathcal{C}$ with $g\left(T^{0}\right)=g(\mathcal{C}) \leq g$. Since $G(\mathcal{C})>g$, there exists a green edge $e$ contained in some tree in $\mathcal{C}$ but not in $T^{0}$; clearly, $e$ is suspicious. Fix one such green edge $e$.



Now, for every $T$ in $\mathcal{C}$, define a spanning tree $T_{1}$ of $\Gamma$ as follows. If $T$ does not contain $e$, then $T_{1}=T$; in particular, $\left(T^{0}\right)_{1}=T^{0}$. Otherwise, the graph $T \backslash\{e\}$ falls into two components. The tree $T_{0}$ contains some edge $e^{\prime}$ joining those components; this edge is necessarily suspicious. Choose one such edge and define $T_{1}=T \backslash\{e\} \cup\left\{e^{\prime}\right\}$.



Let $\mathcal{C}_{1}=\left\{T_{1}: T \in \mathcal{C}\right\}$. All edges suspicious for $\mathcal{C}_{1}$ are also suspicious for $\mathcal{C}$, but no tree in $\mathcal{C}_{1}$ con- tains $e$. So the number of suspicious edges for $\mathcal{C}_{1}$ is strictly smaller than that for $\mathcal{C}$.



We now show that $\mathcal{C}_{1}$ is good, reaching thereby a contradiction with the choice of $\mathcal{C}$. For every $T$ in $\mathcal{C}$, the tree $T_{1}$ either coincides with $T$ or is obtained from it by removing a green edge and adding an edge of some colour. This already shows that $g\left(\mathcal{C}_{1}\right) \leq g(\mathcal{C}) \leq g, G\left(\mathcal{C}_{1}\right) \geq G(\mathcal{C})-1 \geq g$, $R\left(\mathcal{C}_{1}\right) \geq R(\mathcal{C}) \geq r, r\left(\mathcal{C}_{1}\right) \leq r(\mathcal{C})+1 \leq r$, and $B\left(\mathcal{C}_{1}\right) \geq B(\mathcal{C}) \geq b$. Finally, we get $b\left(T^{0}\right) \leq$ $B(\mathcal{C})=b$; since $\mathcal{C}_{1}$ contains $T^{0}$, it follows that $b\left(\mathcal{C}_{1}\right) \leq b\left(T^{0}\right) \leq b$, which concludes the proof.



Case 2: $B(\mathcal{C})>b$.



Consider a tree $T^{0}$ in $\mathcal{C}$ satisfying $r\left(T^{0}\right)=$ $R(\mathcal{C}) \geq r$. Since $r(\mathcal{C})<r$, the tree $T^{0}$ contains a suspicious red edge. Fix one such edge $e$.



Now, for every $T$ in $\mathcal{C}$, define a spanning tree $T_{2}$ of $\Gamma$ as follows. If $T$ contains $e$, then $T_{2}=T$; in particular, $\left(T^{0}\right)_{2}=T^{0}$. Otherwise, the graph $T \cup\{e\}$ contains a cycle $C$ through $e$. This cycle contains an edge $e^{\prime}$ absent from $T^{0}$ (otherwise $T^{0}$ would contain the cycle $C$ ), so $e^{\prime}$ is suspicious. Choose one such edge and define $T_{2}=T \backslash\left\{e^{\prime}\right\} \cup\{e\}$.



Let $\mathcal{C}_{2}=\left\{T_{2}: T \in \mathcal{C}\right\}$. All edges suspicious for $\mathcal{C}_{2}$ are also suspicious for $\mathcal{C}$, but all trees in $\mathcal{C}_{2}$ contain $e$. So the number of suspicious edges for $\mathcal{C}_{2}$ is strictly smaller than that for $\mathcal{C}$.



We now show that $\mathcal{C}_{2}$ is good, reaching again a contradiction. For every $T$ in $\mathcal{C}$, the tree $T_{2}$ either coincides with $T$ or is obtained from it by removing some edge and adding a red edge. This shows that $r\left(\mathcal{C}_{2}\right) \leq r(\mathcal{C})+1 \leq r, R\left(\mathcal{C}_{2}\right) \geq R(\mathcal{C}) \geq r$, $G\left(\mathcal{C}_{2}\right) \geq G(\mathcal{C})-1 \geq g, g\left(\mathcal{C}_{2}\right) \leq g(\mathcal{C}) \leq g$, $b\left(\mathcal{C}_{1}\right) \leq b(\mathcal{C}) \leq b$ and $B\left(\mathcal{C}_{2}\right) \geq B(\mathcal{C})-1 \geq b$. This concludes the proof.