Source: TSTST-2018-P2
Category: Graph Theory

Problem:
In the nation of Onewaynia, certain pairs of cities are connected by one-way roads. Every road connects exactly two cities (roads are allowed to cross each other, e.g., via bridges), and each pair of cities has at most one road between them. Moreover, every city has exactly two roads leaving it and exactly two roads entering it. We wish to close half the roads of Onewaynia in such a way that every city has exactly one road leaving it and exactly one road entering it. Show that the number of ways to do so is a power of $2$ greater than $1$ (i.e. of the form $2^n$ for some integer $n \ge 1$).

Solution:
In the language of graph theory, we are given a simple directed graph $G$ such that every vertex has in-degree $2$ and out-degree $2$. We seek the number of spanning sub-digraphs of $G$ in which every vertex has in-degree $1$ and out-degree $1$ (i.e., $1$-regular sub-digraphs).

**First Solution (Combinatorial)**

We construct a simple undirected bipartite graph $\Gamma$ as follows: the vertex set consists of two copies of $V(G)$, say $V_{\text{out}}$ and $V_{\text{in}}$. For $v \in V_{\text{out}}$ and $w \in V_{\text{in}}$, we add an undirected edge $vw \in E(\Gamma)$ if and only if the directed edge $v \to w$ is in $E(G)$. 

Since every vertex in $G$ has out-degree $2$ and in-degree $2$, every vertex in $V_{\text{out}}$ has degree $2$ in $\Gamma$, and every vertex in $V_{\text{in}}$ has degree $2$ in $\Gamma$. Therefore, $\Gamma$ is a $2$-regular bipartite graph. 

A desired $1$-regular sub-digraph of $G$ corresponds to choosing exactly one outgoing edge and one incoming edge for each vertex in $G$. In $\Gamma$, this corresponds exactly to choosing a set of edges such that every vertex in $V_{\text{out}}$ and $V_{\text{in}}$ has degree $1$ in the chosen set. This is precisely the definition of a perfect matching of $\Gamma$. 

Because $\Gamma$ is a $2$-regular graph, it decomposes into a disjoint union of simple cycles. Moreover, since $\Gamma$ is bipartite, all of these cycles must be of even length. Let $n$ be the number of such cycles. Because $G$ is a simple digraph where every vertex has out-degree $2$, $G$ must contain at least $3$ vertices. Thus, $\Gamma$ is non-empty, meaning $n \ge 1$. 

For each even cycle, there are exactly $2$ perfect matchings (formed by taking alternating edges in the cycle). Since the cycles are disjoint, the choices of perfect matchings for each cycle are independent. Thus, the total number of perfect matchings in $\Gamma$ is $2^n$. Because $n \ge 1$, this is a power of $2$ greater than $1$, as desired.

**Second Solution (Linear Algebra over $\mathbb{F}_2$)**

For each directed edge $e \in E(G)$, we create an indicator variable $x_e \in \mathbb{F}_2$, where $x_e = 1$ if $e$ is kept and $x_e = 0$ if $e$ is closed. 

For each vertex $v \in V(G)$, we require the following:
- If $e_1$ and $e_2$ are the two edges leaving $v$, we must keep exactly one, so $x_{e_1} + x_{e_2} \equiv 1 \pmod 2$.
- If $e_3$ and $e_4$ are the two edges entering $v$, we must keep exactly one, so $x_{e_3} + x_{e_4} \equiv 1 \pmod 2$.

This yields a system of linear equations over $\mathbb{F}_2$. The solutions to this system form an affine subspace of $\mathbb{F}_2^{|E(G)|}$. Note that the all-ones vector $\vec{1}$ is a solution to the corresponding homogeneous system, because setting $x_e = 1$ for all $e$ gives $1 + 1 \equiv 0 \pmod 2$ for every equation. Thus, if $\vec{x}$ is a solution to the inhomogeneous system, then $\vec{x} + \vec{1}$ is also a solution. 

Because the solution set is an affine subspace, the number of solutions is either zero or a power of two. Furthermore, since the solutions come in natural pairs $\vec{x}$ and $\vec{x} + \vec{1}$ (and $\vec{x} \neq \vec{x} + \vec{1}$ in $\mathbb{F}_2$), the dimension of the solution space, if non-empty, is at least $1$. This means the number of solutions is a power of two greater than $1$. To complete the proof, one must show that there is at least one solution (i.e., the solution set is non-empty), which is guaranteed by the combinatorial argument in the first solution.


Grading guidelines:
(Partial) 1. Constructed the bipartite graph with two copies of the city set (out-copy and in-copy), and observed that choosing one outgoing and one incoming road at each city is equivalent to a perfect matching in this bipartite graph. 2. Proved that the bipartite graph is 2-regular, hence decomposes into a disjoint union of even cycles, and concluded that each cycle contributes exactly 2 alternating perfect matchings. 3. Set up the linear-algebra model over F2 with variables xe for roads and equations xe1+xe2=1 for each pair of outgoing roads and xe3+xe4=1 for each pair of incoming roads at a city, and deduced that the solution set (if nonempty) has size a power of 2. (Almost) 1. Correctly reduced the counting to counting perfect matchings in the associated 2-regular bipartite graph and obtained 2^n from the cycle decomposition, but did not justify that there is at least one cycle (or did not exclude the degenerate empty-graph case). 2. Completed the F2 affine-subspace argument and showed solutions come in pairs x and x+1, but did not prove existence of at least one feasible selection of roads (non-emptiness of the solution set). 3. Solution is almost complete, but made minor mistakes which are not negligible.