Jonecis A.
Dayap, LPT, MS Introduction to Graph Theory
Introduction to Graph Theory
Jonecis A. Dayap
Department of Mathematics and Sciences
College of Arts and Sciences
University of San Jose - Recoletos
Cebu City, Philippines
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Learning Outcomes:
1 demonstrate understanding towards the basic concepts of
graph theory;
2 construct graphs with real-life connections;
3 apply the concepts of graph theory in solving practical
problems;
4 internalize the application of graph theory by constructing
real-life based graphs as a tool in making decisions.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Outline
I Terminologies
II Euler Circuit and Euler Path
III Hamiltonian Circuit and Weighted Graph
IV Planarity and Graph Coloring
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Konigsberg Bridge Problem
The city of Konigsberg was located on the Pregel river in Prussia.
The river divided the city into four separate landmasses, including
the island of Kneiphoff. These four regions were linked by seven
bridges as shown in the diagram below.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Konigsberg Bridge Problem
The city of Konigsberg was located on the Pregel river in Prussia.
The river divided the city into four separate landmasses, including
the island of Kneiphoff. These four regions were linked by seven
bridges as shown in the diagram below.
Problem: Starting at one land area, is it possible to walk across
all of the bridges exactly once and return to the starting land area?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Konigsberg Bridge Problem
In 1736, Euler represented the Konigsberg Bridge Problem as a
graph, as shown in the figure below
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Konigsberg Bridge Problem
In 1736, Euler represented the Konigsberg Bridge Problem as a
graph, as shown in the figure below
and answered the question in negative.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Graph
Graph : a set of points called vertices and line segments or
curves called edges that connect vertices.
: a collection of objects that show
interconnectedness.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Graph
Graph : a set of points called vertices and line segments or
curves called edges that connect vertices.
: a collection of objects that show
interconnectedness.
Examples:
1 Network of roads that connects towns and cities.
2 Network of flights that connects airports from around the
world.
3 The listing of matches in a basketball tournament.
4 The itinerary of a salesman who must visit different cities.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Example: Interpreting a Graph
A network of friends is represented by a graph below. An edge that
connects two persons means that the two have spoken to each
other for the past three days.
1 How many friends has Wilfred talked to for past three days?
2 Which pair of friends has not talked to each other for the past
three days?
3 Among this network of friends, who has talked to the most
people in the last three days?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Example: Constructing a Graph
The table below lists five members of a triathlon club. An X
indicates that the two triathletes have gone out for a long ride
together for the past three weeks.
1 Construct a graph representing this table. Each vertex
represents a triathlete, and an edge connecting two vertices
means the triathletes represented by vertices have gone out
for a long ride for the past three weeks.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Example: Constructing a Graph
The table below lists five members of a triathlon club. An X
indicates that the two triathletes have gone out for a long ride
together for the past three weeks.
1 Construct a graph representing this table. Each vertex
represents a triathlete, and an edge connecting two vertices
means the triathletes represented by vertices have gone out
for a long ride for the past three weeks.
2 Which triathlete has gone out most frequently in a long ride
with different triathletes?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Example: Constructing a Graph
The table below lists five members of a triathlon club. An X
indicates that the two triathletes have gone out for a long ride
together for the past three weeks.
1 Construct a graph representing this table. Each vertex
represents a triathlete, and an edge connecting two vertices
means the triathletes represented by vertices have gone out
for a long ride for the past three weeks.
2 Which triathlete has gone out most frequently in a long ride
with different triathletes?
3 Which triathlete has only one biking buddy?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Equivalent Graphs
Determine whether the following two graphs are equivalent.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Equivalent Graphs
Determine whether the following two graphs are equivalent.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Cut edge is an edge whose removal disconnects a component
of the graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Cut edge is an edge whose removal disconnects a component
of the graph.
Example
Identify the cut edges in the graph below.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Cut edge is an edge whose removal disconnects a component
of the graph.
Example
Identify the cut edges in the graph below.
Solution: CE and GH are cut edges, if either is removed, it would
disconnect the graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Terminologies
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Problem Set 1.1
An X in the table below indicates a direct train route between the
corresponding cities.
1 Draw a graph that represents this information, in which each
vertex represents a city and an edge connects two vertices if
there is a train route between the corresponding cities.
2 In the constructed graph, determine the:
(a) Degree of each vertex
(b) Cut edge(s)
3 Is the constructed graph:
(a) connected?
(b) simple?
(c) complete?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Eulerian Graph Theorem
A connected graph is a Eulerian, if and only if, every vertex of the
graph has a degree that is an even number.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Eulerian Graph Theorem
A connected graph is a Eulerian, if and only if, every vertex of the
graph has a degree that is an even number.
Consider the graph below:
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Example
Evaluate whether the graphs below has an Euler circuit.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Example
Evaluate whether the graphs below has an Euler circuit.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Fleury’s algorithm can be used to find an Euler circuit in any
connected graph in which each vertex has even
degree.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Fleury’s algorithm can be used to find an Euler circuit in any
connected graph in which each vertex has even
degree.
Steps:
Step 1 Start at any vertex. Go along any edge from this vertex to
another vertex. Remove this edge from the graph.
Step 2 You are now on a vertex on the revised graph. Choose any
edge from this vertex, but not a cut edge, unless you have no
other option. Go along your chosen edge. Remove this edge
from the graph.
Step 3 Repeat Step 2 until you have used all the edges and gotten
back to the vertex at which you started.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Example
Find an Euler circuit for the graph below.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Application of Euler Circuit
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 portion of a
track more than once?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Euler Path : a path that uses every edge of the graph exactly
once.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Euler Path : a path that uses every edge of the graph exactly
once.
Euler Path Theorem
A connected graph contains an Euler path, if and only if, the graph
has two vertices of odd degrees with all vertices of even degrees.
Further, every Euler path must start at one of the vertices of an
odd degree and end at the other odd degree vertex.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Example
Examine the graphs below and determine whether the graphs have
an Euler path. If you have found that the graphs have a Euler
path, identify it. If otherwise, explain your observations.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Euler Circuit and Euler Path
Example
Examine the graphs below and determine whether the graphs have
an Euler path. If you have found that the graphs have a Euler
path, identify it. If otherwise, explain your observations.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Application of Euler Path
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?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Activity 1: Euler Circuit and Euler Path
The floor plan of a sculpture gallery is shown below.
(a) Draw a graph that represents the floor plan, where vertices
correspond to rooms and edges correspond to doorways.
(b) Is it possible to walk through each doorway exactly once?
Defend your answer.
(c) Is it possible to walk through each doorway exactly once and
return to the starting point? Defend your answer.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 1: Euler Circuit and Euler Path
Instruction: In a short size bond paper, construct a real-life based
situation/problem wherein the concepts of Euler Circuit and Euler
Path will be applied. Illustrate how these concepts were used in
the given situation/problem.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 1: Euler Circuit and Euler Path
Instruction: In a short size bond paper, construct a real-life based
situation/problem wherein the concepts of Euler Circuit and Euler
Path will be applied. Illustrate how these concepts were used in
the given situation/problem.
Deadline:
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 1: Euler Circuit and Euler Path
Instruction: In a short size bond paper, construct a real-life based
situation/problem wherein the concepts of Euler Circuit and Euler
Path will be applied. Illustrate how these concepts were used in
the given situation/problem.
Deadline:
Example: Construction of a floorplan of a museum in such a way,
the visitor will able to pass every doorway without going through
the same doorway twice.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
continuation...
The diagram below shows the arrangement of a Habitrail cage for
a pet hamster. (Plastic tubes connect different cages.) Is it
possible for a hamster to travel through every tube without going
through the same tube twice? If so, find a route for the hamster to
follow. Can the hamster return to its starting point without
repeating any tube passages?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 1: Euler Circuit and Euler Path
Format:
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Definition
A circuit that passes through each vertex of a graph exactly
once is called Hamiltonian circuit.
A graph that contains Hamiltonian circuit is called
Hamiltonian.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Definition
A circuit that passes through each vertex of a graph exactly
once is called Hamiltonian circuit.
A graph that contains Hamiltonian circuit is called
Hamiltonian.
Dirac’s Theorem
Consider a connected graph with at least three vertices and no
multiple edges. Let n be the number of vertices in the graph. If
every vertex has degree of at least n2 , then the graph must be
Hamiltonian.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Example
Apply the Dirac’s theorem to determine that a graph below is
Hamiltonian.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Example
Apply the Dirac’s theorem to determine that a graph below is
Hamiltonian.
A path A-B-C-D-G-I-H-F-E-A is an example of Hamiltonian circuit.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Example
Find a Hamiltonian circuit from this graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Hamiltonian Circuit
Example
Find a Hamiltonian circuit from this graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Weighted Graphs
Definition
A weighted graph is a graph in which each edge is
associated with a value, called a weight.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Weighted Graphs
Definition
A weighted graph is a graph in which each edge is
associated with a value, called a weight.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Application of Weighted Graph
Nicole wants to tour Asia. She will start and end her journey in
Tokyo and visit Hong Kong, Bangkok, Seoul, and Beijing. The
airfares available to her between cities are given in the table. Draw
a weighted graph that represents the travel costs between cities.
Find three different routes that Nicole could follow and find the
total airfares flown for each route.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Algorithms in Complete Graphs
Greedy Algorithm
1 Choose a vertex to start at, then travel along the connected
edge that has the smallest weight.
2 After arriving at the next vertex, travel along the edge of
smallest weight that connects to a vertex not yet visited.
3 Continue this process until you have visited all vertices.
4 Return to the starting vertex.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Greedy Algorithm
Example
Use the greedy algorithm to find a Hamiltonian circuit in the given
weighted graph. Start at vertex A.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Greedy Algorithm
Example
Use the greedy algorithm to find a Hamiltonian circuit in the given
weighted graph. Start at vertex A.
Answer: A − D − B − F − E − C − A
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Algorithms in Complete Graphs
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.
3 Continue this process until you can no longer mark any edges.
Then mark the final edge that completes the Hamiltonian
circuit.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Edge-Picking Algorithm
Example
Use the edge-picking algorithm to find a Hamiltonian circuit in the
given weighted graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Edge-Picking Algorithm
Example
Use the edge-picking algorithm to find a Hamiltonian circuit in the
given weighted graph.
Answer:B − D − A − E − C − F − B
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Activity 2
The distances, in miles, between five different cities are given in
the table.
(a) Sketch a weighted graph that represents the distances among
five different cities.
(b) Use the greedy and edge-picking algorithm to design a
route(Hamiltonian Circuit) that starts in Memphis, visits each
city, and returns to Memphis while attempting to minimize the
total distance traveled.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 2
Instructions: In a short size bond paper, construct a real-life
based situation/problem wherein the concepts of Hamiltonian
Circuit and Weighted Graph will be applied. Illustrate how these
concepts were used in the given situation/problem.
Deadline:
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Format: Performance Task 2
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planarity and Graph Coloring
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planarity and Graph Coloring
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?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Definition
A graph is called a planar graph if no edge crosses over each
other (except at vertices).
If the graph is drawn in such a way that no edges intersect,
we have a planar drawing of the graph.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Definition
A graph is called a planar graph if no edge crosses over each
other (except at vertices).
If the graph is drawn in such a way that no edges intersect,
we have a planar drawing of the graph.
Example
Is this a planar drawing of a graph? Is the graph planar?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Show that the graph below is planar.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Show that the graph below is planar.
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 K5 as a
subgraph, G is not planar.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Show that the following graph is not planar.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
In the mid-1800s, Francis Guthrie was trying to color a map of the
counties of England. So that it would be easy to distinguish the
counties, he wanted counties sharing a common border to have
different colors.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
In the mid-1800s, Francis Guthrie was trying to color a map of the
counties of England. So that it would be easy to distinguish the
counties, he wanted counties sharing a common border to have
different colors.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Definition
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.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Planar Graph and Graph Coloring
Definition
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.
Example
Represent the fictional 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.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Application of Graph Coloring
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.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Continuation...
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Activity 4
A researcher has discovered six new species of insects overseas and
needs to transport them home. Some species will harm each other
and so cannot be transported in the same container.
Species A cannot be housed with species C or F.
Species B cannot be housed with species D or F.
Species C cannot be housed with species A, D, or E.
Species D cannot be housed with species B, C, or F.
Species E cannot be housed with species C or F.
Species F cannot be housed with species A, B, D, or E.
1 Draw a graph where each vertex represents a species of insect
and an edge connects two vertices if the species cannot be
housed together.
2 Use graph coloring to determine the minimum number of
containers the researcher will need to transport the insects.
3 Which species should belong with the same container based
on the minimum number of containers?
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Performance Task 3
Instruction: In a short size bond paper, construct a real-life based
situation/problem wherein the concept of planarity and Graph
Coloring will be applied. Illustrate how these concepts were used in
the given situation/problem.
Deadline:
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
Format: Performance Task 3
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory
REFERENCES
Mathematics in the Modern World by Aufman, et al.
Exploring the Basics of Mathematics in the Modern World by
Dayap, et al.
Jonecis A. Dayap, LPT, MS Introduction to Graph Theory