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

Graph Theory and Applications

This document discusses key concepts in graph theory including representations of graphs, isomorphism, subgraphs, Euler and Hamiltonian graphs, planar graphs, chromatic number, and spanning trees. It defines basic graph terminology such as vertices, edges, degree, regular graphs, complete graphs, and bipartite graphs. Theorems covered include the sum of degrees theorem and Havel-Hakimi result for graphical degree sequences. Examples are provided to illustrate graph theory concepts and properties.

Uploaded by

subramanyam62
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
413 views

Graph Theory and Applications

This document discusses key concepts in graph theory including representations of graphs, isomorphism, subgraphs, Euler and Hamiltonian graphs, planar graphs, chromatic number, and spanning trees. It defines basic graph terminology such as vertices, edges, degree, regular graphs, complete graphs, and bipartite graphs. Theorems covered include the sum of degrees theorem and Havel-Hakimi result for graphical degree sequences. Examples are provided to illustrate graph theory concepts and properties.

Uploaded by

subramanyam62
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 45

Graph Theory and Applications

 Basic concepts
 Representation of Graphs
 Isomorphism and Sub graphs
 Multi graphs and Euler Circuits
 Hamiltonian graphs
 Planar graphs
 Chromatic number
 Spanning trees
Basic concepts and notations.
 A Graph G is a pair of sets (V, E)
 where V = A set of vertices (nodes) and
 E = A set of edges (lines)
 V(G) = Set of vertices in G.
 E(G) = Set of edges in G.
 V(G)  = Number of vertices in graph G = Order of G.
 E(G)  = Number of edges in graph G = Size of G .

 a* *b

 c* *d
Types of graphs
 Non Directed Graph (Undirected graph): The elements of E are
unordered pairs (sets) of vertices. In this case an edge {u, v} is said to
join u and v or to be between u and v.
 Directed Graph: In a digraph the elements of E are ordered pairs of
vertices. In this case an edge (u, v) is said to be from u to v.
 Loop: An edge drawn from a vertex to itself.
 Multi Graph: If one allows more than one edge to join a pair of
vertices, the result is then called a multi graph.
 Simple Graph: A graph with no loops and no parallel edges.
 Degree: Degree of a vertex in an undirected graph 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).
Definitions

 In-degree and Out-degree: In a digraph, the number of edges


incident to a vertex is called the in-degree of the vertex and the
number of vertices incident from a vertex is called its out-degree.
 The in-degree of a vertex ‘v’ in a graph G is denoted by deg+(v) .
 The out-degree of a vertex v is denoted by deg -(G).
 A loop at a vertex in a digraph is counted as one edge for both
in-degree and out-degree of that vertex.
 Neighbors: If there is an edge incident from u to v, or incident on u
and v, then u and v are said to be adjacent ( neighbors).
 (G) = minimum of all the degrees of vertices in a graph G.
 (G) = Maximum of all the degrees of vertices in a graph G.
Regular graph
 Regular Graph: In a graph G, if (G) = (G) = k
i.e., if each vertex of G has degree k, then G is said to be a regular
graph of degree k (k-regular).
 Ex: Polygon is a 2-regular graph .
 Ex: A 3-regular graph is a cubic graph.
 Complete Graph: A simple non directed graph with ‘n’ mutually
adjacent vertices is called a complete graph on ‘n’ vertices and may
be represented by Kn.
 Note: A complete graph on ‘n’ vertices has [{n(n – 1)}/ 2]edges, and
each of its vertices has degree ‘n-1’.
 Every complete graph is a regular graph.
 The converse of the above statement need not be true.
More graphs

 Cycle Graph: A cycle graph of order ‘n’ is a connected graph whose


edges form a cycle of length n.
 Note: A cycle graph ‘Cn’ of order n has n vertices and n edges.
 Null Graph: A null graph of order n is a graph with n vertices and
no edges.
 Wheel Graph: A wheel graph of order ‘n’ is obtained by adding a
single new vertex (the hub) to each vertex of a cycle graph of order n.
 Note: A wheel graph Wn has ‘n +1’ vertices and 2n edges.
 Bipartite Graph: A Bipartite graph is a non directed graph whose
set of vertices can be partitioned in to two sets M and N in such a way
that each edge joins a vertex in M to a vertex in N.
More graphs.

 Complete Bipartite Graph: A complete Bipartite graph is a


Bipartite graph in which every vertex of M is adjacent to every
vertex of N.
 If M = m and N  = n then the complete Bipartite graph is denoted
by Km , n. It has ‘m n’ edges.
 The number of edges in a bipartite graph is  (n2/4).
 Degree Sequence: If v1, v2, ……, vn are the vertices of a graph G,
then the sequence{d1, d2,….., dn} where di = degree of vi is called
the degree sequence of G.
 Usually we order the degree sequence so that the degree sequence is
monotonically decreasing.
First theorem on graph theory
 Sum of Degrees Theorem: If V = {v1, v2, ….., vn} is the vertex set
of a non directed graph G then

n
  deg (vi) = 2.  E
i =1

 Proof: When the degrees are summed, each edge contributes a count
of one to the degree of each of the two vertices on which the edge is
incident.
 Hence, the theorem follows.
Corrollories

 Cor. 1 If G is a digraph, then

n n
  deg+(vi) =  deg –(vi) =  E
i=1 i=1

 Cor.2. An undirected graph has an even number of vertices of odd


degree. (See Text book for proof)
 Cor.3 If G is a k– regular graph , then k. V = 2.  E .

 Cor.4 In a non directed graph G, If k = (G) and m = (G) then


 k. V  2. E  m .V

Examples
 Ex. A non directed graph contains 16 edges and all vertices are of
degree 2. Find the number of vertices in G ?
 Solution: By Sum of degrees theorem, if degree of each vertex is k,
then
 k. V = 2. E
  2.  V = 2.(16)
   V = 16
Example

 Ex. A simple non directed graph G contains 21 edges, 3 vertices of


degree 4 and the other vertices are of degree 2. Find the number of
vertices in the graph G ?
 Solution: Let  V = n . By Sum of degrees theorem,
n
  deg (vi) = 2.  E
i=1

  3.(4) + (n – 3 ). 2 = 2.(21)
  n = 18.
Ex.What is the number of vertices in an undirected connected graph with
27 edges, 6 vertices of degree 2, 3 vertices of degree 4 and remaining
vertices of degree 3?

 Solution: Let  V = n . By Sum of degrees theorem,

  deg (vi) = 2.  E

  6.(2) + 3.(4) + (n – 9 ). 3 = 2.(27)


  n = 19.
Ex. If a simple non directed graph G contains 24 edges and all vertices are
of same degree then find the number of vertices in G?

 Solution: By Sum of degrees theorem, if degree of each vertex is k,


then
 k. V = 2. E
  k.  V = 2.(24)
   V = 48/k ( k = 1,2,3,4,6,8,…)
  V(G) = 48, 24, 16, …
Ex. What is the largest possible number of vertices in a graph G, with 35
edges and all vertices are of degree at least 3 ?.

 Solution: By Sum of degrees theorem, if degree of each vertex is  k,


then
 k. V  2. E
  3. V  2.(35)
   V  (70/3 = 23.33..)
   V  23
  The largest possible number of vertices = 23
Example

 Ex. Let G be a simple graph with n vertices. Then show that the
number of edges in G is less than or equal to {n.(n – 1)} / 2.

 Solution: In a simple graph, each edge correspond to a distinct pair of


vertices.
 The number of ways to choose a pair of vertices, out of n vertices =
 C(n , 2) = n. (n – 1 )
 2
 The maximum number of edges possible in G = {n.(n – 1)} / 2.
  The number of edges in G is less than or equal to {n.(n – 1)} / 2.
Ex. Which of the following degree sequences represent a simple non
directed graph
a) {2, 3, 3, 4, 4, 5} b) {2, 3, 4, 4, 5}
c) {1, 3, 3, 4, 5, 6, 6} d) {1, 3, 3, 3}

 Solution: a) Consider the degree sequence {2, 3, 3, 4, 4, 5}


 Here, we have 3 vertices with odd degree.
 But, By sum of degrees theorem, An undirected graph should contain
an even number of vertices of odd degree.
  The degree sequence cannot represent a simple non directed graph.

 b) Consider the degree sequence {2, 3, 4, 4, 5}


 Here, we have a vertex with degree 5.
 But, A simple non directed graph of order 5 cannot have a vertex
with degree 5.
  The degree sequence cannot represent a simple non directed graph.
Contd.,
 c) Consider the degree sequence {1, 3, 3, 4, 5, 6, 6}
Here, the order of the graph is 7 and we have 2 vertices with degree 6.
 Since these two vertices are adjacent to all other vertices of the graph,
a vertex with degree 1 does not exist
  The degree sequence cannot represent a simple non directed graph.

 d) Consider the degree sequence {1, 3, 3, 3 }


Here, the order of the graph is 4 and we have 3 vertices with degree 3.
 Since these 3 vertices are adjacent to all other vertices of the graph, a
vertex with degree 1 does not exist.
  The degree sequence cannot represent a simple non directed graph.
Ex. Show that a degree sequence with all distinct elements cannot
represent a simple non directed graph.

 Solution: Let G = {v1,v2,v3,…,vn}


 The possible degree sequences are {0,1,2,….,n –1} and {1,2,3,…,n}
 In a simple graph of order n, if there is a vertex with degree n – 1
then a vertex with degree 0 does not exist.
 A simple non directed graph of order ‘n’ cannot have a vertex with
degree n.
  The degree sequence with all distinct elements cannot represent a
simple non directed graph.
Havel Hakimi Result
 Havel Hakimi Result: Consider the following two sequences and
assume the sequence (i) is in descending order
 i) s, t1, t2, ……. ts, d1, d2, …….. dn
 ii) t1 – 1, t2 – 1, ……. , ts – 1, d1, d2, ……., dn
 then sequence (i) is graphic iff (ii) is graphic
 Ex. Apply Havel-Hakimi Result to find whether the following degree
sequences represent a simple non directed graph.
 S1 : {6, 6, 6, 6, 4, 3, 3, 0}
 S2 : {6, 5, 5, 4, 3, 3, 2, 2, 2}
 S2 : {1, 1, 3, 3, 3, 4, 6, 7}
Representation of Graphs
 Adjacency list: One way to represent a graph with no multiple edges
is to use adjacency lists, which specify the vertices that are adjacent to
each vertex of the graph.
 Ex.
Isomorphism
 Isomorphic Graphs: Two graphs G and G1 are isomorphic if there is
a function f : V(G)  V(G1) such that
 (i) f is a bijection and
 (ii) for each pair of vertices u and v of G,
 {u, v}  E(G)  {f(u), f(v)}  E(G)
 i.e.. the function preserves adjacency.
 Note: If G is isomorphic to G1 then
 a)  V(G) =  V(G1)
 b)  E(G) =  E(G1)
 c) The degree sequences of G and G1 are same.
 d) If {v, v} is a cycle in G, then {f(v), f(v)} is a loop in G1, and more
generally, if v0 – v1 – v2 – …. – vk – v0 is a cycle of length k in G,
then f(v0)– f(v1)– f(v2) – … – f(vk) – f(v0) is a cycle of length k in G1.
Isomorphism
 Suppose G and G1 are two graphs and that f : V(G)  V(G1) is a
bijection.
 Let A be the adjacency matrix for the vertex ordering v1, v2, ……,vn
of the vertices of G.
 Let A1 be the adjacency matrix for the vertex ordering
 f(v1), f(v2), ….. , f(vn) of the vertices of G1.
 Then f is an isomorphism from V(G) to V(G1) iff the adjacency
matrices A and A1 are equal.
 Note: If A  A1, then it may still be the case that graphs G and G1 are
isomorphic under some other function.
Isomorphism

 Complement of a graph: The complement of a graph G is the graph


G with the same vertices as G. An edge exists in G iff it does not exist
in G.
 Theorem: Two simple graphs are isomorphic iff their complements
are isomorphic.
 If two graphs are isomorphic, then their corresponding sub graphs are
isomorphic.
 Induced Subgraph: If W is a subset of V(G), then the sub graph
induced by W is the sub graph H of G obtained by taking V(H) = W
and E(H) to be those edges of G that join pairs of vertices in W.
 If G is isomorphic to G then G is said to be self
complementary.
Isomorphism
 Ex. If G is self complementary graph with n vertices, then show that
 G has {n(n – 1)}/4 edges.
 Ex. If G is self complementary then prove that G has 4k or 4k + 1
vertices where k is some positive integer.
 Ex. How many non isomorphic graphs are there of order 4 and size 2?
 Ex. How many non isomorphic graphs are there of order 8, size 8 and
degree sequence {2,2,2,2,2,2,2,2}.
 Ex. How many non isomorphic graphs are there of order 6, size 6 and
degree sequence {2, 2, 2, 2, 2, 2}.
 Ex. Let Cn be a cycle graph on n vertices. if Cn is isomorphic to Cn
then show that n = 5.

Euler Path and Circuit
 Euler Path: An Euler path in a multi graph is a path that includes
each edge of the multi graph exactly once and intersects each vertex
of the multi graph at least once.
 An Euler circuit is an Euler path whose end points are identical.
 A multi graph is traversable if it has Euler path.
 A non directed multi graph has an Euler path iff it is connected and
has zero or exactly two vertices of odd degree.
 Any finite connected graph with exactly two odd vertices is
traversable(Euler path exists). A traversable trail may begin at either
odd vertex and will end at other odd vertex.
 A connected multi graph has an Euler circuit if and only if all of its
vertices are of even degree.
Hamiltonian Graph
 Hamiltonian Graph: A Hamiltonian Graph is a graph with a closed
path that includes every vertex exactly once. Such a path is a cycle
and is called a Hamiltonian cycle.
 An Eulerian circuit uses every edge exactly once but may repeat
vertices , while a Hamiltonian cycle uses each vertex exactly once
(except for the first and last) but may skip edges.
Spanning Trees
 Tree: A connected graph with no cycles is called a tree.
 A tree with ‘n’ vertices has (n – 1) edges.
 A tree with n vertices (n>1) has at least two vertices of degree 1.
 A sub graph H of a graph G is called a spanning tree of G if
i) H is a tree and
ii) H contains all vertices of G
 Note: In general, if G is a connected graph with n vertices and m
edges, a spanning tree of G must have (n – 1) edges. Therefore, the
number of edges that must be removed before a spanning tee is
obtained must be m – (n – 1). This number is called circuit rank of G.
 A non directed graph G is connected iff G contains a spanning tree.
 The complete graph Kn has nn – 2 different spanning trees.
(Caley’s formula)
BFS
 Breadth first search : (Algorithm for finding a spanning tree of a
connected graph)
 The idea of BFS is to visit all vertices sequentially on a given level
before going to next level.
 Input: A connected graph G.
 Output: A spanning tree for G.
 Method: …..
 ( Refer Text book by Mott, Kandell and Baker)
DFS
 Depth first search : (Algorithm for finding a spanning tree of a
connected graph)
 The idea of DFS is proceeding to higher levels successively in the
first opportunity. Later we backtrack and add the vertices which are
not visited.
 Input: A connected graph G.
 Output: A spanning tree for G.
 Method: …..
 ( Refer Text book by Mott, Kandell and Baker)
Minimal Spanning Tree: Let G be a connected graph where each edge of
G is labeled with a non negative cost. A spanning tree T where the total
cost C(T) is minimum is called a minimal spanning tree.

 Kruskal’s Algorithm: (For finding minimal spanning tree of a


connected weighted graph)
 Input: A connected graph G with non negative values assigned to
each edge.
 Output: A minimal spanning tree for G.
 Method: 1) Select any edge of minimal value that is not a loop. This
is the first edge of T(if there is more than one edge of minimal value,
arbitrary choose one of these edges)
 2) Select any remaining edge of G of having minimal value that does
not form a circuit with the edges already included in T.
 3) Continue step 2 until T contain (n – 1) edges when n = |V(G)|
Prim’s algorithm.
 Prim’s Algorithm: (For finding a minimal spanning tree)
 1) Let G be a connected graph with non negative values assigned to
each edge. First let T be the tree consisting of any vertex V1 of G.
 2) Among all the edges not in T, that are incident on a vertex in T and
do not form a circuit when added to T, Select one of minimal cost and
add it to T.
 3) The process terminates after we have added (n – 1) edges
 where n = |V(G)|.

Planar Graphs
 A graph or a multi graph that can be drawn in a plane or on a sphere
so that its edges do not cross is called a planer graph.
 Ex : A complete graph on 4 vertices K4 is a planar graph.
 Ex : Tree is a planar graph.
 Map, Connected map : A particular planar representation of a finite
planer multi graph is called a map. We say that the map is connected
if the under lying multi graph is connected.
 Region : A given map (planar graph) divide the plane into connected
areas called regions
 Degree of a region : The boundary of each region of a map consists
of a sequence of edges forming a closed path. The degree of region ‘r’
denoted by deg (r) is the length of the closed path bordering r .
Sum of degrees of regions theorem
 If G is a planar graph with k regions, then the sum of the degrees of
the regions of
k
G is equal to twice the number of edges in G.
i.e.,  deg (ri) = 2. E .
i=1

 Cor.1 In a planar graph G, if the degree of each region is k then


k.R  = 2 .E
 Cor.2 In a planar graph G, if the degree of each region is  k , then
k.R   2 .E
 In particular, If G is a simple connected planar graph ( A planar
graph with no loops and no parallel edges, and degree of each region
is  3), then
3. R   2 . E 
Euler’s formula
 Question: State and prove Euler’s formula for planar graphs.
 Statement: If G is a connected planar graph, then
  V –  E + R  = 2.
 Proof: …..
 Theorem: If G is a simple connected planar graph with  E > 1 then,
(a)  E  {3. V – 6}.
(b) There exists at least one vertex v of G such that deg(v)  5
Proof: ……
 Theorem: If G is a simple connected planar graph with  v > 3 then,
 R  {2. V – 4}.
Proof:
Polyhedral graph
 Polyhedral Graph: A connected plane graph is said to be polyhedral
if degree of each region is  3 and deg(v)  3 for all v  G.
i.e., 3. R   2 . E  and 3. V   2 . E .

 For any polyhedral graph


 a) V   (2 + R  )
 2
 b) R   (2 + V  )
 2
 c) (3. R - 6)  E 
Kurtowski Theorem
 A graph G is not planar iff G contains a sub graph homeomorphic to
K3, 3 or K5 .

 Ex. A planar graph contains 25 vertices and 60 edges then find the
number of regions in the graph .
 Ex. What is the maximum number of edges possible in a planar graph
with eight vertices ?.
 Ex. What is the minimum number of vertices necessary for a graph
with 11 edges to be a simple planar graph?.
 Ex. Suppose that a connected planar graph has 20 vertices, each of
degree 3. In to how many regions does a representation of this planar
graph split the plane ?
Examples
 Ex. Let G is a connected planar graph with 35 regions and degree of
each region is 6. Find the number of vertices in G ?.
 Ex. Suppose G is a polyhedral graph with 12 vertices and 30 edges
prove that degree of each region is 3.
 Ex. Show that there does not exist a polyhedral graph with exactly
seven edges.
 Ex. Show that there does not exist a polyhedral graph with exactly 30
edges and 11 regions.
 Theorem: Prove that a complete graph Kn is planar iff n  4.
 Theorem: Prove that a complete Bipartite graph Km, n is planar
 iff m  2 or n  2.
Chromatic number
 Vertex coloring: A coloring of a simple graph is the assignment of
color to each vertex of the graph so that no two adjacent vertices are
assigned the same color.
 Chromatic Number: The minimum number of colors needed to
paint a graph G is called the chromatic number of G , denoted by
(G)
 Adjacent Regions: In a planar graph two regions are adjacent if they
share a common vertex.
 Map coloring: An assignment of colors to the regions of a map such
that adjacent regions have different colors.
 A map ‘M’ is n – colorable if there exists a coloring of M which uses
n colors.
 A planar graph is 5 – colorable
Four color Theorem
 Four color Theorem: If the regions of a planar graph are colored so
that adjacent regions have different colors, then no more than 4 colors
are required.
i.e., (G)  4.
 Ex. Prove that the chromatic number of a complete graph Kn is n.
 Ex. Prove that the chromatic number of a complete Bipartite graph
Km, n is 2.
 Ex. Prove that the chromatic number of cyclic graph Cn is 2 if n is
even and 3 if n is odd.
 Ex. If every cycle of G has even length then show that its chromatic
number is 2.
 Ex. Prove that the chromatic number of a tree on n vertices is 2.
 A covering g of a graph is minimal if g contains no paths of length
three or more.
 If a covering g contains no path of length three or more, all its
components must be star graphs. (From a star graph no edge can be
removed)
 13. The number of edges in the minimal covering of an n - vertex
graph is
a) n/2 b)  (n – 1) c) 2n d) n
 Vertex Covering : A covering of a graph G = (V, X) is a subset K of
V such that every line of G is incident with a vertex in K. A covering
K is called a minimum covering if G has no covering K1 with |K1| <
|K|
 * The number of vertices in a minimum covering of G is called the
covering number of G, denoted by .
 * A sub set S of V is called an independent set of G if no
two vertices of S are adjacent in G. An independent set
‘S’ is minimum if G has no independent set S1such that
|S1|  |S|.

 * The number of vertices in a maximum independent set


is called the independence number of G.

 * A set S  V is an independent set of G iff V – S is a


covering of G denoted by 
Connectivity
 Any circuit in a graph must contain a cycle and that any
circuit which is not a cycle contains atleast two cycles.
 Cut Set: Let G be a connected graph. A cut set in G is a
set of edges whose removal from G leaves the graph G
disconnected provided no proper subset of these edges
disconnects the graph G.
 Edge Connectivity: Let G be a connected graph. The
edge connectivity of G is the minimum number of edges
whose removal results in a disconnected graph. In other
words, the number of edges in the smallest cut set of G is
defined as the edge connectivity of G denoted by (G).
 If G is a connected graph and has a cut edge, then the
edge connectivity of G is 1.
 Vertex Connectivity: Let G be a connected graph. The
minimum number of vertices whose removal results in a
disconnected is called vertex connectivity of G and is
denoted by K(G).
 If G has a cut vertex then K(G) = 1
 If G is a complete graph Kn then K(G) = n – 1
 If Cn (n  4) is a cycle graph, then K(Cn) = 2
 If a graph G has a bridge then K(G) = 1
 The edge connectivity of a connected graph G cannot
exceed (G)
 For any connected graph G, K(G)  (G)  (G)
 If G is not connected then G is connected
 A simple graph with n vertices and k components can
have at most [(n – k) (n – k + 1)]/2 edges.
 A simple graph G with n vertices is connected if it has
more than [(n – 1) (n – 2)]/2 edges
 If a vertex v in a graph G has degree K then a Hamiltonian
path must contain atleast one edge incident on v and at
most two edges incident on v.
 A Hamiltonian cycle contains exactly two edges incident
on v. In particular, both edges incident on a vertex of
degree 2 will be contained in every Hamiltonian cycle.
Finally, there cannot be 3 or more edges incident with one
vertex in a Hamiltonian cycle.
 No cycle that does not contain all vertices of G can be
formed when building a Hamiltonian path on a
Hamiltonian cycle.
 Once Hamiltonian cycle we are building has passed
through a vertex v then all other unused edges incident on
v can be deleted because only 2 edges incident on v can be
included in a Hamiltonian cycle.

You might also like