Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

112

UNIT XI. MATHEMATICS OF GRAPHS


by Janina C. Sercenia

Overview

The origin of graphs was first introduced in the 18th century by Swiss mathematician Leonhard Euler. His
attempts & eventual solution to the famous Königsberg bridge problem quoted as the origin and evolution of graph theory.
From there, graph theory has developed into one of the richest branches of mathematics in terms of application and
theory. Graph theory is a branch of mathematics concerned with networks of points connected by lines. It is usually the
study of the relationships and it focuses on the way points are connected. Unlike other “graph” that you have encountered
in algebra or calculus, “graph” in graph theory concept is much simplified as consisting of points, lines, and has no regard
to coordinates and distances.
This unit provides you basic concept and application of the graph theory. Many practical problems can be easily
represented in graphs. This also gives you essential knowledge on planning efficient routes, networking, and suggesting
new friends within social network websites.

Learning Objectives:

At the end of this unit, you will be able to:


1. Identify the basic concepts and different kinds of graphs;
2. Determine the Euler and Hamiltonian paths and circuits;
3. Apply graph coloring to solve practical problems;
4. Solve real life problems using concept, algorithms, and theorems of graphs theory.

Setting Up (Unit 11)

Name: _______________________________________________________Score: ______________________________

Course/Year/Section: ___________________________________________ Date: _______________________________

Directions: Answer the following questions.


John is a delivery man and he is going to deliver 6 packages in a small town.

Jan Flor

Kat
Emy
Sam


Claire
Jona
James

a. Where do you think John should start and end? Why?


_________________________________________________________________________________________________
_________________________________________________________________________________________________
_________________________________________________________________________________________________
_________________________________________________________________________________________________
________________________________

b. What do you think is the shortest route? Why?


_________________________________________________________________________________________________
_________________________________________________________________________________________________
_________________________________________________________________________________________________
_________________________________________________________________________________________________
________________________________

Lesson Proper

Graphs and Euler Circuits

A graph is a set of points called vertices and line segments called edges that connect vertices. It is usually a
diagram that contains information and depicts the connection and relationship between the various parts of a diagram. A
graph can include vertices that are not joined to any edges, but all edges must begin and end at vertices. A graph can be
used to depict road maps, bridges, transportation routes, electric networks, football teams, and other situations.
113
Illustration:

The graph has 4 vertices and 3 edges

Example:
The table below lists five individuals with a facebook account. An “X “in the table below indicates that the two individuals
are Facebook friends
Ana Emily Jen Kyla Cloei
Ana x x
Emily x x x
Jen x x
Kyla x x
Cloei x

a) Draw a graph that represents this information where each vertex represents an individual and an edge connects two
vertices. If the corresponding individuals are friends.

b) Using the graph, who has the most number of friends? How many friends does Jen have in common with the others?

Solution:
a. We will draw the five vertices to represents the five individuals. We connect the vertices with edges according to the
table.
Ana
Emily

Jen

Kyla
Cloei

b. By observing the figure, we can see that Emily has 3 Facebook friends . The vertex corresponds to Emily are
connected to two or more edges than the other. Jen’s vertex is connected to two edges, hence she has two
Facebook friends.

The basic concept of Graph


l Multiple edges are two or more edges that connects to the same vertices.
l Loop is an edge that begins and ends at the same vertex or edge that connects a vertex to itself.
l Connected graph is a graph in which any vertex reached from any other vertex by tracing along edges.
l Complete graph is a connecting graph in which every possible edge is drawn between vertices.
l Equivalent graphs two graphs are said to be equivalent graph provided that the edges form the same connection of
vertices in each graph

Consider the following graphs;



A graph with 6 vertices This is a connected graph This is a graph which This is a complete
but no edge. This is not with pair of multiple edges contains loop graph with 6 vertices.
an example of connected
graph

Illustration:
B
A A
D

D
B C
C

The two graphs are equivalent graphs with edges AB, BC, AC and AD.

Euler Circuit

Leonhard Euler first introduced and used Euler paths and circuits in 1736. He used it to find a way to visit every
edge of graph once and only once. This would be useful for checking parking meters along the street of the city, patrolling
the streets of a city, or delivering mail. Take note of the following terms.
114
l Path in a graph theory is a sequence of edges. A movement from one vertex to another by traversing edges. A path
can repeat edges and the length of a path refers to the number of edges connected.

l Closed path or circuit is a path that ends at the same vertex at which it started. A closed path is said to be closed
path if the first and last vertices of its vertex sequence are the same.

Illustration: Consider the following graph

Path
1. a-b-c-d-a Closed path
2. b-a-e Not a closed path
3. e-a-d-c-b-a Not a closed path

l Euler Circuit is a closed path in a graph that uses each of the edges exactly once. Is a path that uses every edge
but does not use any edge more than once and begins and ends at the same vertex.

l Eulerian graph theorem states that the graph has a Euler circuit if the graph is connected and the degree of the
vertices must be even.

Illustration: Identify which of the following graph has a Euler circuit?


Solution: Figure 1 Figure 2
a. All vertices of figure 1 are of even degree and a connected graph, hence the graph has a Euler circuit. The
Eulerian circuit is a-b-e-c-d-a.

b. Figure 2 B does not have Eulerian circuit since vertices a and d are of odd degree.

l Euler path is a path that uses every edge of a graph exactly once and does not use any edge more than once.

l Euler Path Theorem states that a connected graph has 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.

Illustration: Consider the following graph;

A
In the given graph, vertices C and E are
E odd degree, while A, D and B are even
degree, hence this graph is an example
of Euler path but not a Euler circuit
B
C
D
Weighted graph and Hamiltonian circuit
Imagine you are a delivery man and you are about to deliver packages in a certain town. You are planning a
route that takes you in each of the houses just once and takes you back to where you started. This type of route is called
Hamiltonian circuits. Hamiltonian Circuits is a path that begins and ends at the same vertex and passes through each
vertex of a graph at exactly once. This circuit was named after Sir William Rowan Hamilton (1805-1865). His problem is to
visit each city exactly once by travelling along the edges and be able to return to the starting city. He solved this problem
in the form of dodecahedron that contains the name of a city in each corner.
To verify that the graph is Hamiltonian use Dirac’s Theorem.
l 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 n/2, then the graph must be hamiltonian.
115
Example:

The graph has 6 vertices.


If n=6, then 6/2 = 3.
Hence, by Dirac’s Theorem the
given graph is Hamiltonian

l Weighted graph is a graph whose edges are assigned with a value called weight. The value can represent every
value we desire. Weight may represent mileage, time, cost, or some other quantities.

Illustration:
Consider the given graph with corresponding weights. Find a hamiltonian circuit of different total weights starting in vertex
A in a weighted graph.

A 10 B
15 12 A hamilton circuit is A-D-B-E-C-A.
20 21 24 5 Add the corresponding weights of each edge
C 7 6 D in the circuit.
E
15+5+24+7+20 = 71, The total weight is 71.

Algorithm in Complete Graphs


Unfortunately there is no shortcut for finding the optimal Hamiltonian circuit in a weighted graph. However, two
algorithms can be used to find a good solution. These two algorithms apply only to complete graphs - a graph in which
every possible edge is drawn between vertices without any multiple edges.
Greedy Algorithm also known as shortest path algorithm developed by Dijkstra. The greedy algorithm choose
the cheapest option at every chance it gets. Here are the steps:
1. Choose a vertex to start at, then trave along the connected edge that has the smallest weight. (If two or more
vertices 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.

Example: Find the Hamiltonian circuit of the given weighted graph using greedy algorithm. Start with A.

A Find the the smallest weight of each edge, start at A.


8 7 A =5 Connect to D
C
4 C D = 4 Connect to E
B C
E = 3 Connect to B
3C 6
7 C B = 4 Connect to C
6 8
C 5 C = 7 Connect to A
C C
C The Hamilton circuit is A-D-E-B-C-A.
D 4 E
C The weight of the circuit is 5 + 4 + 3 +4 + 7 =23

The edge Picking Algorithm is another method of finding Hamiltonian circuit in a complete weighted graph is
given by the following steps.
1. Mark the edge of the smallest weight in the graph. (if two or more edges have the same weight, pick only one)
2. Mark the edge of the next smallest weight in the graph, as long as it does not complete a circuit 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.
116
Example: Find the Hamiltonian circuit of the given weighted graph using edge picking algorithm.

A Starts with BE since it has a smallest weight of 3.


8 7 The next smallest weight is DE and BC with 4 weight,
C
4
C mark these two edges.
B C
Then mark DA with 5 weight
3C 6
7 C The next smallest weight is 6, AE and CD
6 8 The next is weight 7, BD and AC.
C 5
C C
C The final edge is AC.
D 4 E
C Begin at B the hamilton circuit is B-E-D-A-C-B
Thealgorithm
Take note that the greedy weight of
andthe
thecircuit is 3 + 4algorithm
edge picking +5 + 7 + attempts
4 = 23 to give a circuit of minimal total
weight, although neither does not always succeed.

Eulers Formula
Planarity
Is it possible to draw a graph so that none of the edges cross? If this is possible then the graph is called a planar
graph. A Planar graph is a graph that can be drawn so that no edge intersects each other (except at vertices). Look at
the following examples;
Illustration:

Figure 1 Figure 2

The first figure might not seems like a planar graph since it cross one of the edges but if you redrew it into a
equivalent planar (figure2) the graph becomes a planar representation. Take note that the figure1 and the figure 2 are
equivalent graphs.
While looking at the planar graph you will notice some features. The edges and the vertices divides the graph into
different regions called face. The region surrounding the graph or the exterior, is also considered a face, called the infinite
face.

Illustration:

Infinite face
face In this example there are 3 faces
face including the infinite face.

There is a relationship between the number of vertices, edges and faces of a given connected planar graph and
that is the Euler formula.

l Eulers Formula states that in any 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,
v+f=e+2
Illustration: Lets verify the Euler’s formula for the given graph

In this example there are 4 vertices, 3 faces


and 5 edges, using Eulers formula,
v+f=e+2
4+3=5+2
7=7

Graph Coloring

The study of graph coloring was first introduced by Francis Guthrie on 1850. He tried to color the map with at
most four colors such that no pair of neighboring countries get the same color. He attempts to answer this so that he can
easily distinguish countries. The concept was known as graph coloring. A graph coloring is an assignment of labels,
called colors to the vertices of a graph such that no two adjacent vertices share the same color.
117
Four color theorem

The four color theorem states that every planar graph is 4 colorable. This indicates that every map in the plane
consisting of connected regions without a hole can be colored with four different colors without coloring two adjacent
regions with the same color. Adjacent mean that two regions share a common boundary curve segment, not merely a
corner where three or more regions meet. This theorem was proved in 1976 by Wolfgang Haken and Kenneth Appel,
Mathematician at University of Illinois. The four color theorem guarantees that we need only four colors to color a planar
graph. However, if we want to color a nonplanar graph we need more than four colors.

Illustration: Example of Four colored map

Source: https://geoawesomeness.com/why-19th-century-mathematicians-were-obsessed-with-
coloring-maps/four-color-map-2/

Four colored Map of the United States

Two-colorable Graph Theorem

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 graph. In general there is no efficient method of finding the chromatic number of a graph
but there is a theorem that can tell whether a graph is 2-colorable.

Two- colorable graph theorem statest that a graph is 2-colorable if and only if it has no circuits that consist of an odd
number of vertices.

References

Books:
Reyes, J. et.al. (2018).Mathematics in the Modern World. Panday Lahi Publishing House, Muntinlupa City, p. 143-149

Rodriguez, M.,et.al., (2018). Mathematics in the Modern World. Niemie Publishing House, Quezon City, p.151-162

Websites
https://towardsdatascience.com/graph-theory-history-overview-f89a3efc0478
https://courses.lumenlearning.com/wmopen-mathforliberalarts/chapter/introduction-euler-paths/
https://study.com/academy/lesson/assessing-weighted-complete-graphs-for-hamilton-circuits.html
https://study.com/academy/lesson/assessing-weighted-complete-graphs-for-hamilton-circuits.html
https://math.libretexts.org/Bookshelves/Applied_Mathematics/Book%3A_College_Mathematics_for_Everyday_Life_(Inigo
_et_al)/06%3A_Graph_Theory/6.04%3A_Hamiltonian_Circuits
https://math.libretexts.org/Courses/Saint_Mary's_College%2C_Notre_Dame%2C_IN/SMC%3A_MATH_339_Discrete_Mat
hematics_(Rohatgi)/Text/5%3A_Graph_Theory/5.3%3A_Planar_Graphs
https://brilliant.org/wiki/graph-coloring-and-chromatic-numbers/
https://arxiv.org/ftp/arxiv/papers/1804/1804.04658.pdf
https://stackoverflow.com/questions/37288693/canonical-algorithm-for-visit-each-door-once-problems
118
Assessing Learning (Unit 11-A)

Name: _______________________________________________________Score: ______________________________

Course/Year/Section: ___________________________________________ Date: _______________________________

Directions: Determine whether the graph below is Eulerian. If it is, find a Eulerian circuit.
119

Assessing Learning (Unit 11-B)

Name: _______________________________________________________Score: ______________________________

Course/Year/Section: ___________________________________________ Date: _______________________________

Direction: Prepare a list of the names of your 10 friends and your mutual friends on Facebook. Construct a graphical
representation of your friends and mutual friends. Who among you has the most number of friends?
120
Assessing Learning (Unit 11-C)

Name: _______________________________________________________Score: ______________________________

Course/Year/Section: ___________________________________________ Date: _______________________________

Direction: Answer the following problem:


A. Suppose that the diagram below represents the floor plan for the ground of an art gallery. The art gallery is consist of
5 rooms and 11 doors. Is it possible to tour the exhibit on the art gallery so that you pass through each door exactly
once? If possible, in which room must they begin and end the tour? Draw your planned route and support your
answer. (source: D.S. Malik & M.K. Sen)

B C D
A E

J I G

K F
H G

B. Draw the map of Central Luzon and divide the map into its province. Use the four colored theorem to color the
different province of Cental Luzon.

You might also like