Chapter 1
Graph Theory
 Basic Concepts of Graph Theory
 Paths, Cycles and Trails
 Directed Graphs
 Matrix and Trees
1
Basic Concept of Graph Theory
 A vertex : an object
 An edge : a relation between two objects
2
common
member
Committee 1 Committee
2
Basic Concept of Graph Theory
 A vertex : a region
 An edge : a path(bridge) between two
regions
3
e1
e2
e3
e4
e6
e5
e7
Z
Y
X
W
X
Y
Z
W
What Is a Graph?
 A graph G is a triple consisting of:
◦ A vertex set V(G )
◦ An edge set E(G )
◦ A relation between an edge and a pair of
vertices.
4
e1
e2
e3
e4
e6
e5
e7
Z
Y
X
W
5
 Order of a graph : The number of vertices in G is
called the order of a graph G. It is denoted by
 Size of a graph : The number of edges in G is
called the size of a graph G . It is denoted by
Loop, Multiple edges
 Loop : An edge whose endpoints are equal
is known as loop.
 Parallel edges : Edges have the same pair of
endpoints is known as parallel edges.
6
loop
Multiple
edges
7
Simple Graph
 Simple graph : A graph has no loops or
multiple edges is known as simple graph.
loop
Multiple
edges
It is not simple. It is a simple
graph.
Degree
 The degree of vertex v in a graph G,
denoted as d (v ), is the number of
edges incident to v, except that each
loop at v counts twice.
 The maximal degree is (G )
 The minimum degree is  (G )
8
A
C
B
D
F
E
d(B) = 3, d(C) =
2
Δ(G) = 3, δ(G) =
2
G
Isolated & Pendent Vertex
 An isolated vertex is a vertex of degree 0.
 An Pendent vertex is a vertex of degree 1.
 Here P is a isolated vertex and r,q,w,z,x are
pendent vertex.
9
r
q
s u v w
t p x
y z
Adjacent
 Two vertices are adjacent if they are the
endpoints of an edge.
 Example:
◦ A and B are adjacent
◦ A and D are not adjacent
10
A B
C D
Regular Graph
 G is regular if (G ) =  (G ).
 G is k-regular if the common degree is k.
11
3-regular
Complete Graph
 Complete Graph : A complete graph is a simple
graph in which every pair of vertices are
adjacent (there is an edge between them). And
it is denoted by Kn.
12
Complete Graph
Finite Graph, Null Graph
 Finite graph : an graph whose vertex set
and edge set are finite.
 Null graph : the graph whose edges are
empty.
V1 V2
13
Walks, Trails
 A walk : a list of vertices and edges v0, e1,
v1, …., ek, vk such that, for 1  i  k, ei is
the edge with end vertices vi-1 and vi .
 A trail : a walk with no repeated edge.
 A walk or trail is open if its endpoints are
the different.
 A walk or trail is closed if its endpoints
are the same.
14
Path and Cycle
 Path : a open walk without repetition of
vertices.
◦ Example: (a, d, c, b, e) is a path
◦ (a, b, e, d, c, b, e, d) is not a path; it is a walk
◦ (a,b,c,d,e,b) is a trail.
 Cycle : A cycle is a closed Path or A path
whose end vertices are equal.
◦ Example: (a, d, c, b, e, a) is a cycle
15
a b
c
de
Unicycle
 Unicycle Graph: A graph G with exactly
one cycle is called a unicyclic graph.
 The length of a walk, trail, path, or cycle
is its number of edges.
16
Connected and Disconnected
 Connected : A graph G is connected if there is a
path between every pair of vertices in V.
 Disconnected : A graph which is not connected is
called a disconnected graph.
 Example:
◦ H1 and H2 are connected
◦ H3 is disconnected.
17
c
d
a b
de
a b
c
d
eH1
H3H2
Subgraphs
 A subgraph of a graph G is a graph H such
that:
◦ V(H)  V(G) and E(H)  E(G) and
◦ The assignment of endpoints to edges in H is the
same as in G.
18
Subgraphs
 Example: H1, H2, and H3 are subgraphs of
G
19
c
d
a b
de
a b
c
de
H1
G
H3
H2
a b
c
de
Induced subgraph
 More Examples:
◦ G2 is the subgraph of G1 induced by (A, B,
C, D)
◦ G3 is the subgraph of G1 induced by (B, C)
◦ G4 is not the subgraph of G1 induced by
(A, B, C, D)
20
BA
C D
E
BA
C D
B
C
BA
C D
G1 G2 G3 G4
Components
 A disconnected graph can have atleast two
connected subgraphs. These connected
subgraphs are called components of a graph
G.
 A component (or graph) is trivial if it has no
edges; otherwise it is nontrivial
21
r
q
s u v w
t p x
y z
Tree
 Tree : A connected acyclic (no cycle)
graph is called a tree.
 A single vertex is a tree
 A single edge is a tree
22
BA
C D
E
T
Spanning Tree
 Spanning tree : A tree T is said to be a
spanning tree if a connected graph G if
it is a subgraph of G and it contains all
the vertices of the graph G.
BA
C D
E
G
BA
C D
E
T
Binary Tree
 Binary tree : A binary tree is defined
as tree in which there is exactly one
vertex of degree 2 and each of the
remaining vertices are of degree 1 or
3.
Adjacency matrix
 Let G = (V, E), |V| = n and |E|=m without
parallel edges then the adjacency matrix
of G written A(G), is the n-by-n matrix in
which entry ai,j is 1 if vi and vj are
adjacent otherwise 0.
25
a
b
c
e
w
x
y z
w x y z
0 1 1 0
1 0 1 0
1 1 0 1
0 0 1 0
w
x
y
z
Incidence Matrix
 Let G = (V, E), |V| = n and |E|=m without
loop then the incidence matrix M(G) is the
n-by-m matrix in which entry mi,j is 1 if vi is
an endpoint of ei and otherwise is 0.
26
a
b
c
d
e
w
x
y
z
a b c d e
1 1 0 0 0
1 0 1 1 0
0 1 1 1 1
0 0 0 0 1
w
x
y
z
Path Matrix
 Let G = (V, E), |V| = n and |E|=m then the path
matrix P(x,y) is the n-by-m matrix in which entry
pi,j is 1 if ith edge lies in ith path and otherwise is 0.
 Consider all paths between w & z is {b,e}, {a,c,e},
{a,d,e}
27
a
b
c
d
e
w
x
y
z
a b c d e
0 1 0 0 1
1 0 1 0 1
1 0 0 1 1
1
2
3
Directed Graph and Its edges
 A directed graph or digraph G is a triple:
◦ A vertex set V(G),
◦ An edge set E(G), and
◦ A function assigning each edge an ordered pair of
vertices.
 The first vertex of the ordered pair is the tail or
initial vertex of the edge
 The second is the head or end vertex
 Together, they are the endpoints.
 An edge is said to be from its tail to its head.
◦ The terms “head” and “tail” come from the arrows
used to draw digraphs.
28
Directed Graph and its edges
 As with graphs, we
◦ assign each vertex a point in the plane and
◦ each edge a curve joining its endpoints.
 When drawing a digraph, we give the curve a direction
from the tail to the head.
29
Undirected graph & Mixed
graph
 A graph whose edges with no direction in
graph is said to be undirected graph.
 A graph having some edges is directed
and some edge is undirected then this
graph is called mixed graph.
Loop and parallel edges in directed
graph
Let G be a graph
 Two edges e=(a,b) and f=(c,d) are said to be parallel
edges if a=c and b=d. i.e. initial vertices of e and f are
same as well as end vertices of e and f are also same.
 An edge whose endpoints are equal is known as loop.
31
Loop
Parallel
edges
 Let v be a vertex then the out degree of v is
defined as the total number of edges for which v is
the initial vertex(out-going edges) and it is denoted
by .
 Let v be a vertex then the in degree of v is defined
as the total number of edges for which v is the end
vertex(in-comming edges) and it is denoted by .
 It is clear that + = .
32
Degree in directed graph
Balance & Regular Digraph
 Let G be a digraph we say that G is
balance digraph if = for all v in
the vertex set V.
 Let G be a digraph we say that G is k-
regular graph if = = k for all v in
the vertex set V then G.
Underlying graph
 The underlying graph of a digraph D:
◦ the graph G obtained by treating the edges of D as
unordered pairs;
◦ the vertex set and edges set remain the same, and
the endpoints of an edge are the same in G as in D,
34
The underlying GraphA digraph
Walks, Trails, Paths & Cycles in
Digraph
 Let G be a digraph. Then a semi-walk is a
walk in the underlying graph of G.
 Let G be a digraph. Then a semi-trail is a
trail in the underlying graph of G.
 Let G be a digraph. Then a semi-path is
a path in the underlying graph of G.
 Let G be a digraph. Then a semi-cycle is
a cycle in the underlying graph of G.
35
 Let G be a digraph. A directed walk is an
alternating sequence of vertices and directed
edges say v1, e1, v2, …., en-1, vn in G such
that ei is a directed edge with vi as initial
vertex & vi+1 as terminal vertex.
 A directed trail is a directed walk with no
repeatation of edges.
 A directed path is an open directed walk
without repeatation of vertices.
 A directed cycle is a closed directed Path
or A directed path whose end vertices are
equal.
36
Walks, Trails, Paths & Cycles in
Digraph
Adjacency matrix in directed
graph
 Let G = (V, E) be a directed graph with |V|
= n and |E|=m without parallel edges then
the adjacency matrix of G written A(G), is
the
n-by-n matrix in which entry ai,j is 1 if there
is a directed edge from vi to vj otherwise 0.
37
Incidence Matrix in directed
graph
 Let G = (V, E) be a digraph with |V| = n and
|E|=m without loop then the incidence matrix
M(G) is the n-by-m matrix in which entry mi,j
is +1 if vi is initial vertex for ej and is -1 if vi is
terminal vertex for ej and is 0 if ej is not
incident on vi
38
Example of adjacency matrix &
incidence matrix
 Here A(G) is adjacency matrix and M(G) is incidence
matrix.
39












0000
1010
0101
0100
















10000
11110
01101
00011
w x y z
w
x
y
z
w
x
y
z
a b c d e
)(GA G )(GM
a
b
ec
d
w
x
y z
Path Matrix in directed graph
 Let G = (V, E) be a directed graph, |V| = n and
|E|=m then the path matrix P(x,y) is the n-by-m
matrix in which entry pi,j is 1 if ith edge lies in ith
directed path and otherwise is 0.
40
Weakly and strongly connected digraphs
 A graph is weakly connected if its
underlying graph is connected.
 A digraph is strongly connected or strong
if for each ordered pair u,v of vertices,
there is a path from u to v.
41

Chapter 1

  • 1.
    Chapter 1 Graph Theory Basic Concepts of Graph Theory  Paths, Cycles and Trails  Directed Graphs  Matrix and Trees 1
  • 2.
    Basic Concept ofGraph Theory  A vertex : an object  An edge : a relation between two objects 2 common member Committee 1 Committee 2
  • 3.
    Basic Concept ofGraph Theory  A vertex : a region  An edge : a path(bridge) between two regions 3 e1 e2 e3 e4 e6 e5 e7 Z Y X W X Y Z W
  • 4.
    What Is aGraph?  A graph G is a triple consisting of: ◦ A vertex set V(G ) ◦ An edge set E(G ) ◦ A relation between an edge and a pair of vertices. 4 e1 e2 e3 e4 e6 e5 e7 Z Y X W
  • 5.
    5  Order ofa graph : The number of vertices in G is called the order of a graph G. It is denoted by  Size of a graph : The number of edges in G is called the size of a graph G . It is denoted by
  • 6.
    Loop, Multiple edges Loop : An edge whose endpoints are equal is known as loop.  Parallel edges : Edges have the same pair of endpoints is known as parallel edges. 6 loop Multiple edges
  • 7.
    7 Simple Graph  Simplegraph : A graph has no loops or multiple edges is known as simple graph. loop Multiple edges It is not simple. It is a simple graph.
  • 8.
    Degree  The degreeof vertex v in a graph G, denoted as d (v ), is the number of edges incident to v, except that each loop at v counts twice.  The maximal degree is (G )  The minimum degree is  (G ) 8 A C B D F E d(B) = 3, d(C) = 2 Δ(G) = 3, δ(G) = 2 G
  • 9.
    Isolated & PendentVertex  An isolated vertex is a vertex of degree 0.  An Pendent vertex is a vertex of degree 1.  Here P is a isolated vertex and r,q,w,z,x are pendent vertex. 9 r q s u v w t p x y z
  • 10.
    Adjacent  Two verticesare adjacent if they are the endpoints of an edge.  Example: ◦ A and B are adjacent ◦ A and D are not adjacent 10 A B C D
  • 11.
    Regular Graph  Gis regular if (G ) =  (G ).  G is k-regular if the common degree is k. 11 3-regular
  • 12.
    Complete Graph  CompleteGraph : A complete graph is a simple graph in which every pair of vertices are adjacent (there is an edge between them). And it is denoted by Kn. 12 Complete Graph
  • 13.
    Finite Graph, NullGraph  Finite graph : an graph whose vertex set and edge set are finite.  Null graph : the graph whose edges are empty. V1 V2 13
  • 14.
    Walks, Trails  Awalk : a list of vertices and edges v0, e1, v1, …., ek, vk such that, for 1  i  k, ei is the edge with end vertices vi-1 and vi .  A trail : a walk with no repeated edge.  A walk or trail is open if its endpoints are the different.  A walk or trail is closed if its endpoints are the same. 14
  • 15.
    Path and Cycle Path : a open walk without repetition of vertices. ◦ Example: (a, d, c, b, e) is a path ◦ (a, b, e, d, c, b, e, d) is not a path; it is a walk ◦ (a,b,c,d,e,b) is a trail.  Cycle : A cycle is a closed Path or A path whose end vertices are equal. ◦ Example: (a, d, c, b, e, a) is a cycle 15 a b c de
  • 16.
    Unicycle  Unicycle Graph:A graph G with exactly one cycle is called a unicyclic graph.  The length of a walk, trail, path, or cycle is its number of edges. 16
  • 17.
    Connected and Disconnected Connected : A graph G is connected if there is a path between every pair of vertices in V.  Disconnected : A graph which is not connected is called a disconnected graph.  Example: ◦ H1 and H2 are connected ◦ H3 is disconnected. 17 c d a b de a b c d eH1 H3H2
  • 18.
    Subgraphs  A subgraphof a graph G is a graph H such that: ◦ V(H)  V(G) and E(H)  E(G) and ◦ The assignment of endpoints to edges in H is the same as in G. 18
  • 19.
    Subgraphs  Example: H1,H2, and H3 are subgraphs of G 19 c d a b de a b c de H1 G H3 H2 a b c de
  • 20.
    Induced subgraph  MoreExamples: ◦ G2 is the subgraph of G1 induced by (A, B, C, D) ◦ G3 is the subgraph of G1 induced by (B, C) ◦ G4 is not the subgraph of G1 induced by (A, B, C, D) 20 BA C D E BA C D B C BA C D G1 G2 G3 G4
  • 21.
    Components  A disconnectedgraph can have atleast two connected subgraphs. These connected subgraphs are called components of a graph G.  A component (or graph) is trivial if it has no edges; otherwise it is nontrivial 21 r q s u v w t p x y z
  • 22.
    Tree  Tree :A connected acyclic (no cycle) graph is called a tree.  A single vertex is a tree  A single edge is a tree 22 BA C D E T
  • 23.
    Spanning Tree  Spanningtree : A tree T is said to be a spanning tree if a connected graph G if it is a subgraph of G and it contains all the vertices of the graph G. BA C D E G BA C D E T
  • 24.
    Binary Tree  Binarytree : A binary tree is defined as tree in which there is exactly one vertex of degree 2 and each of the remaining vertices are of degree 1 or 3.
  • 25.
    Adjacency matrix  LetG = (V, E), |V| = n and |E|=m without parallel edges then the adjacency matrix of G written A(G), is the n-by-n matrix in which entry ai,j is 1 if vi and vj are adjacent otherwise 0. 25 a b c e w x y z w x y z 0 1 1 0 1 0 1 0 1 1 0 1 0 0 1 0 w x y z
  • 26.
    Incidence Matrix  LetG = (V, E), |V| = n and |E|=m without loop then the incidence matrix M(G) is the n-by-m matrix in which entry mi,j is 1 if vi is an endpoint of ei and otherwise is 0. 26 a b c d e w x y z a b c d e 1 1 0 0 0 1 0 1 1 0 0 1 1 1 1 0 0 0 0 1 w x y z
  • 27.
    Path Matrix  LetG = (V, E), |V| = n and |E|=m then the path matrix P(x,y) is the n-by-m matrix in which entry pi,j is 1 if ith edge lies in ith path and otherwise is 0.  Consider all paths between w & z is {b,e}, {a,c,e}, {a,d,e} 27 a b c d e w x y z a b c d e 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 2 3
  • 28.
    Directed Graph andIts edges  A directed graph or digraph G is a triple: ◦ A vertex set V(G), ◦ An edge set E(G), and ◦ A function assigning each edge an ordered pair of vertices.  The first vertex of the ordered pair is the tail or initial vertex of the edge  The second is the head or end vertex  Together, they are the endpoints.  An edge is said to be from its tail to its head. ◦ The terms “head” and “tail” come from the arrows used to draw digraphs. 28
  • 29.
    Directed Graph andits edges  As with graphs, we ◦ assign each vertex a point in the plane and ◦ each edge a curve joining its endpoints.  When drawing a digraph, we give the curve a direction from the tail to the head. 29
  • 30.
    Undirected graph &Mixed graph  A graph whose edges with no direction in graph is said to be undirected graph.  A graph having some edges is directed and some edge is undirected then this graph is called mixed graph.
  • 31.
    Loop and paralleledges in directed graph Let G be a graph  Two edges e=(a,b) and f=(c,d) are said to be parallel edges if a=c and b=d. i.e. initial vertices of e and f are same as well as end vertices of e and f are also same.  An edge whose endpoints are equal is known as loop. 31 Loop Parallel edges
  • 32.
     Let vbe a vertex then the out degree of v is defined as the total number of edges for which v is the initial vertex(out-going edges) and it is denoted by .  Let v be a vertex then the in degree of v is defined as the total number of edges for which v is the end vertex(in-comming edges) and it is denoted by .  It is clear that + = . 32 Degree in directed graph
  • 33.
    Balance & RegularDigraph  Let G be a digraph we say that G is balance digraph if = for all v in the vertex set V.  Let G be a digraph we say that G is k- regular graph if = = k for all v in the vertex set V then G.
  • 34.
    Underlying graph  Theunderlying graph of a digraph D: ◦ the graph G obtained by treating the edges of D as unordered pairs; ◦ the vertex set and edges set remain the same, and the endpoints of an edge are the same in G as in D, 34 The underlying GraphA digraph
  • 35.
    Walks, Trails, Paths& Cycles in Digraph  Let G be a digraph. Then a semi-walk is a walk in the underlying graph of G.  Let G be a digraph. Then a semi-trail is a trail in the underlying graph of G.  Let G be a digraph. Then a semi-path is a path in the underlying graph of G.  Let G be a digraph. Then a semi-cycle is a cycle in the underlying graph of G. 35
  • 36.
     Let Gbe a digraph. A directed walk is an alternating sequence of vertices and directed edges say v1, e1, v2, …., en-1, vn in G such that ei is a directed edge with vi as initial vertex & vi+1 as terminal vertex.  A directed trail is a directed walk with no repeatation of edges.  A directed path is an open directed walk without repeatation of vertices.  A directed cycle is a closed directed Path or A directed path whose end vertices are equal. 36 Walks, Trails, Paths & Cycles in Digraph
  • 37.
    Adjacency matrix indirected graph  Let G = (V, E) be a directed graph with |V| = n and |E|=m without parallel edges then the adjacency matrix of G written A(G), is the n-by-n matrix in which entry ai,j is 1 if there is a directed edge from vi to vj otherwise 0. 37
  • 38.
    Incidence Matrix indirected graph  Let G = (V, E) be a digraph with |V| = n and |E|=m without loop then the incidence matrix M(G) is the n-by-m matrix in which entry mi,j is +1 if vi is initial vertex for ej and is -1 if vi is terminal vertex for ej and is 0 if ej is not incident on vi 38
  • 39.
    Example of adjacencymatrix & incidence matrix  Here A(G) is adjacency matrix and M(G) is incidence matrix. 39             0000 1010 0101 0100                 10000 11110 01101 00011 w x y z w x y z w x y z a b c d e )(GA G )(GM a b ec d w x y z
  • 40.
    Path Matrix indirected graph  Let G = (V, E) be a directed graph, |V| = n and |E|=m then the path matrix P(x,y) is the n-by-m matrix in which entry pi,j is 1 if ith edge lies in ith directed path and otherwise is 0. 40
  • 41.
    Weakly and stronglyconnected digraphs  A graph is weakly connected if its underlying graph is connected.  A digraph is strongly connected or strong if for each ordered pair u,v of vertices, there is a path from u to v. 41