You are on page 1of 15

Chapter 6

A Glimpse of Graph Theory

Objectives
(i) Define and understand some basic concepts of graphs.
(ii) Define an Eulerian circuit and Eulerian graph.
(iii) Identify an Eulerian graph and determine its Eulerian circuit.
(iv) Define Hamiltonian circuit and Hamiltonian graph.
(v) Identify an Hamiltonian graph and determine its Hamiltonian circuit.
(v) Apply Dirac’s Theorem
(vi) Apply the concept of graph coloring in a given situational problems.

6.1 Introduction to Graph


6.1.1 Basic Concept
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 highways. A branch of mathematics called Graph
Theory illustrates and analyzes connections such as these.

For example, the diagram below 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.

John

Paul Matthew

Ezekiel

This type if diagram is called graph.

Definition 6.1.1.1. A graph is a set of points called vertices and line


segments or curves called edges that connect vertices.

1
Mathematics in the Modern World

Example 6.1.1.2. The following table lists five students at Central


Mindanao University. An X indicates that two students participate in the
same research group this semester.

CMU STUDENTS
NAMES Justine Darwin Darlene Develin Leocint
Justine - X X X X
Darwin X -
Darlene X - X X
Develin X X -
Leocint X X X -

a. Draw a graph that represents the above information where each vertex
represents the students and an edge connects two vertices if the
corresponding students do research together.
b. Use your graph to answer the following questions: Which student
involved in most of the research groups with others? Which student has
only one study group? How many study groups does Leocint have in
common with the others?
Solution: For a. we have the following graph below:
Justine

Leocint

Darwin

Develin

Darlyn

Figure 6.1: Graph representation of the table CMU Students

For b. The vertex corresponding to Justine is connected to more edges than


the others, so he is involved with more research groups than the others.
Darwin is the only student with one research group in common, as his
vertex is the only one connected to just one edge. Leocint’s vertex is
connected to three edges, so he shares two research groups with the others.

Definition 6.1.1.3. If two or more edges connect the same vertices, they are
called multiple edges. If an edge begins and ends at the same vertex, such
edge is called loop. A graph which contains multiple edges, loops, or both
multiple edges and loops, it is called a multigraph.
Example 6.1.1.4. Below are some examples of a multigraph.

CMU Mathematics Department 2


Mathematics in the Modern World

Figure 6.2: Multigraphs

6.1.2 Eulerian Graphs and Circuits


Before we proceed with Eulerian graphs and circuits. Let us first define some
terms.
Definition 6.1.2.1. A graph is called connected if any vertex can be
reached from any other vertex by tracing along edges.
Example 6.1.2.2. Given the following graphs below:

Figure 6.3: Disconnected and Connected Graphs

The graph (on the left) in Figure 6.3 is a disconnected graph while the
graph (on the right) is a connected graph.

Definition 6.1.2.3. A path in a graph can be thought of as a movement


from one vertex to another by traversing edges. If a path ends at the same
vertex at which it started, then it is a circuit
Example 6.1.2.4. Consider the graph below:
A B C

D E

F G H

Figure 6.4: Graph with 6 vertices

The sequence of vertices A-B-C along with the edges connecting them is a
path. The path A-D-F-G-E-B-A is a circuit since it begins and ends at the

CMU Mathematics Department 3


Mathematics in the Modern World

same vertex.

Definition 6.1.2.5. A circuit that uses every edge in a connected graph, but
never uses the same edge twice, is called an Eulerian circuit. A connected
graph containing an Eulerian circuit is an Eulerian graph.
Note: The definition of an Eulerian circuit implies that we can actually
repeat vertices as long as each edge in the path is distinct. Eulerian circuit
is not unique.
Example 6.1.2.6. The path B-D-F-G-H-E-C-B-A-D-G-E-B in Figure 6.4 is
an Eulerian circuit.

Definition 6.1.2.7. The number of edges that meet at a vertex is called the
degree of a vertex, denoted by deg(v).
Example 6.1.2.8. The following are the degree of each vertices in the graph
shown in Figure 6.4:

deg(A) = 2 deg(C) = 2 deg(E) = 4 deg(G) = 4


deg(B) = 4 deg(D) = 4 deg(F ) = 2 deg(H) = 2

Theorem 6.1.2.9 (Euler’s Graph Theorem). A connected graph is Eulerian


if and only if every vertex of the graph is of even degree.
Example 6.1.2.10. Does the graph shown below an Eulerian graph?
A B C D

E F G

Figure 6.5: Graph with 7 vertices

Solution: The graph in Figure 6.5 is not an Eulerian graph since the vertices
B,C,E,F,G each have a degree 3. Consequently, the graph do not have an
Eulerian circuit.
Example 6.1.2.11 (Application of Eulerian Circuits). The subway map
below 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
protion of a track more than once?

CMU Mathematics Department 4


Mathematics in the Modern World

Solution: We will first represent the above image into a graph, specifically,
a multigraph and denote the following vertices: Northpark (NP), Riverdate
(R), Park Center (PC), Museums (M), Civic Center (CC), Train Station (TS),
Shopping Town (ST), Lakeside (L), South End (SE), Main Plaza (MP).

NP

TS
PC R

ST M

CC MP

SE

In order to find a travel route that does not traverse the same track twice,
we need to find an Euler circuit in the graph. However, the vertex
representing the Civic Center (CC) has degree 3. By Euler’s Graph
Theorem, the graph cannot be Eulerian, hence, no Eulerian circuit can be
found. Thus, it is impossible for the inspector not to travel at least one
track twice.

6.2 Weighted Graphs


6.2.1 Hamiltonian Circuits
In this section we looked onto paths that visit each vertex once, regarldess of
whether all edge are used or not. We consider the following diagram:

CMU Mathematics Department 5


Mathematics in the Modern World

If someones priority is to visit each city, he/she can travel along the route
Alameda-Burley-Caldwell-Dover-Evanston-Fairmont-Grangeville-Alameda.
This path visits each vertex once and returns to the starting vertex without
visiting any vertex twice. This type of path is called a Hamiltonian circuit.

Definition 6.2.1.1. A Hamiltonian circuit is a path that begins and ends


at the same vertex and passes through each vertex of a graph exactly once.
a graph that contains a Hamiltonian circuit is called Hamiltonian graphs.
Unlike Eulerian graph, we do not have a straight forward criterion to
guarantee that a graph is a Hamiltonian graph, however, we do have the
following theorem to help us.
Theorem 6.2.1.2 (Dirac’s Theorem). Consider a connected graph with at
least three vertices and no multiple edges. Let n be the number of vertices in
n
the graph. If every vertex has degree of at least , then the graph must be
2
Hamiltonian graph.
Note: If the graph does not meet the requirements of Dirac’s Theorem, it
still might be a Hamiltonian graph.
Example 6.2.1.3. A large law firm has offices in seven major cities. The
firm has overnight document deliveries scheduled everyday 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 question:
Using the law firms 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?
n 7
Solution: The graph has 7 vertices, so n = 7 and = = 3.5. Several
n 2 2
vetices are of degree less than , so Dirac’s Theorem does not apply. Still, a
2
routing for the document may be possible. One such route is Los
Angeles-New York-Boston-Atlanta-Dallas-Pheonix-San Francisco-Los
Angeles.

CMU Mathematics Department 6


Mathematics in the Modern World

San Francisco New York

Los Angeles Dallas Boston

Phoenix Atlanta

Figure 6.6:

6.2.2 Weighted Graphs


A Hamiltonian circuit can identify a route that visits all of the cities
represented on a graph. If we are concerned with the distances we must
ravel between cities, chances are that some of the routes will involve a
longer total distance than others. We are interested in finding the route
that minimizes the total number of miles traveled. We can represent such
situation with a weighted graph.

Definition 6.2.2.1. A weighted graph is a graph in which each edges is


associated with a value, called a weight.

In case of distances between cities, we can label each edge with number of
miles between the corresponding cities, illustrated below:

Cagayan De Oro
99 km

Malaybalay

114 km 44 km

Valencia

93 km
Wao 147 km

132 km Davao
115 km

Kidapawan

Figure 6.7:

Note: The length of an edge does not necessarily correlate to its weight.

For each Hamiltonian circuit in the weighted graph, the sum of the weights
along the edges traversed gives the total distance traveled along that route.

CMU Mathematics Department 7


Mathematics in the Modern World

We can compare different routes and find the one that requires the shortest
total distance.
Example 6.2.2.2. A tourist visiting San Francisco is staying at a hotel
near Moscone Center. The tourist would like to visit five locations by bus
tomorrow and then return to the hotel. The number of minutes spent
traveling by bus between locations is given in the table below. Find two
different routes for the tourist to follow and compare the total travel times.

The Tourist
Moscone Civic Union Embark Farmers Coit
Center Center Square Plaza Wharf Tower
Moscone - 18 6 22 N/A N/A
Center
Civic 18 - 14 N/A 33 N/A
Center
Union 6 14 - 24 28 26
Square
Embark 22 N/A 24 - N/A 18
Plaza
Farmers N/A 33 28 N/A - 14
Wharf
Coit N/A N/A 36 18 14 -
Tower

Solution: We draw a graph in which the vertices represent locations and the
edges indicate available bus routes between locations. Each edge is given a
weight corresponding to the number of minutes for the bus ride.
Civic Center

18 14

6
Moscone Center Union Sqare

33
22

24

36

18
Coit Tower Embark Plaza
14 28

Farmers Wharf

Figure 6.8: The tourist graph representation

CMU Mathematics Department 8


Mathematics in the Modern World

A route that visits each location and returns to the Moscone Center
corresponds to a Hamiltonian circuit. Using the graph in Figure 6.8, we find
that one of the route is
Moscone Center - Civic Center - Union Square - Farmers Wharf - Coit
Tower - Embark Plaza - Moscone Tower,
with a total weight of 18 + 14 + 28 + 14 + 18 + 22 = 114. Another route is
Moscone Center - Union Square - Embark Plaza - Coit Tower - Farmers
Wharf - Civic Center - Moscone Tower,
with a total weight of 6 + 24 + 18 + 14 + 33 + 18 = 113. The travel time is
one minute less for the second route.

6.3 Chromatic of Graphs


In this section we will be devoted to perhaps the best known and most studied
area of graph theory: Graph Colorings. In 1993 Noga Alon of Tel Aviv
University in Israel, well known for his work in combinatorial and theoretical
computer science, wrote:
“Graph coloring is arguably the most popular subject in graph theory”
Graph colorings has become a subject of great interest, largely because of
its intriguing history, its diverse theoretical results, its unsolved problems
(millennial problems) and its massive applications.

6.3.1 Coloring Maps


Given a map, in Figure 6.9, showing 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 a just a corner point will not be considered
neighbors. We can represent each 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
common boundary. If we erase the boundaries, the result is shown in Figure
6.9.

CMU Mathematics Department 9


Mathematics in the Modern World

D
C

G F

Figure 6.9: A certain map and its graph representation

Now 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 with using four colors, for instance,
we will say that he graph is 4-colorable. The graph in Figure 6.9 is a
3-colorable,i.e., only three colors are necessary,with its corresponding map
coloring, which is show below:

D
C

G F

Example 6.3.1.1. Represent the fictional map of countries below as a


graph, and then determine whether the graph is 2-colorable, 3-colorable, or
4-colorable by finding a suitable coloring of the graph. Then color the map
according to the graph coloring.

Solution: We first label our country by letters given below. Then, we draw

CMU Mathematics Department 10


Mathematics in the Modern World

a vertex in each letters and then connect two vertices with an edge if the
corresponding countries are neighbors.

D
I
A
H
E J

F
G

Now try to color the vertices of the resulting graph so that no edge connects
two vertices of the same color. Obviously we need at least two colors, so one
way is to simply pick a starting vertex, give it a color, and then assign colors
to the connected vertices one by one. Reuse the same colors, and use a new
color only when there is no other option. Below is one such coloring that can
be made on the graph and its corresponding map.

D
I
A
H
E J

F
G

6.3.2 Chromatic Number of Graph


Definition 6.3.2.1. 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 a graph.
In the previous examples, the graph in Figure 6.9 and the graph yield in
Example 6.3.1.1, both graphs are 4-colorable and 3-colorable, respectively.
This implies that the chromatic number of both graphs is 4 and 3,
respectively. Thus, k-colorable refers to the minimum number, k, of colors
in a graph.

In general, there is no efficient method of finding the chromatic number of a


graph, but we have a theorem that can tell us whether a graph is
2-colorable.

CMU Mathematics Department 11


Mathematics in the Modern World

Theorem 6.3.2.2 (2-Colorable Theorem). A graph is 2-colorable if and only


if it has no circuits that consist of an odd number of vertices.
Example 6.3.2.3. Determine whether the following graph is 2-colorable.

Solution: There are 2 ways in the graph at which three edges form a triangle,
one of it is the following;

Since a triangle is a circuit with an odd number of vertices, the graph is not
2-colorable. Rather, the graph is 3-colorable, as shown below:

6.3.3 Applications of Graph Coloring


Determining the chromatic number of a graph and finding a corresponding
coloring of the graph can solve a wide assortment of practical problems. One
common application is in scheduling meetings or events.
Example 6.3.3.1. Six film students have collaborated on the creation of five
films.
Film A was produced by Bryan, Klarice, and Dannifer
Film B was produced by Kristel and John Dexter

CMU Mathematics Department 12


Mathematics in the Modern World

Film C was produced by Dannifer, Erin, and John Dexter


Film D was produced by Bryan and Erin
Film E was produced by Bryan, Klarice, and Erin
The college is scheduling a one-day festival where each film will be shown
once and the producers of each film will attend and participate in a discussion
afterward. The college has several screening rooms available and two hours
will be allotted for each film. If the showings begin at noon, create a screening
schedule that allows the festival to end as early as possible while assuring that
all of the producers each film can attend that films screening.
Solution: To solve this problem, we will draw a graph in which each vertex
corresponds to a film and an edge joins two vertices if one person needs to
attend both of the corresponding films. We can use colors to represent the
different times at which the films can be viewed. No two vertices connected
by an edge can share the same color, since that would mean one person would
have to attend two films at the same time. Below is one of the possible graph
coloring;
Film B

Film A Film C

Film E Film D

This means that four different time slots will be required to show the fims,
and the earliest that the festival can end is 8:00 PM. A schedule can be set
using he coloring in the graph. From 12 to 2, the films labeled blue, Film A
and Film B, can be shown in two different rooms. The remaining films are
represented by unique colors and so will require their own viewing times.
Film C can be shown from 2 to 4, Film D from 4 to 6, and E from 6 to 8.

CMU Mathematics Department 13


Mathematics in the Modern World

6.4 Practice Exercise


Practice Exercise 6.4.0.1. The table below lists of five mobile phone
companies and indicates whether they have agreements to roam onto each
others networks. Draw a graph that represents this information, where each
vertex represents a phone company and an edge connects two vertices if the
corresponding companies have a roaming agreement. Then use the graph to
answer the following questions:
a. Which phone company has a roaming agreements with the most carriers?
b. Which company roam with only one other network?
Phone Company
Apple Huawei Vivo Oppo Samsung
Apple - No Yes No Yes
Huawei No - Yes No No
Vivo Yes Yes - Yes X
Oppo No No Yes - Yes
Samsung Yes No No Yes -

Practice Exercise 6.4.0.2. Suppose we have the given arrangement of


islands and bridges below. Would the citizen be able to complete a stroll
across each bridge ad return to their starting point without crossing the
same bridge twice?

Practice Exercise 6.4.0.3. Use Dirac’s Theorem to verify that the graph
is Hamiltonian. Then find a Hamiltonian Circuit.

CMU Mathematics Department 14


Mathematics in the Modern World

Practice Exercise 6.4.0.4. Represent the map of countries below as a


graph, and determine whether the graph is 2-colorable, 3-colorable, or
4-colorable by finding a suitable coloring of the graph. Then color the map
according to the graph coloring.

CMU Mathematics Department 15

You might also like