Is it possible to split (each vertex should be exactly in one subgraph) a connected graph with 2n vertices into two induced subgraphs (each subgraph must have at least one vertex) so that the degree of each vertex of each subgraph becomes even?
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
Is it possible to split (each vertex should be exactly in one subgraph) a connected graph with 2n vertices into two induced subgraphs (each subgraph must have at least one vertex) so that the degree of each vertex of each subgraph becomes even?
Name |
---|
A discussion on this problem can be found here.
Thank you so much but the problem statement in that link is a little different, in that version empty subgraphs are allowed but in this version they are not allowed.
The only remaining case is when all the degrees are even. For graphs on 2 vertices, this is easy to verify to be true.
Now let's solve the problem for the case when there are $$$2n \ge 4$$$ vertices. If all vertices are isolated, we are done. Else, consider any edge $$$(u, v)$$$. Loop over the neighbours $$$x$$$ of $$$u$$$ and the neighbours $$$y$$$ of $$$v$$$, and toggle the existence of the edge $$$(x, y)$$$ each time. Now remove $$$(u, v)$$$ from the graph. The resulting graph $$$G'$$$ is also a graph with all even degrees, and is on $$$2(n-1)$$$ vertices, so it satisfies the inductive hypothesis.
So there is a partition of the vertices of $$$G'$$$ into two non-empty sets such that the degrees of the vertices in the subgraphs of $$$G'$$$ induced by the partition are all even. Now we only need to add back $$$u$$$ and $$$v$$$ into these subgraphs and preserve the condition. Note that $$$(u, v)$$$ was an edge, so the remaining number of neighbours of $$$u$$$ in the original graph is odd. So exactly one partition has an odd number of neighbours of $$$u$$$, and the same goes for $$$v$$$. We will add $$$u$$$ to the partition with an odd number of neighbours of $$$v$$$ and vice versa — it is easy to verify that this works (in fact, we have a bijection, so there is exactly one way, modulo swapping, to partition the vertices suitably).