Bipartite Graphs
Bipartite Graphs
If P is a path from the vertex v to the vertex u, we refer to P as a v-u path (or often just a vu-
path). If P is a v-u path, say v = v0 v1v2 …vk …vm = u , then we refer to vi vi +1 …v j (for any
0 ! i < j ! m ) as the vi - v j subpath of P. A shortest v-u path is called a v-u geodesic.
Note that if the path P: v = v0 v1v2 …vk …vm = u is a v-u geodesic, then for every 0 ! i ! m ,
d(v, vi ) = i, and in particular the length of a v-u geodesic is d(v,u), the distance from v to u.
Also, for any such v-u geodesic, d(vi ,u) = m ! i . Thus if x is any vertex on P, the v-x subpath
of P is a shortest v-x path, and the x-u subpath of P is a shortest x-u path. Thus x = v j where
d(v, x) = j .
Definition. A graph G is bipartite if it is the trivial graph or if its vertex set can be partitioned
into two independent, non-empty sets A and B.
We refer to { A, B} as a bipartiton of V (G).
Note: Some people require a bipartite graph to be non-trivial.
Examples include any even cycle, any tree, and the graph below.
A Few Observations
(i). No odd cycle is bipartite.
(ii). Trees are bipartite.
(iii). If G is bipartite, then so is every subgraph of G.
(iv). If G is bipartite, then it is possible to assign colors red and blue to the vertices of G in
such a way, that no two vertices of the same color are adjacent.
(v). G is bipartite if and only if each of its components is bipartite.
Theorem. A graph G is bipartite if and only if it has no odd cycles.
Proof. First, suppose that G is bipartite. Then since every subgraph of G is also bipartite, and
since odd cycles are not bipartite, G cannot contain an odd cycle. That’s the easy direction.
Now suppose that G is a non-trivial graph that has no odd cycles. We must show that G is
bipartite. So we must determine a partition of the vertices of G into independent sets.
It is enough to prove our result for connected graphs since if G is bipartite, so is every
component of G (and vice versa).
So, now consider any vertex a of G. Let A = {v : d(v, a) is even}. Similarly, define,
B = {v : d(v, a) is odd} . Clearly then V (G) = A !
! B . We will be finished if we can show that
A and B are independent sets.
So we assume that A is not independent and show that this leads to a contradiction.
Suppose that x and y are adjacent vertices of A. We may assume that for some integers k, m
that d(a, x) = 2k,!and d(a, y) = 2m.
We might notice here that y cannot be on P and x cannot be on Q . (Be sure that you can
explain why this is true.)
So, w = v j = u j where d(a, w) = j . So now consider P ! , the w-x subpath of P, and Q! , the
w-y subpath of Q. Then V ( P ! ) " V (Q! ) = {w}.
But then the cycle formed by following P ! from w to x, then the edge xy, and then following
Q! in reverse from y to w is an odd cycle; more precisely, the cycle
w = v j v j +1v j + 2 …v2 k !1 xyu2 m !1u2 m ! 2 …w has length ( 2k ! j ) +)(2m ! j) + 1 = 2(k + m ! j) + 1 ,
which is odd.
But this contradicts the assumption that G has no odd cycles. Thus it must be that A is
independent. A similar argument shows that B is independent.
So our result is proven.