You are on page 1of 33

1

Module 6: The Mathematics of Graphs

Module 6: Mathematics of Graphs

Learning Outcomes: At the end of the lesson, the students are expected to:
a) construct graph and Euler circuit using Eulerian Graph Theorem and Eulerian Path Theorem
b) construct and apply the weighted graph, Hamiltonian circuits and algorithm in real-life situations
c) construct and demonstrate Euler’s formula, planar and nonplanar graphs
d) illustrate and apply graph coloring and different graph coloring theorems in real-life situations
e) support the use of mathematics in various aspects and endeavors in life
f) explore the applications of graphs

Engage: Let’s Try This!


In the early eighteenth century, the Pregel River in a city called Königsberg surrounded an island before splitting in two. Seven bridges crossed the river and connected four
different land areas, similar to the map drawn in the given figure below.

Many citizens of the time attempted to take a stroll that would lead them across each bridge and return them to the starting point without traversing the same bridge twice.
None of them could do it, no matter where they chose to start.

1. Using pencil and paper, show five ways that it is impossible to take a stroll that across each bridge and return to the starting point without traversing the same bridge
twice.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
2
Module 6: The Mathematics of Graphs

Explore: Discover This!

Watch the following video clip, “How the Königsberg bridge problem changed mathematics - Dan Van der Vieren”
(https://www.youtube.com/watch?v=nZwSo4vfw6c), and answer the following questions.

1. What are the three things that I significantly learned from the video clip?
2. What are the three things that still unclear to me?
3. Complete the statement: I used to think that …
4. What are the three questions that I want to ask about the video clips.

Explain: Clarify Your Lesson!

Lesson 1: Graphs and Euler Circuits


Think of all various connections we experience in our lives – friends are connected on Facebook, cities are connected by roads,
computers are connected across Internet. A branch of Mathematics called graph theory illustrates and analyzes connections such as these.
For example, the diagram in Figure 1 could represent friends that are connected on Facebook. Each dot represents a person, and a line
segment connecting two dots means that those two people are friends on Facebook. This type of diagram is called a graph.
A graph is a set of points called vertices and line segments or curves called edges that connect vertices.
Figure 1

The three graphs in Figure 2 are the same graph as in Figure 1 but used
in different contexts. Note that the replacement of the vertices has nothing to
do with geographical location; in fact, the vertices can be shown in any
arrangement we choose.

a b c

Figure 2
Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
3
Module 6: The Mathematics of Graphs

Example 1: Constructing a Graph. The following table lists five students at a college. An “X” indicates that the two students participate in the same study group this semester.
Table 1

a) Draw a graph that represents this information where each vertex represents a student and an edge connects two vertices if the corresponding
students study together.
b) Use your graph to answer the following questions: Which student is involved in the most study groups with the others? Which student has only
one study group in common with the others? How many study groups does Laura have in common with the others?

Solution
a.) We draw five vertices (in any configuration we wish) to represent the five students, and connect the vertices with edges according to the table.
Figure 3

b.) The student which involved in the most study groups with the others is Amber. The student which has only one study group in common with the others is Kayla. Laura has two
study groups in common with the others.
Other forms of graph

a b c d

Figure 4

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
4
Module 6: The Mathematics of Graphs

The graph in Figure 4a has five vertices but no edges and is referred to a null graph. It is also an example of a disconnected graph. The Figure 4b is a connected graph that
has a pair of multiple edges. Note that two edges cross in the center, but there is no vertex there. Unless a dot is drawn, the edges are considered to pass over each other without
touching. The graph in Figure 4c is not connected: it consists of two different sections. It also contains a loop. Figure 4d is a connected graph in which every possible edge is drawn
between vertices (without any multiple edges). Such a graph is called a complete graph.
The three graphs shown below are considered equivalent graphs because the edges form the same connections of vertices in each graph.

a. b. c.

Figure 5
Analysis: Is the following graph (Figure 6) a complete graph? Why?

Figure 6
Euler Circuits

In the early eighteenth century, the Pregel River in a city called Kö nigsberg (located in modern-day Russia and now called Kaliningrad) surrounded an island before splitting
in two. Seven bridges crossed the river and connected four different land areas, similar to the map drawn below (Figure 7).

Figure 7 Figure 8a Figure 8b


Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
5
Module 6: The Mathematics of Graphs

Many citizens of the time attempted to take a stroll that would lead them across each bridge and return them to the starting point without traversing the same bridge twice.
None of them could do it, no matter where they chose to start. In 1736, the Swiss mathematician Leonhard Euler (1707 – 1783) proved that it is, in fact, impossible to walk such a
path. To solve the Kö nigsberg bridges problem, we can represent the arrangement of land areas and bridges with a graph. The geographical situation shown in Figure 8a above.

A path in a graph can be thought of as a movement from one vertex to another by traversing edges. We can refer to our movement by vertex letters. For example, in the graph
in Figure 8b, one path would be A–B–A–C. If a path ends at the same vertex, at which it started, it is considered a closed path, or circuit. For the graph in Figure 9, the path A–D–
F–G–E–B–A is a circuit because it begins and ends at the same vertex. The path A–D–F–G–E–H is not a circuit, as it does not begin and end at the same vertex.

Figure 9
A circuit that uses every edge, but never uses the same edge twice, is called an Euler circuit. (The path may cross through vertices more than once). The path B–D–F–G–
H–E–C–B–A–D–G–E–B in Figure 9 is an Euler circuit. It begins and ends at the same vertex and uses every edge exactly once. The path A–B–C–E–H–G–E–B–D–A is not an Euler
circuit. The path begins and ends at the same vertex but it does not use edges DF, DG, or FG. The path A–B–C–E–H–G–F–D–A–B–E–G–D–A begins and ends at A but uses edges
AB and AD twice so it is not an Euler circuit. Thus, for an Euler circuit to exist, the degree of every vertex would have to be an even number. Furthermore, he was able to show
that any graph that has even degree at every vertex must have an Euler circuit. Consequently, such graphs are called Eulerian.

Theorem 1: Eulerian Graph Theorem: A connected graph is Eulerian if and only if every vertex of the graph is of even degree.

Example 2
1. Which of the following graphs has an Euler circuit?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
6
Module 6: The Mathematics of Graphs

Solution:
Figure 10a does not have an Euler circuit (C and D are of odd degree), Figure 10b has an Euler circuit (All vertices
are of even degree).

Figure 10

2. Does the graph shown below have an Euler circuit?

Figure 11

Solution: The graph (Figure 11) shown does not have an Euler circuit (B, C, E, G are not of even degree)

Euler Paths
Theorem 2: Euler Path Theorem: A connected graph contains an Euler path if and only if the graph has two vertices of odd degree with all other vertices of even degree.
Furthermore, every Euler path must start at one of the vertices of odd degree and end at the other.

Example 3: A photographer would like to travel across all of the roads shown on the following map. The photographer will rent a car that need not be returned to the same city, so
the trip can begin in any city. Is it possible for the photographer to design a trip that traverses all of the roads exactly once?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
7
Module 6: The Mathematics of Graphs

a b
Figure 12
Solution:
Let be the first letter of the word represents the city (Alameda = A, Burley = B, Caldwell = C, Dover = D, Evanston = E, Fair mont = F, Grangeville = G). Determine if the
Figure 12a contains an Euler Path. Since each vertex (represents as city) has an even degree and two vertices have an odd degree, then the graph contains an Euler Path. The possible
trip of the photographer is A-B-C-D-B-F-A-G-F-E-D.

Lesson 2: Weighted Graphs


Hamiltonian Circuits and Weighted Graphs
For instance, Figure 12 shows the map of cities. If our priority is to visit each city, we could travel along the route A–B–C–D–E–F–G–A (abbreviating the cities). This path
visits each vertex once and returns to the starting vertex without visiting any vertex twice. We call such a path a Hamiltonian circuit.

Hamiltonian Circuit. A Hamiltonian circuit is a path that uses each vertex of a graph exactly once. A graph that contains a Hamiltonian circuit is called Hamiltonian.

Theorem 3:

Dirac’s Theorem. Consider a connected graph with at least three vertices and no multiple edges. Let 𝑛 be the number of vertices in the graph. If every vertex has degree of at least
𝑛
, then the graph must be Hamiltonian.
2

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
8
Module 6: The Mathematics of Graphs

Example 4: The graph below shows the available flights of a popular airline. (An edge between two vertices in the graph means that the airline has direct flights between the two
corresponding cities.) Apply Dirac’s theorem to verify that the following graph is Hamiltonian. Then find a Hamiltonian circuit. What does the Hamiltonian circuit represent in terms
of flights?

Figure 13
Solution:
Using Dirac’s Theorem, the graph is Hamiltonian because it contains at least three vertices, each vertex does not contain multiples edges and every vertex has degree of at least
n 6
3 (   3 ). One Hamiltonian circuit is Portland-Boise-Butte-Salt Lake City-Reno-Sacramento-Portland, which represents a sequence of flights that visits each city and returns to
2 2
the starting city without visiting any city twice.
A weighted graph is a graph in which each edge is associated with a value, called weight.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
9
Module 6: The Mathematics of Graphs

Example 5: The table below lists the distances in miles between six popular cities that a particular airline fly to. Suppose a traveler would like to start in Chicago, visit the other five
cities this airline flies to, and return to Chicago. Find three different routes that the traveler could follow, and find the total distance flown for each route.

Solution:
Table 2
The various solution will be simpler to analyze if we first organize the
information in a graph. Begin by letting each city be represented by a vertex. Draw
an edge between two vertices if there is a flight between the corresponding cities,
and label each edge with a weight that represents the number of miles between the
two cities. A route that visits each city just once corresponds to a Hamiltonian circuit.
Beginning at Chicago, one such circuit is Chicago-New York-Dallas-Philadelphia-
Atlanta-Washington DC-Chicago. By adding the weights of each edge in the circuit,
we see that the total number of miles travelled is 713 + 1374 + 1299 + 670 + 544 +
597 = 5197.

Figure 14
Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
10
Module 6: The Mathematics of Graphs

Algorithms in Complete Graphs


The graph shown in Figure 15, with only 6 vertices, has 60 unique Hamiltonian circuits. If we have a graph with 12 vertices, and every vertex is connected to every other by
an edge, there are almost 20 million different Hamiltonian circuits! There are two algorithms, the greedy algorithm and the edge-picking algorithm, that can be used to find a solution.
Both of these algorithms apply only to complete graphs – graphs in which every possible edge is drawn between vertices (without any multiple edges). For instance, the graph in
Figure 15 is a complete graph with six vertices.

The Greedy Algorithm


1. Choose a vertex to start at, then travel along the connected edge that has the smallest weight. (If two or more edges have the same weight,
pick any one.)
2. After arriving at the next vertex, travel along the edge of smallest weight that connects to a vertex not yet visited. Continue this process until
you have visited all vertices.
3. Return to the starting vertex.
Figure 15
Example 6
Figure 15
Use the greedy algorithm to find a Hamiltonian circuit in the weighted graph shown in Figure 16. Start at vertex A.

Solution:
Begin at A. The weights of the edges from A are 13, 5, 4, 15, and 8. The smallest is 4. Connect A to D. At D, the edge with the smallest
weight is DB. Connect D to B. At B, the edge with the smallest weight is BF. Connect B to F. At F, the edge with the smallest weight, 7,
is FD. However, D has already been visited. Choose the next smallest weight, edge FE. Connect F to E. At E, the edge with the smallest
weight whose vertex has not been visited is C. Connect E to C. All vertices have been visited, so we are at step 3 of the algorithm. We
return to the starting vertex by connecting C to A. The Hamiltonian circuit is A-D-B-F-E-C-A. The weight of the circuit is
4+2+5+10+6+15=42.

The Edge-Picking Algorithm


1. Mark the edge of smallest weight in the graph. (If two or more edges have the same weight, pick any one.)
2. Mark the edge of next smallest weight in the graph, as long as it does not complete a circuit and does not add a third marked edge to a
single vertex.
Figure 16 3. Continue this process until you can no longer mark any edges. Then mark the final edge that completes the Hamiltonian circuit.
Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
11
Module 6: The Mathematics of Graphs

Example 7:
Use the edge-picking algorithm to find a Hamiltonian circuit in Figure 17.

Solution: We first highlight the edge of smallest weight, namely BD with weight 2. The edge of next smallest weight is AD with weight 4.
The next smallest weight is 5, which appears twice, with edges AE and FB. We can mark both of them. There are two edges of weight 6 (the next
smallest weight), BC and EC. We cannot use BC because it would add a third marked edge to vertex B. We mark edge EC. We are now at step 3
of the algorithm; any edge we mark will either complete a circuit or add a third edge to a vertex. So, we mark the final edge to complete the
Hamiltonian circuit, edge FC. Beginning at vertex A, the Hamiltonian circuit is A-D-B-F-C-E-A. (In the reverse direction, an equivalent circuit is
A-E-C-F-B-D-A.) The total weight of the circuit is 4+2+5+14+6+5=36.

Figure 17

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
12
Module 6: The Mathematics of Graphs

Elaborate: Challenge Yourself!

A. Determine the following:


1. A garbage collector would like to collect the garbage in all the streets of a subdivision along a shortest possible path. Is this an Eulerian or Hamiltonian problem? Explain
why.
2. A school bus driver would like to bring the kids back to their homes along a least expensive route. Is this an Eulerian or Hamiltonian problem? Explain why?
3. Route Planning. A city engineer needs to inspect the traffic signs at each street intersection of a neighborhood. The engineer has drawn a graph to represent the neighborhood,
where the edges represent the streets and the vertices correspond to street intersections. Would the most efficient route to drive correspond to an Euler circuit, a Hamiltonian
circuit, or neither? (The engineer must return to the starting location when finished.) Explain your answer.
4. Design a Hamiltonian graph indicating all possible routes from house to school and discuss each route. The edges may be the corresponding fare when the route is traversed
via the cheapest mode of transportation.
5. Draw the following:
a) A connected graph with six vertices that has no Euler circuits and no Hamiltonian circuits.
b) A graph with six vertices that has Hamiltonian circuit but no Euler circuits.
c) A graph with five vertices that has an Euler circuit but no Hamiltonian circuits.
6. Route Planning
a) Form a team of five classmates and, using a map, identify a driving route that will visit each of the homes of the five classmates and return to the starting home and that
you believe would be the shortest total driving distance.
b) Determine the driving distances between the homes of the classmates. Represent these distances in a weighted graph, and then use the edge-picking algorithm to determine
a driving route that will visit each home and return to the starting home. Does the algorithm find a more efficient route than your first route?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
13
Module 6: The Mathematics of Graphs

7. Travel. A map of Negros Island is shown below.

a) Draw a graph in which the vertices represent the towns or cities in Negros Island
and two vertices are joined by an edge if the corresponding towns or cities share a
common border.
b) Two friends are planning a driving tour in Negros Island. They would like to drive
across every border on the island. Is it possible to plan such a route that never
crosses the same border twice? What would the route correspond to on the graph?
c) Find a route the friends can follow that will start and end in Murcia and that crosses
every border while re-crossing the fewest borders possible. Hint: On the graph, add
multiple edges corresponding to border crossings that allow an Euler circuit.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
14
Module 6: The Mathematics of Graphs

Evaluate: Gauge Your Learning!

Solve the following problems. Show complete solution.


In Exercises 1 – 4, determine (a) the number of edges in the graph, (b) the number of vertices in the graph, (c) the number of vertices that are of odd degree, (d) whether the graph
is connected, and (e) whether the graph is a complete graph.

1. 2. 3. 4.

a. a. a. a.
b. b. b. b.

c. c. c. c.
d. d. d. d.

In Exercises 5 to 7, determine whether the two graphs are equivalent.


5. 6. 7.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
15
Module 6: The Mathematics of Graphs

In Exercises 8 to 11, (a) determine whether the graph is Eulerian. If it is, find an Euler circuit. If it is not, explain why. (b) If the graph does not have Euler circuit, does it have
an Euler path? If so, find one. If not, explain why.

8. 9. 10. 11.

12. Pen-Tracing Puzzles: Can you draw the diagram at the left without lifting your pencil from the paper and without tracing over the same segment twice? If yes, show using
paper and pencil, if not, explain why.

13. Social Network. A group of friends is represented by the graph at the left. An edge connecting two names means that the friends have spoken to each other in the last week.
a. Have John and Stacy talked to each other in the last week?
b. How many of the friends in this group has Steve talked to in the last week?
c. Among this group of friends, who has talked to the most people in the last week?
d. Why would it not make sense for this graph to contain a loop?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
16
Module 6: The Mathematics of Graphs

14. The subway map at the left shows the tracks that subway trains traverse as well as the junctions where one can switch trains. Suppose an inspector needs to travel the full
length of each track. Is it possible to plan a journey that traverses the tracks and returns to the starting point without traveling through any portion of a track more than once?

15. The floor plan of an art gallery is pictured below. Draw a graph that represents the floor plan, where vertices correspond to rooms and edges correspond to doorways. Is it
possible to take a stroll that passes through every doorway without going through the same doorway twice? If so, does it matter whether we return to the starting point?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
17
Module 6: The Mathematics of Graphs

In Exercises 16 to 18, use Dirac’s theorem to verify that the graph is Hamiltonian. Then find a Hamiltonian circuit.
16. 17. 18.

19. Businesses often network their various computers. One option is to run cables from a central hub to each computer individually; another is to connect one computer to the next,
and that one to the next, and so on until you return to the first computer. Thus, the computers are all connected in a large loop. Suppose a company wishes to use the latter method
and the lengths of cable (in feet) required between computers are given in the table below. Use the edge-picking algorithm to determine how the computers should be networked if
the business wishes to use the smallest amount of cable possible.

20. Scheduling. A research company has a large supercomputer that is used by different teams for a variety of computational task. In between each task, the software must be
reconfigured. The time required depends on which tasks follow which, because some settings are shared by different tasks. The times (in minutes) required to reconfigure the
machine from one task to another are given in the table below. Use the greedy algorithm and the edge-picking algorithm to find time-efficient sequences in which to assign the
tasks to the computer. The software configuration must start and end in the home state.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
18
Module 6: The Mathematics of Graphs

21. A large law firm has offices in seven major cities. The firm has overnight document deliveries schedule every day between certain offices. In the graph below, an edge between
vertices indicates that there is delivery service between the corresponding offices. Use Dirac’s theorem to answer the following questions: Using the law firm’s existing
delivery service, is it possible to route a document to all the offices and return the document to its originating office without sending it through the same office twice?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
19
Module 6: The Mathematics of Graphs

Lesson 3: Euler’s formula

Engage: Let’s Try This!


A puzzle that was posed some time ago goes something like this: Three utility companies each need to run pipes to three houses. Can they do so without crossing over each
other’s pipes at any point? The puzzle is illustrated in the figure below. Try to draw pipes connecting each utility company to each house without letting any pipes cross over each
other.

Explore: Discover This!


Watch the following video clip, “How To Solve A Crime With Graph Theory” (https://www.youtube.com/watch?v=TwHy2DuWB3k), and answer the following
questions.

1. What are the three things that I significantly learned from the video clip?
2. What are the three things that is still unclear to me?
3. Complete the statement: I used to think that …
4. What are the three questions that I want to ask about the video clips?

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
20
Module 6: The Mathematics of Graphs

Explain: Clarify Your Lesson!

Planar Graph. A planar graph is a graph that can be drawn so that no edges intersect each other (except at vertices). If the graph is drawn in such a way that no edges cross,
we say that we have a planar drawing of the graph.

Analysis: Is this a planar drawing of a graph? Is the graph planar?

Example 1: Show that the following graph below is planar.


a) Solution:

b) Solution: First redraw the highlighted edge as shown.

Now redraw the two vertices and the edges that meet there, as shown below.

The result is a graph with no intersecting edges. Therefore, the graph is planar.
Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
21
Module 6: The Mathematics of Graphs
Theorem 4: Subgraph Theorem: If a graph G has a subgraph that is not planar, then G is also not planar. In particular, if G contains the Utilities Graph or 𝐾5 , as a subgraph, G is
not planar.
Example 2: Show that the following graph is not planar.

a) Solution: In the figure below, we have highlighted edges connecting the top six vertices. If we consider the highlighted edges and attached vertices
as a subgraph, we can verify that the subgraph is the Utilities Graph.

b) Solution: The highlighted edges in the graph, considered as a subgraph, form the graph K 5 .

We can expand this strategy by considering contractions of a subgraph. A contraction of a graph is formed by “shrinking” an edge until the two vertices it connects come
together and blend into one. If, in the process, the graph is left with any multiple edges, we merge them into one. The process is illustrated below.

Theorem 5: Nonplanar Graph Theorem. A graph is nonplanar if and only if has the Utilities Graph or 𝐾5 as a subgraph, or it has a subgraph that can be contracted to the Utilities
Graph or 𝐾5 .

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
22
Module 6: The Mathematics of Graphs
Example 3: Show that the graph below is not planar.

a) Solution: a) Note that the graph looks similar to K 5 . In fact, we can contract some edges and make the graph look like K 5 . Choose a pair of adjacent
outside edges and contract one of them.

b)
Solution: b) The graph looks similar to the Utilities Graph. Contract edges as shown below, and combine the resulting multiple edges. If we do the same on the
right side of the graph, we are left with the Utilities Graph.

Euler’s Formula
Euler noticed a connection between various features of planar graphs. In addition to edges and vertices, he looked at faces of a graph. In a planar drawing of graph, the edges
divide the graph into different regions called faces. The region surrounding the graph, or the exterior, is also considered a face, called infinite face. The following relationship is
always true.

Euler’s Formula. In a connected planar graph drawn with no intersecting edges, let v be the number of vertices, e the number of edges, and f the number of faces. Then, 𝑣 + 𝑓 =
𝑒 + 2.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
23
Module 6: The Mathematics of Graphs
Example 4: Count the number of edges, vertices, and faces in the planar graph below, and then verify the following using Euler’s formula.

a) b)

Dual Graph: Every planar graph has what is called a dual graph. To form the dual graph, start with a planar drawing of the graph. With a different-color pen, draw a dot in each face
(including the infinite face). These will be the vertices of the dual graph. Now, for every edge in the original graph, draw a new edge that crosses over it and connects the two new
vertices in the faces on each side of the original edge. The resulting dual graph is always itself a planar graph. (Note that it may contain multiple edges.) The procedure is illustrated
below.

a) Draw the dual graph of each of the planar graphs below

b) For each of the graphs in part a, count the number of faces, edges, and vertices in the original graph and compare your results with the numbers in the dual graph. What do
you notice? Explain why this will always be true.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
24
Module 6: The Mathematics of Graphs
Lesson 4: Graph coloring

Coloring Maps
Suppose the map in Figure 1 shows the countries, labeled as letters, of a continent. We will assume that no country is split into more than one piece and countries that touch
at just a corner point will not be considered neighbors. We can represent a country by a vertex, placed anywhere within the boundary of that country. We will then connect two
vertices with an edge if the two corresponding countries are neighbors – that is, if they share a common boundary. The result is shown in Figure 2.

If we erase the boundaries of the countries, we are left with the graph in Figure 3. The resulting graph will always be a planar graph, because the edges simply connect
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 3 is actually
3-colorable; only three colors are necessary. One possible coloring is given in Figure 4. A colored map for Figure 3 based on the colors of the vertices of the graph is in Figure 5.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
25
Module 6: The Mathematics of Graphs
Theorem 6: Four-Color Theorem. Every planar graph is 4-colorable.

ANALYSIS: The Figure 6 shown below requires five colors if we wish to color it such that no edge joins two vertices of the same color. Does this contradict the four-color theorem?

Figure 6

Example 5:The fictional map Figure 7 shows the boundaries of countries on a rectangular continent. Represent the map as a graph, and find a coloring of the graph using the
fewest possible number of colors. Then color the map according to the graph coloring.

Solution: Figure 7

First draw a vertex in each country and then connect two vertices with an edge if the corresponding countries are neighbors. 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 simple 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 option. 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 figure connects
to a ring of five vertices. Three different colors are required to color the five-vertex ring, and the green vertex connects to all these; so it requires a fourth color.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
26
Module 6: The Mathematics of Graphs
Now we color each country the same color as the corresponding vertex.

The Chromatic Number of Graph


The four-color theorem guarantees that we need only four colors to color a planar graph; however, if we wish to color a nonplanar graph, we may need more than four colors.
The minimum number of colors needed to color a graph so that no edge connects vertices of the same color is called the chromatic number of the graph.

Figure 8
Theorem 7: 2-Colorable Graph Theorem. A graph is 2-colorable if and only if it has no circuits that consist of an odd number of vertices.
Example 6: Find the chromatic number of Utilities Graph.
Solution:

Note the graph contains circuits such as A-Y-C-Z-B-X-A with six vertices and A-Y-B-X-A with four vertices. It seems that any circuit we find,
in fact, involves an even number of vertices. It is difficult to determine whether we have looked at all possible circuits, but our observations suggest
that the graph may be 2-colorable. A little trial and error confirms this if we simply color vertices A, B, and C one color and the remaining vertices
another.
Figure 9

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
27
Module 6: The Mathematics of Graphs
Modeling Traffic Lights with Graphs
We can design a traffic-light cycle by modeling an intersection with a graph. Figure 9 shows a three-way intersection where
two two-way roads meet. Each direction of traffic has turn lanes, with left-turn lights where possible. There are six different directions
in which vehicles can travel, as indicated in the figure, and we have labeled each possibility with a letter.

We can represent the traffic patterns with a graph; each vertex will represent one of the six possible traffic paths, and we will
draw an edge between two vertices if the corresponding paths would allow vehicles to collide. The result is the graph shown in Figure
10 because we do not want to allow vehicles to travel simultaneously along routes on which they could collide, any vertices connected
by an edge can allow traffic to move only during different parts of the light cycle. We can represent each portion of the cycle by a
color. Our job then is to color the graph using the fewest possible colors.
Figure 9

There is no 2-coloring of the graph because we have a circuit of length A–D–E–A. We can, however, find a 3-coloring. One possibility is given in Figure 11.

Figure 10 Figure 11
A 3-coloring of the graph means that the traffic lights at the intersection will have to go through a three-stage cycle. One stage will allow the traffic routes corresponding to
the red vertices to proceed, the next stage will let the paths corresponding to the blue vertices to proceed, and finally, the third stage will let path E, colored green, proceed.
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 conflict with route E. We could also allow path F to proceed at the same time. Adding these additional paths corresponds to adding colors to the graph in Figure 11. 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

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
28
Module 6: The Mathematics of Graphs
color. The result is shown in Figure 12. 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.
In summary, our design allows traffic 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 third
stage.

Figure 12

Example 7: A one-way road ends at a two-way street. The intersection and the different possible traffic routes are shown in the figure below. The one-way road has a left-turn light.
Represent the traffic routes with a graph and use graph coloring to determine the minimum number of stages required for a light cycle.

Solution: We can represent the traffic patterns with a graph; each vertex will represent one of the four possible traffic paths, and we will draw an edge between two vertices
if the corresponding paths would allow vehicles to collide. Because we do not want to allow vehicles to travel simultaneously along routes on which they could collide, any vertices
Carlos Hilado Memorial State College Module GECMAT
College of Arts and Sciences, Mathematics Department Revision 01
29
Module 6: The Mathematics of Graphs
connected by an edge can allow traffic to move only during different parts of the light cycle. We can represent each portion of the cycle by a color. Our job then is to color the graph
using the fewest possible colors. There is no 2-coloring of the graph. A 2-coloring of the graph means that the traffic lights at the intersection will have to go through a two-stage
cycle. In summary, our design allows traffic paths A and D to proceed during one stage of the cycle, paths B and C during the second stage.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
30
Module 6: The Mathematics of Graphs
Elaborate: Challenge Yourself!

A. Determine the following:


1. If a planar drawing of a graph has 15 edges and 8 vertices, how many faces does the graph have?
2. If a planar drawing of a graph has 100 vertices and 50 faces, how many edges are in the graph?
3. In a planar drawing of a graph, each face is bounded by a circuit. Make a planar drawing of a graph that is equivalent to the graph shown, in
which faces are bordered by the same circuits as the given graph but where the face bordered by A – B – C – G – F – A is in the infinite face.

B. Edge Coloring
In this section, we colored vertices of graphs so that no edge connected two vertices of the same color. We can also consider coloring edges, rather than vertices, so
that no vertex connects two or more edges of the same color. In parts a to d, assign each edge in the graph a color so that no vertex connects two or more edges of the same
color. Use the fewest number of colors possible.

C. Suppose five players are competing in a tennis tournament. Each player needs to play every other player in a match (but not more than once). Each player will participate in no
more than one match per day, and two matches can occur at the same time when possible. How many days will be required for the tournament? Represent the tournament as a
graph, in which each vertex corresponds to a player and an edge joins two vertices if the corresponding players will compete against each other in a match. Next, color the
edges, where each different color corresponds to a different day of the tournament. Because one player will not be in more than one match per day, no two edges of the same
color can meet at the same vertex. If we can find an edge coloring of the graph that uses the fewest number of colors possible, it will correspond to the fewest number of days
required for the tournament. Sketch a graph that represents the tournament, find an edge coloring using the fewest number of colors possible, and use your graph to design a
schedule of matches for the tournament that minimizes the number of days required.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
31
Module 6: The Mathematics of Graphs
Evaluate: Gauge Your Learning!

Exercises 1 to 5, show that the graph is planar by finding a planar drawing.

1. 2. 3.

4 5.

Exercises 6 to 9, show that the graph is not planar.


6. 7. 8. 9.

10. Show that the following graph contracts to 𝐾5 . 11. Show that the following graph contracts to the utilities Graph.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
32
Module 6: The Mathematics of Graphs
Exercises 12 and 13, show that the graph is not planar by finding a subgraph whose contraction is the Utilities Graph or 𝐾5 .

12. 13.

Exercises 14 to 19, count the number of vertices, edges, and faces, and then verify Euler’s formula for the given graph.

14. 15. 16. 17. 18. 19.

20. 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.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01
33
Module 6: The Mathematics of Graphs
21. Six friends are taking a film history course and, because they have procrastinated, need to view several films the night before the final exam. They have rented a copy for each
film on DVD, and they have a total of three DVD players in different dorm rooms. If each film is two hours long and they start watching at 8:00 P.M., how soon can they all be
finished watching the required films? Create a viewing schedule for the friends.
Film A needs to be viewed by Brian, Chris, and Damon.
Film B needs to be viewed by Allison and Fernando.
Film C needs to be viewed by Damon, Erin, and Fernando.
Film D needs to be viewed by Brian and Erin.
Film E needs to be viewed by Brian, Chris, and Erin.
22. 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 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?

23. A one-way road intersects a two-way road in a four-way intersection. Each direction has turn lanes and left-turn lights. Represent the various traffic routes with a graph and use
graph coloring to determine the minimum number of stages required for a light cycle. Then refine your design to allow as much traffic as possible to proceed at each stage of the
cycle.

Carlos Hilado Memorial State College Module GECMAT


College of Arts and Sciences, Mathematics Department Revision 01

You might also like