Professional Documents
Culture Documents
Graph Coloring
Graph Coloring
There is a connection between coloring maps and graph theory. This connection has
many practical applications, from scheduling tasks, to designing computers, to playing
Sudoku. Later in this section we will look more closely at some of these applications.
Suppose the map in Figure 5.21 shows the countries, labeled as letters, of a continent.
D We will assume that no country is split into more than one piece and countries that touch
C at just a corner point will not be considered neighbors. We can represent each country by
B a vertex, placed anywhere within the boundary of that country. We will then connect two
A vertices with an edge if the two corresponding countries are neighbors—that is, if they
E
share a common boundary. The result is shown in Figure 5.22.
G
F
D D
C
FIGURE 5.21 C
B
A B
E
A E
G
G
F
F
If we erase the boundaries of the countries, we are left with the graph in Figure
5.23. The resulting graph will always be a planar graph, because the edges simply con-
nect neighboring countries. Our map-coloring question then becomes: Can we give each
vertex of the graph a color such that no two vertices connected by an edge share the same
color? How many different colors will be required? If this can be accomplished using four
colors, for instance, we will say that the graph is 4-colorable. The graph in Figure 5.23
is actually 3-colorable; only three colors are necessary. One possible coloring is given in
Figure 5.24. A colored map for Figure 5.21 based on the colors of the vertices of the graph
is in Figure 5.25.
SEC T ION 5.4 | Graph Coloring 277
D
D
C C
B B
A E
A E
G
G F
F
FIGURE 5.24 FIGURE 5.25
▼ Four-Color Theorem
Every planar graph is 4-colorable.
The ctional map below shows the boundaries of countries on a rectangular continent.
Represent the map as a graph, and nd a coloring of the graph using the fewest possible
number of colors. Then color the map according to the graph coloring.
Solution
First draw a vertex in each country and then connect two vertices with an edge if the
corresponding countries are neighbors. (See the rst gure on the next page.) Now try
to color the vertices of the resulting graph so that no edge connects two vertices of the
same color. We know we will need at least two colors, so one strategy is simply to pick
a starting vertex, give it a color, and then assign colors to the connected vertices one by
one. Try to reuse the same colors, and use a new color only when there is no other op-
tion. For this graph we will need four colors. (The four-color theorem guarantees that
we will not need more than that.) To see why we will need four colors, notice that the
one vertex colored green in the following gure connects to a ring of ve vertices. Three
different colors are required to color the ve-vertex ring, and the green vertex connects
to all these, so it requires a fourth color.
answer No. This graph is K5, and therefore it is not a planar graph, so the four-color theorem does not
apply.
278 CHAPTER 5 | The Mathematics of Graphs
yellow
green red
blue
yellow blue
blue
blue
blue red
Now we color each country the same color as the coresponding vertex.
Find the chromatic number of the Utilities Graph from Section 5.3.
X Y Z
TA K E N O T E
Eight different school clubs want to schedule meetings on the last day of the semester.
Some club members, however, belong to more than one of these clubs, so clubs that share
members cannot meet at the same time. How many different time slots are required so
that all members can attend all meetings? Clubs that have a member in common are
indicated with an “X” in the table below.
Ski club — X X X X
Student X — X X X
government
Debate club X — X X X
Honor society X X X — X X
Student X X — X X
newspaper
Community X X X — X X
outreach
Campus X X X —
Democrats
Campus X X X —
Republicans
Solution
We can represent the given information by a graph. Each club is represented by a vertex,
and an edge connects two vertices if the corresponding clubs have at least one common
member.
SC
CR SG
CD DC
CO HS
SN
SEC T ION 5.4 | Graph Coloring 281
Two clubs that are connected by an edge cannot meet simultaneously. If we let a color
POINT OF INTEREST correspond to a time slot, then we need to nd a coloring of the graph that uses the
fewest possible number of colors. The graph is not 2-colorable, because we can nd
Sudoku puzzles like the one shown circuits of odd length. However, by trial and error, we can nd a 3-coloring. One ex-
here have become extremely popular. ample is shown below. Thus the chromatic number of the graph is 3, so we need three
To complete the puzzle, one must ll
different time slots.
each square of the grid with a digit
from 1 to 9 so that each row, each col- SC
umn, and each 333 subgrid contains
the digits 1 through 9 (and so no digit CR SG
is repeated).
5 3 7
6 1 9 5 CD DC
9 8 6
8 6 3
4 8 3 1
7 2 6 CO HS
6 2 8 SN
4 1 9 5
8 7 9 Each color corresponds to a time slot, so one scheduling is
First time slot: ski club, debate club, student newspaper
Two mathematicians, Agnes Herz-
berg and M. Ram Murty, used graph Second time slot: student government, community outreach
theory to analyze the puzzles. We can Third time slot: honor society, campus Democrats, campus Republicans
represent each of the 81 squares by a
vertex; connect two vertices with an
edge if the squares are in the same row,
▼ check your progress 3 Six friends are taking a lm history course and,
because they have procrastinated, need to view several lms the night before the nal
column, or subgrid. Then associate
exam. They have rented a copy of each lm on DVD, and they have a total of three DVD
each of the numbers 1 through 9 with a
players in different dorm rooms. If each lm is two hours long and they start watching at
different color. A solution to the puzzle
corresponds to a coloring of the graph 8:00 .., how soon can they all be nished watching the required lms? Create a view-
using nine colors where no edge con- ing schedule for the friends.
nects vertices of the same color. Film A needs to be viewed by Brian, Chris, and Damon.
The researchers used graph theory
to prove that at least eight of the nine Film B needs to be viewed by Allison and Fernando.
digits must appear at the start of the Film C needs to be viewed by Damon, Erin, and Fernando.
puzzle in order for it to have a unique
Film D needs to be viewed by Brian and Erin.
solution. It is still not known how
many of the squares must be revealed Film E needs to be viewed by Brian, Chris, and Erin.
initially to have a unique solution, but
Solution See page S19. ◀
they found an example with only 17
given entries. They also showed that
there are about 5.5 billion possible
Sudoku puzzles! ▼ example 4 A Scheduling Application of Graph Coloring
Five classes at an elementary school have arranged a tour at a zoo where the students get
to feed the animals.
Class 1 wants to feed the elephants, giraffes, and hippos.
Class 2 wants to feed the monkeys, rhinos, and elephants.
Class 3 wants to feed the monkeys, deer, and sea lions.
Class 4 wants to feed the parrots, giraffes, and polar bears.
Class 5 wants to feed the sea lions, hippos, and polar bears.
If the zoo allows animals to be fed only once a day by one class of students, can the tour
be accomplished in two days? (Assume that each class will visit the zoo only on one day.)
If not, how many days will be required?
282 CHAPTER 5 | The Mathematics of Graphs
Solution
No animal is listed more than twice in the tour list, so you may be tempted to say that
only two days will be required. However, to get a better picture of the problem, we can
represent the situation with a graph. Use a vertex to represent each class, and connect
two vertices with an edge if the corresponding classes want to feed the same animal.
Then we can try to nd a 2-coloring of the graph, where a different color represents a
different day at the zoo.
1
5 2
4 3
Note that the graph contains a circuit, 1 – 4 – 5 – 1, consisting of three vertices. This cir-
cuit will require three colors, and the remaining vertices will not require additional
colors. So the chromatic number of the graph is 3; one possible coloring is given below.
Using this coloring, three days are required at the zoo. On the rst day classes 2 and 5,
represented by the blue vertices, will visit the zoo; on the second day classes 1 and 3, rep-
resented by the red vertices, will visit the zoo; and on the third day class 4, represented
by the green vertex, will visit the zoo.
5 2
4 3
▼ check your progress 4 Several delis in New York City have arranged
deliveries to various buildings at lunchtime. The buildings’ managements do not want
more than one deli showing up at a particular building in one day, but the delis would
like to deliver as often as possible. If they decide to agree on a delivery schedule, how
many days will be required before each deli can return to the same building?
Deli A delivers to the Empire State Building, the Statue of Liberty, and Rockefeller
Center.
Deli B delivers to the Chrysler Building, the Empire State Building, and the New
York Stock Exchange.
Deli C delivers to the New York Stock Exchange, the American Stock Exchange,
and the United Nations Building.
Deli D delivers to New York City Hall, the Chrysler Building, and Rockefeller
Center.
Deli E delivers to Rockefeller Center, New York City Hall, and the United Nations
Building.
EXCURSION
Photolibrary
C
D
A
B
B EF
FIGURE 5.26
A C We can represent the trafc patterns with a graph; each vertex will represent one of
the six possible trafc paths, and we will draw an edge between two vertices if the cor-
responding paths would allow vehicles to collide. The result is the graph shown in Fig-
ure 5.27. Because we do not want to allow vehicles to travel simultaneously along routes
F D on which they could collide, any vertices connected by an edge can allow trafc to move
only during different parts of the light cycle. We can represent each portion of the cycle by
E
a color. Our job then is to color the graph using the fewest colors possible.
There is no 2-coloring of the graph because we have a circuit of length 3: A – D – E –
FIGURE 5.27 A. We can, however, nd a 3-coloring. One possibility is given in Figure 5.28.
A C
F D
E
FIGURE 5.28
A 3-coloring of the graph means that the trafc lights at the intersection will have to
go through a three-stage cycle. One stage will allow the trafc routes corresponding to the
red vertices to proceed, the next stage will let the paths corresponding to the blue vertices
to proceed, and nally, the third stage will let path E, colored green, proceed.
284 CHAPTER 5 | The Mathematics of Graphs
Although safety requires three stages for the lights, we can rene the design to al-
B low more trafc to travel through the intersection. Note that at the third stage, only one
route, path E, is scheduled to be moving. However, there is no harm in allowing path B
to move at the same time, since it is a right turn that doesn’t conict with route E. We
A C
could also allow path F to proceed at the same time. Adding these additional paths cor-
responds to adding colors to the graph in Figure 5.28. We do not want to use more than
three colors, but we can add a second color to some of the vertices while maintaining
the requirement that no edge can connect two vertices of the same color. The result is
F D
shown in Figure 5.29. Notice that the vertices in the triangular circuit A – D – E – A can
be assigned only a single color, but the remaining vertices can accommodate two colors.
E In summary, our design allows trafc paths A, B, and C to proceed during one
stage of the cycle, paths C, D, and F during another, and paths B, E, and F during the
FIGURE 5.29 third stage.
EXCURSION EXERCISES
1. A one-way road ends at a two-way street. The intersection and the different possible
trafc routes are shown in the gure below. The one-way road has a left-turn light.
Represent the trafc routes with a graph and use graph coloring to determine the
minimum number of stages required for a light cycle.
Venezuela Guyana
Colombia Suriname
French Guiana
Ecuador
Brazil
3. Peru
Bolivia
Paraguay
Chile Uruguay
Argentina
4.
8. Provinces of South Africa
6 7 8
5 4
2
■ Map Coloring In Exercises 5 to 8, represent the map by a
graph and nd a coloring of the graph that uses the smallest 3
possible number of colors. 1
11. 12.
■ In Exercises 15 to 20, determine (by trial and error) the 17. 18.
chromatic number of the graph.
15.
19. 20.
16.
21. Scheduling Six student clubs need to hold meetings on the same day, but some
students belong to more than one club. In order to avoid members missing meetings,
the meetings need to be scheduled during different time slots. An “X” in the table
below indicates that the two corresponding clubs share at least one member. Use
graph coloring to determine the minimum number of time slots necessary to ensure
that all club members can attend all meetings.
Student newspaper — X X
Honor society — X X X
Biology association X X — X
Gaming club X — X X
Debate team X X X —
Engineering club X X —
22. Scheduling Eight political committees must meet on the same day, but some
members are on more than one committee. Thus any committees that have members
in common cannot meet at the same time. An “X” in the following table indicates
that the two corresponding committees share a member. Use graph coloring to
determine the minimum number of meeting times that will be necessary so that all
members can attend the appropriate meetings.
SEC T ION 5.4 | Graph Coloring 287
Appropriations — X X X
Budget — X X
Finance X — X X X
Judiciary X X — X X
Education — X X
Health X X X —
Foreign affairs X X X —
Housing X X X —
23. Scheduling Six different groups of children would like to visit the zoo and feed
different animals. (Assume each group will visit the zoo on only one day.)
Group 1 would like to feed the bears, dolphins, and gorillas.
Group 2 would like to feed the bears, elephants, and hippos.
Group 3 would like to feed the dolphins and elephants.
Group 4 would like to feed the dolphins, zebras, and hippos.
Group 5 would like to feed the bears and hippos.
Group 6 would like to feed the gorillas, hippos, and zebras.
Use graph coloring to nd the minimum number of days that are required so that
all groups can feed the animals they would like to feed but no animals will be fed
twice on the same day. Design a schedule to accomplish this goal.
24. Scheduling Five different charity organizations send trucks on various routes to
pick up donations that residents leave on their doorsteps.
Charity A covers Main St., First Ave., and State St.
Charity B covers First Ave., Second Ave., and Third Ave.
Charity C covers State St., City Dr., and Country Lane.
Charity D covers City Dr., Second Ave., and Main St.
Charity E covers Third Ave., Country Lane, and Fourth Ave.
Each charity has its truck travel down all three streets on its route on the same
day, but no two charities wish to visit the same streets on the same day. Use graph
coloring to design a schedule for the charities. Arrange their pickup routes so that
no street is visited twice on the same day by different charities. The schedule should
use the smallest possible number of days.
25. Scheduling Students in a lm class have volunteered to form groups and create
Creatas/PictureQuest
several short lms. The class has three digital video cameras that may be checked
out for one day only, and it is expected that each group will need the entire day to
nish shooting. All members of each group must participate in the lm they volun-
teered for, so a student cannot work on more than one lm on any given day.
288 CHAPTER 5 | The Mathematics of Graphs
E X T E N S I O N S
Critical Thinking
27. Wi-Fi Stations An ofce building is installing eight Wi-Fi transmitting stations. Any
stations within 200 feet of each other must transmit on different channels. The engi-
neers have a chart of the distance between each pair of stations. Suppose that they draw
a graph where each vertex represents a Wi-Fi station and an edge connects two vertices
if the distance between the stations is 200 feet or less. What would the chromatic num-
ber of the graph tell the engineers?
■ Maps In Exercises 28 to 30, draw a map of a ctional continent with country boundaries
corresponding to the given graph.
28. 29. 30.
31. Map Coloring Draw a map of a ctional continent consisting of four countries, where
the map cannot be colored with three or fewer colors without adjacent countries shar-
ing a color.
32. If the chromatic number of a graph with ve vertices is 1, what must the graph look
like?