Professional Documents
Culture Documents
1s 2021 GEC 3 Module Special-Topic-Mathematics-of-Graph
1s 2021 GEC 3 Module Special-Topic-Mathematics-of-Graph
Mathematics in the
Modern World
Course
Modules
Introduction
There are many connections we experience in our daily lives. Perhaps the one
that we can relate the most is our Facebook connections. How many friends
do we have? How many mutual friends do we have with another Facebook
user? Still there are many connections we can think of and these are
illustrated and analyzed by a branch of mathematics called GRAPH THEORY.
In this module, you will be oriented to this branch of mathematics. First, you
must know what a graph is. A graph in graph theory is different from graphs
of functions you already learned in your algebra subjects.
Learning Outcomes
Page 1 of 30
Figure 1
Examples of Graphs
Example 1.
The following table lists five students at a college. An “X” indicates that
the two students belong to the same student organization in the current
semester.
Page 2 of 30
Solution.
Figure 2
A graph of students and their common organization
There are many types of graphs based on how the edges are connected.
Simple graph
A graph that does not contain loops and
multiple edges.
Page 3 of 30
Non-simple
A graph that contains two or more edges
that connect the same vertices called
multiple edges or an edge that loops to
the same vertex
Connected graph
A graph where any vertex can be reached
from any vertex by tracing along edges.
Complete graph
A graph where all possible edges are
drawn between vertices with no multiple
edges is called.
Bipartite Graph
A graph where vertices are split into two
sets such that no two vertices within the
same set are adjacent.
Tree
A connected graph in which any two
vertices are connected by exactly one
path. It contains no cycle and any edge
you take out, the graph becomes
disconnected
Page 4 of 30
The three graphs shown in Figure 4 are considered equivalent graphs
because the edges form the same connections of vertices in each graph.
Figure 4
Equivalent graphs
If we prepare the table for the graphs in Figure 4, all will have the
same representation as shown in the table below.
A B C D E
A X
B X X X
C X
D X
E X
Euler Circuits
Figure 5
A graph containing different paths
Page 5 of 30
A path contained in a graph can be thought of as a walk through the
graph from one vertex to another. One path in the graph would be A-
B-C-D.
If a path ends at the same vertex at which it started is called a closed
path or circuit. The path A-B-C-D-A is a closed path since it started
and ended at A.
Figure 6
A graph containing a closed path
Euler proved that the graph in Figure 5 could not have an Euler circuit.
He examined the number of edges that met at each vertex. The number of
edges that meet at a vertex is called the degree of a vertex. He made the
observation that every time you approached a vertex you would need to leave
that vertex in order to complete the desired path. If you traveled through that
vertex again, you would again need an approaching edge and a departing
edge. This means that for an Euler circuit to exist, the degree of every vertex
must be an even number. Also, he was able to show that any graph whose
every vertex has an even degree must have an Euler circuit. Such graphs are
called Eulerian.
Page 6 of 30
The Eulerian Graph Theorem guarantees that when all vertices of a graph
have even degree, an Euler circuit exists, but it does not tell us how to find
one. Because we deal with graphs which are relatively small, we will rely on
trial and error in finding Euler circuits.
Example 2.
Figure 7
Solution.
Euler Paths
In this case, what we are looking for is a path that uses every edge once
and only once. We call such path an Euler path.
Page 7 of 30
Example 3.
Figure 8
Floor plan of a gallery
Solution.
Figure 9
Graph of the floor plan of the gallery
The graph in Figure 9 is equivalent to our floor plan. If we would like to
tour the gallery and pass through every doorway once, we must find a path in
our graph that uses every edge once. Thus we are looking for an Euler path.
In the graph, two vertices are of odd degree and the rest of the vertices are of
even degree. So we know that an Euler path exists, but not an Euler circuit.
Therefore, we cannot pass through each doorway once and only once if we
want to return to the starting point, but we can do it if we end up somewhere
else. Furthermore, we know we must start at a vertex of odd degree- either
room C or room E. By trial and error, one such path is E-D-A-B-C-G-F-E-A-
E-B-F-C.
Page 8 of 30
Weighted Graphs and Hamiltonian Circuits
In some situations, we may be interested in paths that visit each vertex once,
instead of edges. The path that visits each vertex once and returns to the
starting vertex without visiting any vertex twice is called a Hamiltonian
circuit.
Hamiltonian Circuit
Dirac’s Theorem
Example 4.
Apply Dirac’s theorem to verify that the following graph is Hamiltonian. Then
find a Hamiltonian circuit.
Figure 10
Graph which may contain a Hamiltonian circuit
Page 9 of 30
Solution.
There are six vertices in the graph, so 𝑛 = 6, and every vertex has a degree
𝑛
of at least 2 = 3. So, by Dirac’s theorem, the graph is Hamiltonian. This
means that the graph contains a Hamiltonian circuit. The circuit A-B-F-D-E-
C-A is one Hamiltonian circuit.
Example 5.
For the weighted graph below, find three different Hamiltonian circuits
and find the total weights for each circuit.
Figure 11
A weighted graph
Solution.
There are six vertices in the graph, so 𝑛 = 6, and every vertex has a degree
𝑛
of at least 2 = 3. We have verified that the graph is Hamiltonian. Three
Hamiltonian circuits are A-C-E-B-D-F-A, A-B-D-E-C-F-A, and A-F-C-E-D-B-
A. The total weights are as follows:
A − C − E − B − D − F − A: 5 + 5 + 7 + 10 + 12 + 8 = 47
𝐴 − B − D − E − C − F − A: 5 + 10 + 6 + 5 + 13 + 8 = 47
A − F − C − E − D − B − A: 8 + 13 + 5 + 6 + 10 + 7 = 49
Page 10 of 30
Algorithms in Complete Graphs
Example 6.
Use the greedy algorithm to find a Hamiltonian circuit in the given weighted
graph shown in Figure 12. Start at vertex A.
Figure 12
A weighted graph
Page 11 of 30
Solution.
Page 12 of 30
The Edge-Picking Algorithm
Example 7.
Solution.
Page 13 of 30
The next weight we highlight is 3 which
connects B and E.
We see that using different algorithms would lead to the same Hamiltonian
circuit. Thus, resulting too an equal total weight. It is left for you to verify if
this situation is true for all weighted complete graphs.
An edge of the graph may be labeled with different measures, say time or cost.
Because of this, an application of the algorithms earlier presented is possible.
We look at some of these applications.
Example 8.
Jamie needs to mail a package at the post office, pick up several items at the
grocery store, return a rented clothing, and make a deposit at her bank. The
Page 14 of 30
estimated driving time, in minutes, between each of these locations is given
in the table below.
Use both the algorithms to design routes for Jamie to follow that will help
minimize her total driving time. Assume that she must start at home and
return home when her errands are done.
Solution.
Figure 13
Graph of Jamie’s activities
We then apply the algorithms and see which of the two yields a better result.
Page 15 of 30
(a) Resulting Hamiltonian circuit when (b) Resulting Hamiltonian circuit using
Greedy algorithm is applied the Edge-Picking algorithm
Figure 14
In this case, the total weight obtained by applying the Greedy algorithm is
23 + 18 + 12 + 8 + 12 = 73, while that of Edge-Picking algorithm is 20 + 12 + 8 +
11 + 23 = 74. Since we want a minimum number of time for Jamie to complete
her task, we choose the route yielded by the Greedy algorithm because it
resulted to a lower total weight.
Planar Graph
The graph that is drawn showing o intersection between edges is called the
planar drawing of the graph.
Example 9.
Page 16 of 30
Figure 15
Graph of the problem
Solution.
Figure 16
Resulting graph when vertex D is moved below vertex C
Since no edges intersect, we have shown that the graph given in Figure 16 is
planar.
A strategy we can use to show that a graph is not planar is to find a subgraph,
a graph whose edges and vertices come from a given graph, that is not planar.
The Utilities graph below is a common subgraph to watch for. Another graph
that is not planar is the complete graph with five vertices, denoted 𝐾5 .
Page 17 of 30
(a) The Utilities graph (b) Complete graph 𝐾5
Figure 17
Subgraph Theorem
Example 10.
Figure 18
Page 18 of 30
Solution.
The Utilities graph and 𝐾5 serve as building blocks for nonplanar graphs. It
was proved that any nonplanar graph will always have a subgraph that is the
Utilities graph or 𝐾5 .
Euler’s Formula
Page 19 of 30
Euler’s Formula
Example 11.
Count the number of edges, vertices, and faces in the planar graph below,
and then verify Euler’s formula.
Figure 19
Solution.
In the graph, there are 5 vertices, 4 faces, and 7 edges. Using Euler’s formula,
we have 𝑣 + 𝑓 = 5 + 4 = 9 and 𝑒 + 2 = 7 + 2 = 9. So, 𝑣 + 𝑓 = 𝑒 + 2.
Graph Coloring
Coloring Maps
An example is a map of the United States shown in Figure 20. Note that the
map has only four colors and that no two states that share a common border
have the same color.
Page 20 of 30
Figure 20
Figure 21
(a) Vertices are connected based on (b) The graph representing the map
common boundary
Figure 22
If we erase the map, what will be left is the graph that represents the map
(Figure 22(b)). Recall that a vertex is a region in the map and an edge indicates
Page 21 of 30
that the two regions share a common boundary. Now, we color the vertices
using a simple rule: If two vertices are connected, they must not be assigned
the same color. The result of this coloring is given in Figure 23.
Figure 23
From the figure, we see that map coloring is based on the color of the vertex
in the graph. In this case, since 4 colors were used to color the map, then the
map is said to be 4-colorable.
Example 12.
Figure 24
An uncolored map
Page 22 of 30
Solution.
Page 23 of 30
Chromatic Number of a Graph
Task Scheduling
Example 13.
Five different school organizations want to schedule meetings every last day
of the month. Some club members, however, belong to more than one of these
clubs, so clubs that share members cannot meet at the same time. Find the
number of time slots 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.
Page 24 of 30
Solution.
Figure 25
Figure 26
The graph can be colored using at least three colors. In this case, since each
color corresponds to a time slot, then we can schedule the meetings as follows:
Page 25 of 30
Supplementary Learning Resources
Remote (asynchronous)
1. For each graph, determine the number of edges, the number of vertices,
the number of vertices that are of odd degree, whether the graph is
connected, and whether the graph is complete.
Page 26 of 30
3. Label the second graph so that it is equivalent to the first graph.
Page 27 of 30
If the graph does not have an Euler circuit, does it have an Euler path?
If so, find one. If not, explain why.
Page 28 of 30
6. Consider the given graph below. Find two Hamiltonian circuits with
different total weights, starting at vertex A. Compute the total weight of
each circuit.
Page 29 of 30
9. Verify Euler’s formula for each graph given.
Graph Verification
𝑣 = _______
𝑒 = _______
𝑓 = _______
𝑣 = _______
𝑒 = _______
𝑓 = _______
10. Represent the given map by a graph and find a coloring of the
graph using the least possible number of colors. Then color the map
based on the graph coloring you found.
Page 30 of 30