http://campus.northpark.edu/wicksBook/GraphTheory/bipartite/index.html

Section 1.5: Bipartite Graphs


Introduction to Bipartite Graphs

The last two questions we have considered, regarding shortest paths and least cost networks, have been quite practical. In this section, we return to a more light-hearted question. Imagine that there is a group of seven acquaintances: Maria, Kristen, Jeff, Marcos, Jill, Tom, and Anna. They all wish to get from Chicago to Florida for Spring Break and they only have two cars. However, they do not all get along so well, and it would be best for everyone's sanity on the 18 hr. trip, if they could divide into two groups that were mutually compatible.

Maria and Marcos just broke up, so they should not be in the same car. Tom has starting dating Maria, so there is some tension between he and Marcos. Anna has been trying to get Tom to notice her since freshman year, so she is miffed at Maria. Jeff just beat out Tom for the starting wide-receiver position on the football team, and there is some resentment there. Kristen and Jeff are jealous of Jill, because she is first-chair violinist in the orchestra, and they are third- and fourth-chairs, respectively. Finally, Kristen thinks that Tom is a bit vain.

It would be easier to sort through all of these complex relationships, if we could picture this situation. Consider the following graph:

Notice how this graph accurately reflects our situation (if you cannot see yet how it does, click here). Converted to Graph Theory, the question is now:

How do we divide the vertices into two groups, so that no two vertices in the same group are connected by an edge?

We can indicate the two groups graphically, by coloring the vertices with two different colors, say red and blue. In these terms, our question is:

How do we color the vertices with two colors, so that no two adjacent vertices have the same color?

We will refer to this as a two-coloring. We call a graph that has a two-coloring as a bipartite ("bi-" = "two", "part" = "group", "-ite" = adjectival suffix) graph.

Simply by following our noses, we can invent an algorithm to answer this question. While it is not associated with any given mathematician, we might call it the Two-Coloring algorithm:

Start
Pick any vertex and color it blue.
 
Repeat
Color all of the vertices adjacent to those from the previous step the opposite color used in the previous step.
 
Warnings
Avoid coloring adjacent vertices the same color.
 
Stop
When you have colored every vertex, you should stop.

In our example, starting with Marcos, this would take four steps:

Start

 
Repeat


This is a valid two-coloring, since we have colored every vertex and no adjacent vertices have the same color. Note: If we could not use color, we could mark each vertex with a different symbol, such as a triangle or square:

as long as we clearly indicate the division into two groups. We can also highlight this division by repositioning the vertices:

This clearly shows that we should put Tom, Maria, and Jill in one car, and the rest in the other car.


important.gif (2242 bytes)Make sure that you understand this algorithm by completing the following exercises.


Non-Bipartite Graphs

In the previous section, we saw how to show that a graph is bipartite by producing a two-coloring. However, just as not all graphs are Eulerian, not all graphs are bipartite; and in the same way, it is important to be able to quickly distinguish between bipartite and non-bipartite graphs, so that we do not waste time trying to do the impossible. The most basic examples of graphs are cycles, such as:

You can see that the second and fourth graphs are bipartite, while the first and third do not seem to be. You should have noticed in a previous Exercise that bipartite graphs only seem to contain "even" cycles (i.e., cycles with an even number of edges). These few examples should make clear that "odd" cycles, and hence any graph containing an odd cycle, cannot be two-colored. For example, if we try to two-color the following graph:

we will reach a point where we seem to be "stuck". That is because of the odd cycle in the graph (shown in blue):

Note: If you look carefully, you can even find another 5-edge cycle. Since we cannot two-color this odd cyle, we cannot two-color the entire graph.

To summarize, for any graph, either:

  • the graph is bipartite, which we can demonstrate by applying the Two-coloring algorithm, or
  • the graph is not bipartite, which we can demonstrate by exhibiting an odd cycle.

important.gif (2242 bytes)Make sure that you understand these concepts by completing the following exercises.


Go to Planar Graphs


Table of Contents Send questions or comments to jwicks@northpark.edu Glossary