0% found this document useful (0 votes)
11 views

C5 Mathematics of Graphs-1

The document discusses the mathematics of graphs, focusing on Eulerian and Hamiltonian graphs, their properties, and applications. It includes definitions, theorems, examples, and problems related to graph theory, such as Euler circuits, Hamiltonian paths, and the Travelling Salesman Problem. Additionally, it covers concepts like weighted graphs, planar graphs, and graph coloring, providing a comprehensive overview of their significance in modern mathematics.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

C5 Mathematics of Graphs-1

The document discusses the mathematics of graphs, focusing on Eulerian and Hamiltonian graphs, their properties, and applications. It includes definitions, theorems, examples, and problems related to graph theory, such as Euler circuits, Hamiltonian paths, and the Travelling Salesman Problem. Additionally, it covers concepts like weighted graphs, planar graphs, and graph coloring, providing a comprehensive overview of their significance in modern mathematics.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 59

Mathematics of Graphs

Mathematics in the Modern World


Objectives

At the end of the chapter, the student is expected to:


1. differentiate Eulerian from Hamiltonian graphs
2. apply Euler and Hamiltonian paths to solve
problems;
3. apply Euler and Hamiltonian circuits to solve
problems;
4. solve problems using graphs

Mathematics in the Modern World


Video Watching

How the Königsberg bridge


problem changed
mathematics - Dan Van der
Vieren

https://youtu.be/nZwSo4vfw6c

Mathematics in the Modern World


Seven Bridges of Konigsberg

Mathematics in the Modern World


Konigsberg under Prussian Rule in Eighteenth Century

Kaliningrad City, Kaliningrad, Russia

Mathematics in the Modern World


Example of Graphs
Konigsberg Seven Bridges

Mathematics in the Modern World


Source: https://math.stackexchange.com/questions/1173328/eulers-solution-of-seven-bridges-of-k
%C3%B6nigsberg-in-layman-terms
What is a Graph?

A graph is a collection of points called


vertices or nodes, and connecting segments
called edges.
Sometimes the edges are given orientations
and are represented by arrows or are given
values (weights).

The position of the vertices , the lengths of


the edges, and the shape of the edges do
not matter in a graph. What we look at is
the number of vertices and which of them
are joined by edges.
Mathematics in the Modern World
Example of Graphs
The graph below indicates the social
network of neurological patients.

Mathematics in the Modern World


Source:
https://www.nature.com/articles/nrneurol.2016.119
Example of Graphs

Molecular Structure

Mathematics in the Modern World


Example of Graphs

Computer Network

Mathematics in the Modern World


Example of Graphs
Judicial System

Mathematics in the Modern World


Constructing a graph
The following table lists five students at a
university.
An “X” indicates that the two students participate in
the same study
Renegroup
Madzthis semester.
Allan Norma Kiko
Rene --- X X X
Madz X --- X X
Allan X X --- X
Norma X ---
Kiko X X ---

Draw a graph that represents this information


where each vertex represents a student and an
edge connects two vertices if the corresponding

Mathematics in the Modern World


students study together.
Constructing a graph

Rene Madz

Kiko Allan

Nor
ma

Mathematics in the Modern World


Terminologies

A loop is an edge connecting a vertex to itself.

If two vertices are connected by more than one edge, these


A
edges are called multiple edges.

B
A graph with no loops and no multiple edges is called a simple
graph.

Mathematics in the Modern World


Terminologies

A graph is simple if it has no loops and there is


at most one edge between any two vertices in
the graph.

Mathematics in the Modern World


Terminologies

A graph is connected if there is a path connecting all the


vertices.
Two vertices are adjacent if there is an edge joining them.
If every pair of vertices of a graph are adjacent, the graph is
complete. A complete graph with n vertices is denoted by
Kn.

The degree of a vertex is the number of edges attached to it.

Mathematics in the Modern World


Complete Graph

Mathematics in the Modern World


Euler Circuits
A path is an alternating sequence of vertices and edges. It
can be seen as a trip from one vertex to another using the
edges of the graph.

If a path begins and ends with the same vertex, it is a


closed path or a circuit/cycle.

A circuit that uses every edge, but never uses the same
edge twice, is called an Euler circuit.

Mathematics in the Modern World


Leonard Euler
Examples of Euler Circuits
The number of edges that meet at a vertex is called the
degree of a vertex.

Mathematics in the Modern World


Eulerian Graph Theorem
A connected graph is Eulerian if and only if each vertex
of the graph is of even degree.
Note that the Eulerian Graph Theorem only guarantees
that if the degrees of all the vertices in a graph are even,

an Euler circuit exists, but it does not tell us how to find


one.

Is this graph
Eulerian?

Mathematics in the Modern World


Problem
Determine whether the graph below is Eulerian. If it
is, find an Euler circuit. If it is not, explain why.

Mathematics in the Modern World


Euler Path
Determine whether the following graph is Eulerian. If it
is, find an Eulerian circuit. If it is not, can you find an
Euler path? B C

A D
L E

K F
J G

I H

Mathematics in the Modern World


Euler Path

An Euler path is a path that uses every


edge of a graph exactly once.
An Euler circuit is a circuit that uses
every edge of a graph exactly once.
An Euler path starts and ends at different
vertices.
An Euler circuit starts and ends at the
same vertex.

Mathematics in the Modern World


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.

Mathematics in the Modern World


Application of Euler Path Theorem
Below is the map of all the trails in a national park. A biker
would like to traverse all the trails exactly once.
•Is it possible for the biker to plan a trip that traverses all
the trails exactly once?
•Is it possible for him to traverse all the trails and return to
the starting point without repeating any trail in the trip?

B
A

E
C
D

Mathematics in the Modern World


F
Hamiltonian Path and Circuit

A Hamiltonian path is a path that visits each vertex of the


graph exactly once.
A Hamiltonian circuit is a path that uses each vertex of a
graph exactly once and returns to the starting vertex. A
graph that contains a Hamiltonian circuit is called
Hamiltonian.

Mathematics in the Modern World


Note

 In Euler circuits, we looked at closed paths that use every


edge exactly once, possibly visiting a vertex more than once.

 On the contrary, in Hamiltonian circuits, we look at paths


that visit each vertex exactly once, possibly not passing
through some of the edges.

 But unlike the Euler circuit, where the Eulerian Graph


Theorem is used to determine whether it contains an Euler
circuit or not, we do not have a straightforward criterion to
determine whether or not a Hamiltonian circuit exists in a
graph.

Mathematics in the Modern World


Problem

Determine whether the graph below is Hamiltonian or not.


If it is, find a Hamiltonian circuit. If it is not, explain why?

A B C

G F D

Answer: A – B – C – E – D – F – G – A.

Mathematics in the Modern World


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.

Mathematics in the Modern World


Application of Hamiltonian Circuit
The graph below shows the available flights of a popular
airline. An edge between two vertices indicates that there
is a direct flight between the two cities. Determine whether
the graph is Hamiltonian. If it is, find a Hamiltonian circuit.
Seoul

Tokyo
Taipei
Hongkong

Macau

Bangkok

Manila
Ho Chi Minh

Kuala Lumpur
Malaysia

Mathematics in the Modern World


Singapore
Solution
n
There are ten vertices in the graph, and 2 5 . Now, vertex
Manila has 9 edges, Tokyo 5, Seoul 5,Taipei 6, Hongkong 7,
Macau 9, Ho Chi Minh 5, Kuala Lumpur 5, and Singapore5.
Using Dirac’s theorem, the graph is Hamiltonian.
This means that the graph contains a circuit that visits
each vertex and return to its starting point without visiting a
vertex more than once.
By trial and error, one Hamiltonian circuit is Manila –
Tokyo – Seoul – Taipei – Hongkong – Macau – Bangkok –
Ho Chi Minh – Kuala Lumpur – Singapore – Manila.

Mathematics in the Modern World


Take Note

If the graph does not meet the requirements of


the Dirac’s Theorem, it still might be
Hamiltonian.

A B C

G F D

Mathematics in the Modern World


Exercises
(Aufmann) Use Dirac’s theorem to verify that the graph is
Hamiltonian. Then find a Hamiltonian circuit.

(Source: Mathematical Excursions, Aufmann et al.,2015)

Mathematics in the Modern World


Weighted Graph
A weighted graph is a graph in which each
edge is associated with a value, called a weight.

Mathematics in the Modern World


Travelling Salesman Problem
The travelling salesman problem (TSP) asks the following
question: "Given a list of cities and the distances between
each pair of cities, what is the shortest possible route that
visits each city exactly once and returns to the origin city?“

The travelling salesman problem consists of a salesman and


a set of cities. The salesman has to visit each one of the
cities starting from a certain one (e.g. the hometown) and
returning to the same city. The challenge of the problem is
that the travelling salesman wants to minimize the total
length of the trip.

Mathematics in the Modern World


Example: Travelling Salesman Problem
The table below lists down the distances (miles)
between the cities having direct routes as well
as the corresponding distances between them.

Draw a graph the represents this information


and find two different routes that visit each of

Mathematics incity
thetwice.
Modern World
the places and return to its starting point
without visiting any
Example: Travelling Salesman Problem

Mathematics in the Modern World


Example: Travelling Salesman Problem

Mathematics in the Modern World


The Greedy Algorithm
A method of finding a Hamiltonian circuit in a complete
weighted graph is given by the following 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. Continue this process until you have visited all
vertices.
3. Return to the starting vertex.
Take Note:
The greedy algorithm attempts to give a circuit of minimal total
weight, although it does not always succeed.

Mathematics in the Modern World


Example
Aaron, Belle, Carol, Donna, Eric, and Fe are
best of friends. The figure below shows the
distances (km) from a friend’s place to another.
If Aaron wants to visit each of his friends’houses
exactly once, what is the shortest route that he
must take?

Mathematics in the Modern World


Solution

Mathematics in the Modern World


The Edge-Picking Algorithm
Another method of finding a Hamiltonian circuit in a
complete weighted graph is given by the following
edge-picking algorithm.
1. Mark the edge of smallest weight in the graph.
2. Mark the edge of the 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 the process until you can no longer mark
any edges. Then mark the final edge that
completes the Hamiltonian circuit.

Mathematics in the Modern World


The Edge-Picking Algorithm
Aaron, Belle, Carol, Donna, Eric, and Fe are best of
friends. The figure below shows the distances (km) from
a friend’s place to another. If Aaron wants to visit each of
his friends’ houses exactly once, what is the shortest
route that he must take?

Mathematics in the Modern World


Solution
•First we mark the line segment from Aaron’s house to
Belle’s house, of weight 1.
•Next we mark the segment from Belle’s to Carol’s house,
of weight 2, followed by Carol’s to Donna’s house, of
weight 3, followed by Eric’s to Fe’s house, of weight 6.
•Take note that we cannot mark the segment from Eric’s
house to Aaron’s because it can complete a circuit. Also,
we cannot mark the segment from Carol’s to Fe’s house
because it can make the third marked edge on a vertex.
•Finally to complete the circuit, we mark the line segment
from Fe’s house back to Aaron’s.
•The final Hamiltonian circuit, of total weight
1+2+3+6+9+12=33, is Aaron’s house – Belle’s house –
Carol’s house – Donna’s house – Eric’s house – Fe’s

Mathematics in the Modern World


house and back to Aaron’s.
Take Note

The edge-picking algorithm attempts to give a circuit of


minimal total weight, although it does not always
succeed.

Mathematics in the Modern World


Application
The table shows the lengths of cables needed to connect
computers to create a network. Find the minimum length
of cable material needed using the edge-picking algorithm.

A B C D E F
A -- 10 22 9 15 8
B 10 -- 12 14 16 5
C 22 12 -- 14 9 16
D 9 14 14 -- 7 15
E 15 16 9 7 -- 13
F 8 5 16 15 13 --

Mathematics in the Modern World


Planar Graphs
A planar graph is a graph that can be drawn so that
no edges intersect each other (except at vertices).

Mathematics in the Modern World


Platonic Solids

Mathematics in the Modern World


Subgraphs
A part of a graph G is called a subgraph of
G.
Subgraph Theorem
“If a graph G has a subgraph that is not
planar, the G is also not planar. In particular,
if contains the Utilities Graph or K5 as a
subgraph, G is not planar.”

Nonplanar Graph Theorem


A graph is nonplanar if and only if it has the
Utilities Graph or K5 as a subgraph, or it has
a subgraph that can be contracted to the
Utilities Graph or K5.

Mathematics in the Modern World


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 v + f = e + 2.

Mathematics in the Modern World


Graph Coloring
Coloring Map
If the map is divided into regions in some manner,
what is the minimum number of colors required if the
neighboring regions are to be colored differently?
There is a connection between map coloring and
graph theory. Maps can be modeled by graphs using
the countries as the vertices and two vertices
(countries) are adjacent if they share a common
boundary.
In graph coloring, each vertex of a graph will be
assigned one color in such away that no two adjacent
vertices have the same color. The interesting idea
here is to determine the minimum number of
(distinct) colors to be used so that we can color each

theMathematics in the Modern World


vertex of a graph with no two adjacent vertices have
same color.
Four-Color 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.

Four-Color Theorem
The chromatic number of a planar graph is utmost 4.

Mathematics in the Modern World


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.

Determine whether the graph is 2-colorable.

Mathematics in the Modern World


Scheduling Problem
Six college accreditation committees need to hold
meetings on the same day, but some teachers
belong to more than one committee. In order to
avoid members missing meetings, the meetings
need to be scheduled during different time slots.
An “X” in the table indicates that the two
corresponding committees share at least one
member. Use graph coloring to determine the
minimum number of time slots necessary to
ensure that all faculty members can attend all
meetings.

Mathematics in the Modern World


Table
Committee Faculty Faculty Outreach Physical Library Student
Instruction Development Program Facility Facility Welfare
(FI) (FD) (OP) (PF) (LF) (SW)

Faculty - X X X
Instruction

Faculty X - X X X
Development

Outreach X - X X X
Program
Physical X X - X
Facility
Library X X X - X
Facility
Student X X X X -
Welfare

Mathematics in the Modern World


Solution
First we draw a graph representing the six committees
using six vertices or nodes in any configuration. An edge
connects two committees that share at least one member.
Then assign each vertex of the graph with one color in such
a way that no two adjacent vertices have the same color.
FI FD

SW OP

LF PF

Mathematics in the Modern World


Conclusion
Obviously, the graph is not 2-colorable because we
can find circuits of odd length but the graph is 3-
colorable. Hence, the minimum number of time
slots necessary to ensure that all faculty members
can attend all meetings is 3.
Schedule of Meetings
First time slot: Faculty Instruction, Student Welfare

Second time slot: Faculty Development, Outreach


Program
Third time slot: Library Facility, Physical Facility

Mathematics in the Modern World


References

•Aufmann et al, Mathematical


Excursions (2013)
•https://www.youtube.com/watch?v
=nZwSo4vfw6c

Mathematics in the Modern World


“One learns by doing the thing; for though
you think you know it, you have no
Sophocle
certainty until you try.”
s

You might also like