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

APPLICATION OF GRAPH THEORY TO TOURS

BELLO, ABDUL-WALIYYU ONAOLAPO


13/56EB058

SUPERVISOR: Dr. S. O. MAKANJUOLA

A PROJECT WORK PRESENTED TO THE DEPARTMENT OF MATHEMATICS,


FACULTY OF PHYSICAL SCIENCES, UNIVERSITY OF ILORIN, ILORIN, NIGERIA.

IN PARTIAL FULFILMENT OF REQUIREMENTS FOR THE AWARD OF BACHELOR OF


SCIENCE DEGREE (B. Sc., HONS.) IN MATHEMATICS.

JUNE, 2017.
Abstract

The subject of this research consists of selected topics in graph theory,


we define a graph, discuss some types of graph and show their
relationship to tours by developing an efficient algorithm for
mathematical models of various optimization problems.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.2 S. O.
29M
Limitations and Scope of study

Scope:
This work is limited in scope to:
concepts that are basic to graph theory;
types of graphs; and
applications (i.e. The Chinese Postman and Route Inspector
problems).
Limitation: This project work is limited to some theoretical
applications of graph theory as it is very wide, some practical findings
are excluded.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.3 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Definition Of Graph

Graphs are so named because they can be represented graphically, and


it is this graphical representation which helps us understand many of
their properties. A graph is an ordered pair G = (V , E) where V is a
(finite) set of vertices, nodes or points and E is a finite collection of
edges, arcs or lines. The set E contains elements from the union of the
one and two element subsets of V . That is, each edge is either a one or
two element subset of V . Conceptually; a graph is formed by vertices
and edges connecting the vertices.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.4 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Definition Of Graph (cont.)

Figure 1: We have V = {v1 , ..., v5 } for the vertices and


E = {(v1 , v2 ), (v2 , v5 ), (v5 , v5 ), (v5 , v4 ), (v5 , v4 )} for the edges.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.5 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Definition Of Graph (cont.)

Similarly, we often label the edges with letters (for example: a, b, c, ...
or e1 , e2 , ... ) or numbers 1, 2, ... for simplicity. So E = {e1 , ..., e5 }. For
an edge {x, y}, graph theorists usually use the somewhat shorter
notation xy.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.6 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Types of Graph

• Directed graph: A directed graph is a graph in which its edges


have orientations. A graph G = (V , E) with V being a set of ordered
pair of vertices is called a directed graph i.e. (e1 , e2 ) 6= (e2 , e1 ) the edge
(e1 , e2 ) is not identical to the edge (e2 , e1 ). If Otherwise, it is called an
undirected graph

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.7 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Types of Graph (cont.)

• Connected graph: A connected graph is an undirected graph in


which every unordered pair of vertices in the graph is connected.
Otherwise, it is called a disconnected graph.

• Simple graph: A graph G = (V , E) is a simple graph if G has no


edges that are self-loops and if E is a subset of two element of V .

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.8 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Types of Graph (cont.)

• Cyclic graph: A cyclic graph of order n≥3 is a graph in which the


vertices can be listed in an order v1 , v2 , . . . , vn such that the edges
are the {vi ,vi+1 } where i = 1, 2, ..., n − 1, plus the edge {vn ,v1 }. Cyclic
graphs can be characterized as connected graphs in which the degree of
all vertices is 2.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: /TO
Dr.9 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Types of Graph (cont.)

• Weighted graph: A graph G = (V , E) is a weighted graph if to


each edge, a real number is assigned. Such weights may denote for
example costs, lenghts or capacities.

• Complete graph: A complete graph is a graph in which each pair of


vertices is joined by an edge. A complete graph contains all possible
edges.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
10 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Types of Graph (cont.)

• Bipartite graph: A bipartite graph is a graph in which the vertex


set can be partitioned into two sets, V1 and V2 , so that no two vertices
in V1 share a common edge and no two vertices in V2 share a common
edge.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
11 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Walks, Trails, Paths and Cycles

• Walk:
A walk of length k in the graph G = (V , E) is an alternating sequence
of vertices V and edges E of G of the form

w = (v0 , e1 , v1 , e2 , . . . , ek , vk )

which begins and ends with vertices. Vertices vt−1 and vt are end
vertices of et (where t = 1, ..., k). The initial vertex is v0 and vk is the
terminal vertex. The number of edges k is the length of the walk. A
zero length walk is just a single vertex v0 . It is allowed to visit a vertex
or go through an edge more than once. A walk is open if v0 6= vk ,
otherwise it is closed.
Example 1: In the graph

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
12 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Walks, Trails, Paths and Cycles (cont.)

Figure 2: the walk (v2 , e7 , v5 , e8 , v1 , e8 , v5 , e6 , v4 , e5 , v4 , e5 , v4 ) is open. On


the other hand, the walk (v4 , e5 , v4 , e3 , v3 , e2 , v2 , e7 , v5 , e6 , v4 ) is closed.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
13 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Walks, Trails, Paths and Cycles (cont.)

• Trail:
A walk is a trail if any edge is traversed at most once. Let G = (V , E)
be a graph, a trail in G is a walk in which all the edges e1 , e2 , . . . , ek
are distinct.
Example 2:
The walk (v1 , e8 , v5 , e9 , v1 , e1 , v2 , e7 , v5 , e6 , v4 , e5 , v4 , e4 , v4 ) in the
graph in example 1 is a trail.
• Path: A path is a trail in which all the vertices (except possibly the
first and last) are distinct. It is of the form:

v0 , e0 , v1 , e1 , v2 , . . . , vk−1 , ek−1 , vk ,

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
14 S. O.
29M
BASIC CONCEPTS OF GRAPH THEORY

Walks, Trails, Paths and Cycles (cont.)

which begins and ends with vertices.


Example 3:
The walk (v2 , e7 , v5 , e6 , v4 , e3 , v3 ) in the graph in example 1 is a path.
• Cycle A cycle is a closed trail whose origin and internal vertices are
distinct. A closed walk of length at least 3 with no repeated edges in
which the only repeated vertices are the first and the last is called a
cycle.
Example 4:
- The walk (v2 , e7 , v5 , e6 , v4 , e3 , v3 , e2 , v2 ) in the graph in example 1
is a cycle.
- A cycle of 3 lengths is called a triangle.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
15 S. O.
29M
EULARIAN GRAPH

Eularian Graph

An Euler trail of a graph G is a closed trail that traverses each edge of


G exactly once. Equivalently a walk that traverses every edge of G
exactly once and finishes at the starting vertex is called an Eulerian
trail.
Hence, A connected graph G = (V , E) is an Eulerian graph if it
contains an Eularian trail.
Eulerian graphs can be characterized in different ways, here are some of
them:
1 Let G = (V , E) be a connected graph. Then G has an Eulerian
trail if and only if G has exactly two vertices of odd degree.
2 Let G = (V , E) be a connected graph. Then G is an Eulerian
graph if and only if the edge set of G can be partitioned into
disjoint cycles.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
16 S. O.
29M
APPLICATIONS

The Chinese Postman Problem

The problem is of a postman delivering mails from a post office to some


streets in such a manner that He covers each street on His route at
least once, the total distance covered by the postman was as short as
possible and He still returned to the post office.
The problem can be represented in terms of a weighted graph that will
be similar to the network of the roads, and the weight of every edge will
also be similar to the length of the corresponding road (i.e. the problem
is to find a trail that passes through all the edges of the graph and has
a minimum possible weight).
As discussed in the section above, it is clear to see that the graph in
question is Eularian
The problem can be easily solved in this case, the algorithm for finding
a minimum length to the Chinese postman problem is:
tep 1 List all the vertices of odd degrees.
tep 2 List all possible pairings of the vertices with odd degrees.
BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
17 S. O.
29M
APPLICATIONS

The Chinese Postman Problem (cont.)

tep 3 For each pairing, find the edges that connect the vertices with
minimum weights.
tep 4 Find the pairings such that the sum of the weight is minimised.
tep 5 Add the edges that have been found in Step 4 to the original graph.
tep 6 The length of an optimal Chinese postman route is the sum of all
the edges added to the total length found in Step 4.
tep 7 A route corresponding to this minimum weight can then be easily
found.
Example
A postman has to start at a post office A, walk along 13 streets, deliver
mails and return to A. The numbers on each edges represent the length
(in metres), of each street. Find a trail that passes through all the
edges of the graph with minimum length.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
18 S. O.
29M
APPLICATIONS

The Chinese Postman Problem (cont.)

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
19 S. O.
29M
APPLICATIONS

The Chinese Postman Problem (cont.)

If we now apply the algorithm to this problem:


tep 1 The vertices of odd degrees are A and H .
tep 2 There is only one way of pairing A and H , namely AH .
tep 3 The pairing of edges that joins A to H with minimum lengths are
AB, BF , and FH .
tep 4 The sum of the weights of the pairings AB, BF , and FH gives a
minimum length of 160.
tep 5 We then draw the edges on the original graph.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
20 S. O.
29M
APPLICATIONS

The Chinese Postman Problem (cont.)

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
21 S. O.
29M
APPLICATIONS

The Chinese Postman Problem (cont.)

tep 6 The optimal length of the postman’s route is the sum of all the
edges in the original graph, which is 840m added to the minimum
length found in Step 4 which was 160m. Hence, the optimal length
of the postman’s route is 1000m.
tep 7 Many possible routes corresponding to this minimum length can be
found, one of them is ADCGHCABDFBEFHFBA.
With these, we have been able to show that
ADCGHCABDFBEFHFBA is an optimal tour that the postman leaves
the post office, passes through all the 13 streets, delivers all His mails
and returns to the post office with an optimum length of 1000m.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
22 S. O.
29M
APPLICATIONS

The Route Inspector Problem

Example
A route inspector of a popular bus company was interested in
inspecting all the routes of their buses in order to save the cost of fuel.
The inspector modelled the bus stop as the vertex and the roads were
modelled as the edges in the bus route, and after applying the earlier
stated algorithm, he was able to find an optimal route that met his
target for the buses to consume minimal fuel after passing through
every road at least once. See a representation of the road network
below.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
23 S. O.
29M
APPLICATIONS

The Route Inspector Problem (cont.)

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
24 S. O.
29M
APPLICATIONS

The Route Inspector Problem (cont.)

If we apply the algorithm used in the above section to this problem, we


will get the following results:
tep 1 The odd vertices are u and v.
tep 2 There is only one way of pairing u and v, namely uv.
tep 3 The pairing of edges that joins u to v with minimum lengths are
ux, xy, yw and wv.
tep 4 The sum of the weights of the pairings ux, xy, yw and wv gives a
minimum length of 6m.
tep 5 We then draw the edges on the original graph.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
25 S. O.
29M
APPLICATIONS

The Route Inspector Problem (cont.) (cont.)

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
26 S. O.
29M
APPLICATIONS

The Route Inspector Problem (cont.) (cont.)

tep 6 The optimal length of the buses route to meet the target of
consuming minimal fuel across every road, at least once is the sum
of all the edges in the original graph, which is 31m added to the
minimum length found in Step 4 which was 6m. Hence, the
optimal length of the buses route is 37m.
tep 7 Many possible routes corresponding to this minimum length can be
found, one of them is xuywvzwyxuwvxzyx.
Hence, we have been able to find an optimal route xuywvzwyxuwvxzyx
with an optimal length of 37m that could help the bus company to
increase the quality of their services whilst saving the cost of fuel.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
27 S. O.
29M
CONCLUSION

Conclusion

This study titled “Application of Graph Theory to Tours" has been able
to show how graph theory can be used to optimize problems that can
be modelled as road networks, and shows how simple such problems
can be solved to reduce the length of tours to the optimal minimum.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
28 S. O.
29M
REFERENCES

References

• Bondy, J. A. and Murty, U. S. R. (1976). Graph Theory with


Applications, Elsevier Science Publishing Co., Inc., New York, U.S.A.
• Wilson, R. J. (1985). Introduction to Graph Theory, Longman Group
Limited, Essex, England.
• Fields, J. E. (2001). Introduction to Graph Theory, Department of
Mathematics, Southern Connecticut State University, U.S.A.
• Christopher Griffin (2012). Graph Theory: Penn State Maths 485
Lecture Notes, U.S.A.
• Tero Haju (2011). Lecture Notes on Graph Theory, Department of
Mathematics, University of Turku, Finland.
• Paul Van Dooren (2001). Graph Theory and Applications, Université
Catholique de Louvain, Louvain-la-Neuve, Belgium.

BELLO, ABDUL-WALIYYU
APPLICATION
ONAOLAPO13/56EB058
OF GRAPH
JUNE,
THEORY
2017. TO
(SUPERVISOR: Dr. /TO
29 S. O.
29M

You might also like