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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | luogu_official | 150 |
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).