Let $G = (V, E)$ be a simple graph. $G$ is bipartite if and only if every cycle has even length

72 Views Asked by At

I'm trying to prove:

Let $G = (V, E)$ be a simple graph. G is bipartite if and only if every cycle has even length.

For the left-to-right implication, I did the following: suppose G is bipartite, let $\{V_1,V_2 \}$ be the two sets of our partition of $V$ and that there exists a cycle with odd length. So we can consider the closed path $v_0e_1v_1 \dots v_{2n}e_{2n+1}v_0$ and WLOG that $v_0$ $\in$ $V_1$, but now as G is bipartite and $v_{2n}$; $v_0$ are adjacent, then $v_{2n}$ should belong to $V_2$. In other hand, we can inductively verify that $v_{2n}$ must belong to $V_1$. So we arrived at a contradiction.

For the other implication, I started at a vertex $v_0$ and consider a depth-first spanning tree $T$ rooted at $v_0$ and if $v$ $\in$ $T$ and $v_0$ are adjacent or have any other odd distance between them, then $v$ $\in$ $V_1$, then if the distance from $v_0$ to $v \in T$ is even, then $v$ $\in$ $V_2$. Now if we'd suppose that distinct $x,y \in V_2$ were connected, there'd be a cycle with odd length passing through $v_0$, $x$ and $y$. But how should I proceed if $x,y$ are not in T?

EDIT: I could consider each connected component and form a partition, picking one block from each component and take its union and then form the other block considering the complement of the union?