chapters 3 ,4 ,5
chapters 3 ,4 ,5
GRAPH THEORY
INTRODUCTION
There are many concrete, practical problems that can be simplified and solved by looking at them from
a different point of view. The Konigsberg Bridge Problem, which we will soon describe, was a long-
standing problem until it was imaginatively solved in 1736 by the great Swiss mathematician
LUonhard Euler (1707-1783). Beginning his scientific career shortly after the death of Sir Isaac
Newton, Euler spent the last 17 years of his life blind, but still very active. Some of his mathematical
contributions were to the theory of convergent sequences and to the calculus of variations. Much of
what is taught today about quadratic equations, conic sections, and quadrics in Euclidean space is just
as Euler himself laid out. Perhaps less known is that Euler was a superb designer of algorithms; he had
the uncanny ability of making order out of chaos, of seeing simple routes through the most
complicated situations. It is because of his imaginative solution to the Konigsberg Bridge Problem that
Euler is generally considered to be the father of
modern-day graph theory. In the eighteenth century, Kinigsberg was the capital of East Prussia.' The
Pregel River flowed through town and split into two branches around Kneiphof island, which is labeled
A in Fig 9.1. Seven bridges crossed the river, providing links among the four land masses labeled A, B,
C, D in the figure. People wondered if it were possible to start on one of the land masses, walk over
each of the seven bridges exactly once, and return to the starting point (without getting wet).To find an
abstract mathematical model of a concrete problem can be a difficult task requiring both ingenuity and
experience. The primary aim of this chapter is to
provide the reader with some of this experience by presenting several real-world
Problems and showing how they can be formulated in mathematical terms. This process of translation
into mathematics forces us to sift through all the details of the problem, deciding which ones are
important and which are extraneous. (Those aspects of a "real" problem which make it interesting are
sometimes quite irrelevant and serve primarily to create confusion!) Because the language of
mathematics is precise and without ambiguity, problems which seem complicated when expressed in
ordinary language often have surprisingly straightforward mathematical translations.
For the Konigsberg Bridge Problem, Euler's idea was to realize that the physical layout of land, water,
and bridges could be modeled by the graph shown in the above figure. The land masses are represented
by small circles (or vertices) and the bridges by lines (or edges) which can be straight or curved. By
means of this graph, the physical problem is transformed into this mathematical one: Given the graph
in is it possible to choose a vertex, then to proceed along the edges one after the other and return to the
chosen vertex covering every edge exactly once? Euler was able to show that this was not possible.
Can you? The Three Houses-Three Utilities Problem is another physical situation which can be
modeled by means of a graph. There are three houses, each of which is to be connected to each of three
utilities-water, electricity, and telephone by means of underground pipes. Is it possible to make these
connections without any
Crossovers? Figure below shows how to describe this problem with a graph. The houses and the
utilities are represented by vertices and the pipes are the lines drawn between the vertices.
Terminology of Graph
Graphs
A graph G is a discrete structure consisting of nodes (called vertices) and lines joining the nodes
(called edges). Two vertices are adjacent to each other if they are joint by an edge. The edge joining
the two vertices is said to be an edge incident with them. We use V (G)and E(G) to
denote the set of vertices and edges of G respectively.
For any graph the vertex set V is always non-empty but the edge set E(G) can be empty { if 𝐸(𝐺) =
∅ then the graph G is called a null graph} and a vertex is isolated (An isolated vertex is a vertex whose
degree is 0) if it has no edges incident to it.
Example:
u and v are adjacent vertices; e is an edge incident with u and v. e can also be denoted by uv or vu.
Simple Graph:
A simple graph is a graph containing no loops and multiple edges.
Degrees of Vertices:
The degree of a vertex is the number of edges incident with it, except that a loop at a vertex
contributes twice to the degree of that vertex. The degree of the vertex v is denoted by deg(v) or d(v).
Example: find the degree of each of the ff graphs
d(u) = 5 , d(v) = 3
and d(w) = 2
Exercise:
Find the degree of every vertex of the following graph. When two lines cross, but there isn’t a dot, that
does not count as a vertex, so this graph has only 6 vertices.
Complete Graphs:
The complete graph on n vertices, denoted by 𝐾𝑛 is the simple graph in which any pair of vertices are
adjacent.
Example:
Subgraphs:
A sub-graph of a graph G is a graph H where V (H)⊆V (G) and E(H)⊆ E(G).
Example:
Complete graph: is simple graph in which every pair of its distinct vertices are adjacent. A complete
graph with n vertices is denoted as 𝐾𝑛 . The first four complete graphs are
given as examples:
Adjacency Matrices:
Definition: Given a graph G with vertex set 𝑉 = {𝑣1 , 𝑣2 , … 𝑣𝑛 } and edge set E, we define the
adjacency matrix of G as follows: Let G be an graph. Suppose 𝑣1 , 𝑣2 , … 𝑣𝑛 are the vertices of G. Then
the adjacent matrix with respect to this ordering of V (G) is the n× n matrix = [𝑚𝑖𝑗 ] , where
1 , when vi and v j are adjacent
mij
0 , otherwise
Example:
Note that an adjacency matrix of a graph is based on the ordering chosen for the vertices. Hence, there
are as many as n! different adjacency matrices for a graph with n vertices, because there are n!
different orderings of n vertices. The adjacency matrices of a simple graph is symmetric
because if vi is adjacent to vj , then vj is adjacent to vi and if vi is not adjacent to vj , then vj is not
adjacent to vi . Since a simple graph can not have a loop. For the following graph its adjacency matrix
given below.
A simple path: is a path in which no vertex is repeated (e2, e7, e6, e4)
A closed path: is a path in which the first and last vertices are the same (e2, e7, e6, e4, e1)
A graph is connected if every pair of vertices is joined by a path.
A circuit is a closed path in which no edges are repeated (e2, e7, e6, e4, e1).
A simple circuit is a circuit with no repeated vertices except for the first and the last (e2, e7, e6, e4,
e1).
Any path that traces the graph by going across each edge exactly once but each vertex atleast once and
starts and ends at the same vertex is called an Euler circuit.
Euler’s Theorem: A graph contains a Euler Circuit if:
1. Graph is Connected
2. Every vertex is of even degree
Euler showed that if there is any vertex of the graph that has odd degree, then the graph does not have
an Euler circuit. He also showed that if all of the vertices of the edges have an even degree, then the
graph does have an Euler circuit.
Does the graph showing the Koenigsburg bridges have an Euler circuit? Why or why not?
(ANS: It does NOT because it has vertices with odd degree.)
For each of the graphs shown below, decide if they have an Euler circuit. If they do, find an Euler
circuit. If it doesn’t have an Euler circuit, explain why not
Another problem that can be studied through graph theory is what is called the “traveling salesman
problem.” One example from that problem is shown below. It shows 4 cities that a sales representative
would visit, and the distances (in miles) between the cities. The problem is to find the best order for the
sales representative to visit the cities, and return to the starting point, so that the shortest distance
possible is travelled.
Write down some possibilities for paths the sales representative could take, starting in Denver. Which
one is the shortest? Write all of the possibilities that you tested in your math journal. Shortest is 444
miles, and the route is Denver→Limon→Lamar→Pueblo→Denver. (The reverse route is also
correct.)
Hamilton circuit
Definition : A Hamilton path in a graph is a path that visits each vertex exactly once. If such a path
is also a circuit, it is called a Hamilton circuit
Graph Coloring
Definition:
A coloring of a simple graph is the assignment of a color to each vertex so that no two adjacent
vertices have the same color.
A graph is K-colorable if each vertex can be assigned one of the K-colors so that adjacent vertices get
different colors.
The chromatic number of the graph G the list number of colors needed to color a graph.
Example: here are some graphs and the corresponding chromatic numbers
The original problem was stated to be:“the greatest number of colors to be used in coloring a map so
as to avoid identity of color in lineally contiguous districts is four.”
A scheduling problem:
Suppose you're organizing a mathematics conference. You have several people that are setting up
special sessions in their area of expertise. You're trying to find a way to schedule the sessions so that if
there are overlapping interests, you can make sure the sessions happen at di_erent times. To that end,
you've asked each session organizer to tell you what broad fields of mathematics their subject
concerns. You have the following list:
Probabilistic Combinatorics: of interest to Analysts, Combinatorialists, and Probabilists.
Algebraic Combinatorics: of interest to Algebraists and Combinatorialists
Enumerative Combinatorics: of interest to Combinatorialists and Representation Theorists
Ramsey Theory: of interest to Combinatorialists and Probabilists
Markov Chains: of interest to Probabilists
Brownian Motion: of interest to Probabilists and Analysts
Operator Theory: of interest to Analysts
You'd like to schedule the shortest conference possible, so that you don't have to pay for the rooms for
too long. What is the fewest number of sessions you could run to accommodate every session, where
no two topics run at the same time if they have overlapping interests?
In graph theory, the shortest path problem is the problem of finding a path between two vertices (or
nodes) such that the sum of the weights of its constituent edges is minimized. An example is finding
the quickest way to get from one location to another on a road map; in this case, the vertices represent
locations and the edges represent segments of road and are weighted by the time needed to travel that
segment.
Formally, given a weighted graph (that is, a set V of vertices, a set E of edges, and areal-valued weight
function f : E → R), and one element v of V, find a path P from v to a v' of V so that is minimal among
all paths connecting v to v' .
TREES
Definition:
A tree is a connected undirected graph with no simple circuits. Since a tree cannot have a circuit, a
tree cannot contain multiple edges or loops. Therefore, any tree must be a simple graph.
Theorem: An undirected graph is a tree if and only if there is a unique simple path between any two
of its vertices. In general, we use trees to represent hierarchical structures.
Note: An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices.
In general, we use trees to represent hierarchical structures.
Definition:
A rooted tree is a tree in which one vertex has been designated as the root and every edge is directed
away from the root.
Definition:
If v is a vertex in a rooted tree other than the root, the parent of v is the unique vertex u such that
there is a directed edge from u to v.
− When u is the parent of v, v is called the child of u.
− Vertices with the same parent are called siblings.
− The ancestors of a vertex other than the root are the vertices in the path from the root to this vertex,
excluding the vertex itself and including the root.
The descendants of a vertex v are those vertices that have v as an ancestor.
− A vertex of a tree is called a leaf if it has no children.
− Vertices that have children are called internal vertices.
− If a is a vertex in a tree, then the sub-tree with a as its root is the sub-graph of the tree consisting of a
and its descendants and all edges incident to these descendants.
The level of a vertex v in a rooted tree is the length of the unique path from the root to this vertex.
− The level of the root is defined to be zero.
− The height of a rooted tree is the maximum of the levels of vertices.
A root tree is called an 𝑚 − 𝑎𝑟𝑦 tree if every internal vertex has no more than m children. The tree is
called a full 𝑚 − 𝑎𝑟𝑦 tree if every internal vertex has exactly m children. A full m-ary tree with
𝑚 = 2 is called a binary tree.
Binary Search tree is a binary tree which satisfies the following property −
So, the value of all the vertices of the left sub-tree of an internal node V are less than or equal to V and the value
of all the vertices of the right sub-tree of the internal node V are greater than or equal to V
Spanning Trees
A spanning tree of a simple graph G is a sub-graph that is a tree and contains every vertex.
A simple graph is connected if and only if it has a spanning tree.