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?
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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?
Название |
---|
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).