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

MATHEMATICS OF

GRAPHS
Graph Theory
Graph theory deals with relationship between objects.
▷ Objects are represented by dots or points which are technically
called vertices.
▷ Objects are related if there is an edge (represented by a line
segment or curve) that connects them.

2
Graph
Graph is a set of vertices (points/dots) and edges (line segments or
curves).
Examples:
1. 3.

2.

3
Basic Terms Used in
Graph Theory
Degree of a Vertex
It refers to the number of edges that emanate from that vertex.
Examples:

A=
B=
C=
D=
A= C=
B= D= 5
Walk in a Graph
It is a movement from one vertex to other vertices passing through
their edges.
Examples:
A-B
A-B-C
B-A-C-D

A-B-D
C-B-A-D 6
Circuit
It is a walk in a graph that starts and ends on the same vertex.
Examples:
A-B-C-D-A
A-B-C-E-D-A
D-E-C-D

7
Circuit
It is a walk in a graph that starts and ends on the same vertex.
Examples:
A-D-C-A
A-B-C-E-D-A
E-D-A-B-C-E

8
Eulerian Circuit
It is a circuit which traverses all edges only once.
Examples:
A-B-C-E-D-C-A
C-E-D-C-A-B-C

9
Eulerian Circuit Theorem
A graph is Eulerian if and only if all vertices of the graph are of even
degrees.

10
Eulerian Circuit Theorem
A graph is Eulerian if and only if all vertices of the graph are of even
degrees.

11
Eulerian Circuit Theorem
A graph is Eulerian if and only if all vertices of the graph are of even
degrees.

12
Eulerian Walk
It is a walk in the graph traversing all edges once, without returning to
the starting vertex.
Examples:
C-B-A-C-D
D-C-B-A-C

EC-start/end same vertex,


all edges
EW- all edges 13
Eulerian Walk
It is a walk in the graph traversing all edges once, without returning to
the starting vertex.
Examples:
A-B-D-A-C-D-E-C-B
B-C-E-D-C-A-D-B-A

14
Hamiltonian Circuit
It is circuit visiting all vertices once.
Examples:
A-B-C-E-D-A
C-E-D-A-B-C
E-C-A-B-D-E

Eulerian Circuit – All edges


Hamiltonian Circuit - All vertices 15
Shortest Hamiltonian
Circuit
A-B-C-D-E-A = 64
A-B-D-E-C-A = 79
C-B-A-D-E-C = 65 17
Greedy Algorithm
Greedy Algorithm is a method of finding the shortest Hamiltonian
Circuit.
▷ Start with the shortest edge.
▷ On the end vertex of that edge, pick a “not yet chosen” vertex with
the shortest edge. Repeat this step, until all vertices are chosen,
then go back to the starting vertex.

18
A-B-C-D-E-A = 64 Greedy Algorithm: D-C-E-A-B-D = 47
A-B-D-E-C-A = 79
C-B-A-D-E-C = 65 19
It’s More Fun in the Philippines!
Suppose you are a foreigner planning to visit the Philippines for a
vacation. You are planning to go to the following places:
○ Manila
○ Davao
○ Bohol
○ Cebu
○ Boracay
Now you want to know what itinerary would be the best for you.

20
21
22
Cebu – Bohol – Boracay – Manila – Davao – Cebu
23

You might also like