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

Atif Ishaq - Lecturer GC University, Lahore

Graph Theory
CS-4207
Lecture – 01

Disclaimer: The Contents of this reader are borrowed from the book(s) mentioned in the
reference section.
Introduction
Before starting the lecture lets first try to find whether these questions [1] are answerable?
1. How can we lay cable at minimum cost to make every phone reachable from every
other?
2. What is fastest rout from the country capital to each province capital?
3. How can n jobs be filled by n people with maximum total utility?
4. In what order should a traveling salesman visit cities to minimize travel time?
5. Can we colour the region of every map using four colours so that neighboring regions
receive different colour?
These and many other practical questions involve the study of graph theory.
Graph Definition
Before formally defining a graph, let’s first discuss the problem that originates the study of
Graph Theory
The Konigsberg Bridge Problem: This problem asks if the seven bridges of the city
Konisberg, over the river Preger can all be traversed in a single trip without double back, with
the additional requirement that the trip ends in the same place it began. The people of Konisberg
daily try to find a solution for this problem. Eventually, Euler, a mathematician was asked to
give a solution. He replied that this problem doesn’t seems any relationship with mathematics
and can easily be solved. But he keeps on thinking about this, and ultimately solved this
problem in 1736.

1|Page
Atif Ishaq - Lecturer GC University, Lahore

Divide the area into different regions as in the figure below, where edges represents the bridges.
Now look at the each region about outgoing edges. The point a has a, d, and c have 3 edges
while b has 5. This division makes it easy to argue that such traversal doesn’t exist. The
existence of such traversal requires that each land mass be involved even number of bridges.
Thus this gives birth to the study of graph theory.

Now let us consider that you want to buy the souvenirs from eight different cities referred as
A, B, C, D, E, F, G, and H. Your aim is to visit all these cities with shortest path. If you starts
with A you have to select one from the rest of the six cities as your next destination. Similarly
if next destination is B then from B you have to select one from the rest of the five cities. Since
we can select any of the city as next destination, therefore there exists 5040 ( 7 x 6 x 5 x 4 x 3
x 2 x 1 = 5040) different paths to travel. Out of these 5040 paths you need to select the best trip
path. This problem is actually referred as Travel Salesman problem.
The four colour graph problem needs to fill all regions of the graph with four different colours
such that no adjacent regions have same colour.
Can you determine the relation of someone who is working in factory as security guard with
Bill Gates? Now a days facebook, tweeter, email, www, and internet are all based on the study
of graph theory or network theory.
All these questions and applications are motivation for the study of graph theory.

The Origin of graph concept


Dots and lines linking some dots on a plane. One example that first comes to mind is a
communication network: dots representing the centers or nodes of the network, lines
representing the links. This first example of modeling a communication network with a graph
is an application that is particularly obvious. Other, less obvious problems can also be
represented by a graph. Take this entertaining little scenario, for instance: A ferryman must

2|Page
Atif Ishaq - Lecturer GC University, Lahore

transport a wolf, a goat, and a cabbage over a river. For obvious reasons, he can only carry one
of them at a time over the river and is unable to leave the goat and cabbage or the wolf and goat
alone on one shore. How is it possible for him to transport everyone across? Can the issue be
resolved in more than one way? Does one route take less time than the others? Since there are
only a few options, it is relatively simple to respond to these questions, but it might be thought-
provoking to consider related but more serious issues and attempt to use an all-encompassing
and methodical study approach. This will be built on a graph model of the issue, which is not
particularly challenging but calls for a little more creativity than the communication network
does [2].
What is Graph?
An (undirected) graph G is defined by two finite sets: a non-void set V of elements called
vertices, a set E (which can be empty) of elements called edges, with for each edge e two
associated vertices, u and v, distinct or not, called the end vertices of e.
Formally a graph G is denoted as G = (V, E). The sets V and E can be denoted as V(G) and
E(G) respectively. Let for the graph G {u, v} is an edge of G. Since {u, v} is 2-element set, we
may write {v, u} instead of {u, v}. It is often more convenient to represent this edge by uv or
vu [3].
If e = uv is an edge of a graph G, then we say that u and v are adjacent in G and that e joins u
and v.
For example:
A graph G is defined by the sets
V(G) = {u, v, w, x, y, z} and E(G) = {uv, uw, wx, xy, xz}.

Representation
Because of the various methods to arrange the vertices' dots and draw the edge lines in the
plane, there are, of course, a large number of potential representations for a given graph. It's
crucial to locate a drawing for some applications that illustrates the graph's structure or some
of its attributes in relation to the application under consideration. Consider the following graph
representation, where, edge a is associated with the end vertices x and z. Edge b is also
associated x and z. Edge c is associated with x and y. Edge d is associated with z and y. Finally,
edge e is associated twice with the vertex y (this is the case for a loop).

3|Page
Atif Ishaq - Lecturer GC University, Lahore

Terminology
 When x and y are the end vertices of an edge e, we say that the vertices x and y are joined
by e, vertices x and y are adjacent or neighbors, edge e is incident to vertex x and to vertex
y.
 It is possible to have x=y; in such a case the edge is called a loop.
 Two edges e and e`, or more, may have the same end vertices x and y; they are said to be
parallel or that there is a multiple edge (double, triple, etc., depending on the number of
edges) joining x and y.
 A graph is said to be simple if it has no loops or multiple edges. In this case each edge is
identified by different set of end vertices.
 A non-simple graph G is sometimes associated with what is called the underlying simple
graph, defined as follows: it has the same set of vertices as G and two vertices are joined
by an edge if and only if they are different and joined by at least one edge in G.

References
1. Douglas B. West, “Introduction to Graph Theory” , Second Edition
2. Jean Claude Fourier, “Graph Theory and Applications with Exercises and Problems”.
3. C. Vasudev, “Graph Theory with Applications”
4. https://www.youtube.com/watch?v=_3nDuyh2zts

4|Page

You might also like