SlideShare une entreprise Scribd logo
1  sur  15
Chapter 2
Subgraphs, Paths, and Connected Graphs
2.1 Subgraphs and Spanning Subgraphs (Supergraphs)
Subgraph: Let H be a graph with vertex set V(H) and edge set E(H), and similarly
let G be a graph with vertex set V(G) and edge set E(G). Then, we say that H is a
subgraph of G if V(H) ( V(G) and E(H) ( E(G). In such a case, we also say that
G is a supergraph of H.
In Fig. 2.1, G1 is a subgraph of both G2 and G3 but G3 is not a subgraph of G2.
Any graph isomorphic to a subgraph of G is also referred to as a subgraph of G.
If H is a subgraph of G then we write H ( G. When H ( G but H = G, i.e.,
V(H) = V(G) or E(H) = E(G), then H is called a proper subgraph of G.
Spanning subgraph (or Spanning supergraph): A spanning subgraph (or
spanning supergraph) of G is a subgraph (or supergraph) H with V(H) = V(G),
i.e. H and G have exactly the same vertex set.
It follows easily from the definitions that any simple graph on n vertices is a
subgraph of the complete graph Kn. In Fig. 2.1, G1 is a proper spanning subgraph
of G3.
Fig. 2.1 G1 is a subgraph of G2 and G3
S. Saha Ray, Graph Theory with Algorithms and its Applications,
DOI: 10.1007/978-81-322-0750-4_2, Ó Springer India 2013
11
2.2 Operations on Graphs
The union of two graphs G1 ¼ V1; E1ð Þ and G2 ¼ V2; E2ð Þ is another graph G3 ¼
V3; E3ð Þ denoted by G3 ¼ G1 [ G2, where vertex set V3 ¼ V1 [ V2 and the edge
set E3 ¼ E1 [ E2:
The intersection of two graphs G1 and G2 denoted by G1  G2 is a graph G4
consisting only of those vertices and edges that are in both G1 and G2.
The ring sum of two graphs G1 and G2, denoted by G1 È G2; is a graph
consisting of the vertex set V1 [ V2 and of edges that are either in G1 or G2; but
not in both.
Figure 2.2 shows union, intersection, and ring sum on two graphs G1 and G2:
Three operations are commutative, i.e.,
G1 [ G2 ¼ G2 [ G1; G1  G2 ¼ G2  G1; G1 È G2 ¼ G2 È G1
If G1 and G2 are edge disjoint, then G1  G2 is a null graph, and G1 È G2 ¼
G1 [ G2: If G1 and G2 are vertex disjoint, then G1  G2 is empty.
For any graph G, G  G ¼ G [ G ¼ G and G È G = a null graph.
If g is a subgraph of G, i.e., g ( G, then G È g = G - g, and is called a
complement of g in G.
Fig. 2.2 Union, intersection, and ring sum of two graphs
12 2 Subgraphs, Paths and Connected Graphs
Decomposition: A graph G is said to be decomposed into two subgraphs G1 and
G2, if G1 [ G2 ¼ G and G1  G2 is a null graph.
Deletion: If vi is a vertex in graph G, then G À vi denotes a subgraph of
G obtained by deleting vi from G. Deletion of a vertex always implies the deletion
of all edges incident on that vertex. If ej is an edge in G, then G À ej is a subgraph
of G obtained by deleting ej from G. Deletion of an edge does not imply deletion
of its end vertices. Therefore, G À ej ¼ G È ej (Fig. 2.3).
Fusion: A pair of vertices a, b in a graph G are said to be fused if the two vertices
are replaced by a single new vertex such that every edge, that was incident on either
a or b or on both, is incident on the new vertex. Thus, fusion of two vertices does not
alter the number of edges, but reduces the number of vertices by one (Fig. 2.4).
Induced subgraph: A subgraph H  G is an induced subgraph, if EH ¼
EG  E VHð Þ: In this case, H is induced by its set VH of vertices. In an induced
subgraph H  G; the set EH of edges consists of all e 2 EG, such that e 2 E VHð Þ:
To each nonempty subset A  VG; there corresponds a unique induced subgraph
G½AŠ ¼ A; EG  E Að Þð Þ (Fig. 2.5).
Fig. 2.3 Vertex deletion and edge deletion from a graph G
Fig. 2.4 Fusion of two vertices a and b
2.2 Operations on Graphs 13
Trivial graph: A graph G ¼ V; Eð Þ is trivial, if it has only one vertex. Otherwise
G is nontrivial.
Discrete graph: A graph is called discrete graph if EG ¼ /.
Stable: A subset X  VG is stable, if G[X] is a discrete graph.
2.3 Walks, Trails, and Paths
Walk: A walk in a graph G is a finite sequence
W  v0e1v1e2 Á Á Á vkÀ1ekvk
whose terms are alternately vertices and edges such that for 1 i k; the edge ei
has ends viÀ1 and vi.
Thus, each edge ei is immediately preceded and succeeded by the two vertices
with which it is incident. We say that W is a v0 À vk walk or a walk from v0 to vk:
Origin and terminus: The vertex v0 is the origin of the walk W, while vk is
called the terminus of W. v0 and vk need not be distinct.
The vertices v1; v2; . . .; vkÀ1 in the above walk W are called its internal vertices.
The integer k, the number of edges in the walk, is called the length of W, denoted
by Wj j.
In a walk W, there may be repetition of vertices and edges.
Trivial walk: A trivial walk is one containing no edge. Thus for any vertex v of
G, W : v gives a trivial walk. It has length 0.
Fig. 2.5 Spanning subgraph and induced subgraph of a graph G
14 2 Subgraphs, Paths and Connected Graphs
In Fig. 2.6, W1  v1e1v2e5v3e10v3e5v2e3v5 and W2  v1e1v2e1v1e1v2 are both
walks of length 5 and 3, respectively, from v1 to v5 and from v1 to v2 , respectively.
Given two vertices u and v of a graph G, a u–v walk is called closed or open,
depending on whether u = v or u = v.
Two walks W1 and W2 above are both open, while W3  v1v5v2v4v3v1 is closed
in Fig. 2.6.
Trail: If the edges e1; e2; . . .; ek of the walk W  v0e1v1e2v2 Á Á Á Á Á Á ekvk are
distinct then W is called a trail. In other words, a trail is a walk in which no edge is
repeated. W1 and W2 are not trails, since for example e5 is repeated in W1, while e1
is repeated in W2. However, W3 is a trail.
Path: If the vertices v0; v1; . . .; vk of the walk W  v0e1v1e2v2 Á Á Á ekvk are dis-
tinct then W is called a path. Clearly, any two paths with the same number of
vertices are isomorphic.
A path with n vertices will sometimes be denoted by Pn.
Note that Pn has length n - 1.
In other words, a path is a walk in which no vertex is repeated. Thus, in a path
no edge can be repeated either, so a every path is a trail. Not every trail is a path,
though. For example, W3 is not a path since v1 is repeated. However, W4 
v2v4v3v5v1 is a path in the graph G as shown in Fig. 2.6.
2.4 Connected Graphs, Disconnected Graphs,
and Components
Connected vertices: A vertex u is said to be connected to a vertex v in a graph G if
there is a path in G from u to v.
Connected graph: A graph G is called connected if every two of its vertices are
connected.
Disconnected graph: A graph that is not connected is called disconnected.
Fig. 2.6 A graph with five vertices and ten edges
2.3 Walks, Trails, and Paths 15
It is easy to see that a disconnected graph consists of two or more connected
graphs. Each of these connected subgraphs is called a component. Figure 2.7
shows a disconnected graph with two components.
Theorem 2.1 A graph G is disconnected iff its vertex set V can be partitioned into
two non-empty, disjoint subsets V1 and V2 such that there exists no edge in G
whose one end vertex is in subset V1 and the other in subset V2.
Proof Suppose that such a partitioning exists. Consider two arbitrary vertices
a and b of G, such that a 2 V1 and b 2 V2: No path can exist between vertices
a and b; otherwise there would be at least one edge whose one end vertex would be
in V1 and the other in V2: Hence, if a partition exists, G is not connected.
Conversely, let G be a disconnected graph. Consider a vertex a in G. Let V1 be
the set of all vertices that are connected by paths to a. Since G is disconnected, V1
does not include all vertices of G. The remaining vertices will form a (non-empty)
set V2: No vertex in V1 is connected to any vertex in V2 by path. Hence the
partition exists. h
Theorem 2.2 If a graph (connected or disconnected) has exactly two vertices of
odd degree, there must be a path joined by these two vertices.
Proof Let G be a graph with all even vertices except vertices v1 and v2, which are
odd. From Handshaking lemma, which holds for every graph and therefore for
every component of a disconnected graph, no graph can have an odd number of
odd vertices. Therefore, in graph G, v1 and v2 must belong to the same component,
and hence there must be a path between them. h
Theorem 2.3 A simple graph with n vertices and k components can have at most
(n - k)(n - k ? 1)/2 edges.
Fig. 2.7 A disconnected graph with two components
16 2 Subgraphs, Paths and Connected Graphs
Proof Let the number of vertices in each of the k components of a graph G be
n1; n2; . . .; nk. Thus, we have
n1 þ n2 þ Á Á Á þ nk ¼ n
where ni ! 1 for i ¼ 1; 2; . . .; k:
Now,
Pk
i¼1 ni À 1ð Þ ¼ n À k
)
Pk
i¼1
ni À 1ð Þ
 2
¼ n2
þ k2
À 2nk
) n1 À 1ð Þ þ n2 À 1ð Þ þ Á Á Á þ nk À 1ð Þ½ Š2
¼ n2
þ k2
À 2nk
)
Pk
i¼1
ni À 1ð Þ2
þ2
Pk
i;j¼1;i6¼j
ni À 1ð Þ nj À 1
À Á
¼ n2
þ k2
À 2nk
)
Pk
i¼1
nið Þ2
À2
Pk
i¼1
ni þ k þ 2
Pk
i;j¼1;i6¼j
ni À 1ð Þ nj À 1
À Á
¼ n2
þ k2
À 2nk
)
Pk
i¼1
n2
i À 2n þ k þ 2
Pk
i;j¼1;i6¼j
ni À 1ð Þ nj À 1
À Á
¼ n2
þ k2
À 2nk
)
Pn
i¼1
n2
i þ 2
Pk
i;j¼1;i6¼j
ni À 1ð Þ nj À 1
À Á
¼ n2
þ k2
À 2nk þ 2n À k:
Since each ni À 1ð Þ ! 0:
Xn
i¼1
n2
i n2
þ k2
À 2nk þ 2n À k ¼ n2
þ k k À 2nð Þ À k À 2nð Þ
¼ n2
À k À 1ð Þ 2n À kð Þ
Now, the maximum number of edges in the ith component of G is ni ni À 1ð Þ=2.
Since the maximum number of edges in a simple graph with n vertices is
n(n -1)/2 therefore, the maximum number of edges in G is
1
2
Pk
i¼1
ni ni À 1ð Þ ¼ 1
2
Pn
i¼1
n2
i À n
2
1
2 n2
À k À 1ð Þ 2n À kð Þ½ Š À n
2
¼ 1
2 n2
À 2nk þ 2n þ k2
À k À n½ Š
¼ 1
2 n À kð Þ2
þ n À kð Þ
h i
¼ 1
2 n À kð Þ n À k þ 1ð Þ h
2.5 Cycles
Cycle: A nontrivial closed trail in a graph G is called a cycle if its origin and
internal vertices are distinct. In detail, the closed trail
2.4 Connected Graphs, Disconnected Graphs, and Components 17
C  v1v2 Á Á Á vnv1 is a cycle if
1. C has at least one edge and
2. v1; v2; . . .; vnare n distinct vertices.
k-Cycle: A cycle of length k; , i.e., with k edges, is called a k-cycle. A k-cycle is
called odd or even depending on whether k is odd or even.
Figure 2.8 cites C3; C4; C5; and C6. A 3-cycle is often called a triangle. Clearly,
any two cycles of the same length are isomorphic.
An n-cycle, i.e., a cycle with n vertices, will sometimes be denoted by Cn:
In Fig. 2.9, C  v1v2v3v4v1; is a 4-cycle and T  v1v2v5v3v4v5v1 is a non-trivial
closed trail which is not a cycle (because v5 occurs twice as an internal vertex) and
C0
 v1v2v5v1 is a triangle.
Fig. 2.8 Cycles C3, C4, C5 and C6
Fig. 2.9 A graph containing
3-cycles and 4-cycles
18 2 Subgraphs, Paths and Connected Graphs
Note that, a loop is just a 1-cycle. Also, given parallel edges e1 and e2 in Fig. 2.10
with distinct end vertices v1 and v2; we can find the cycle v1e1v2e2v1 of length 2.
Conversely, the two edges of any cycle of length 2 are a pair of parallel edges.
Theorem 2.4 Given any two vertices u and v of a graph G, every u–v walk
contains a u–v path.
Proof We prove the statement by induction on the length l of a u–v walk W.
Basic step: l ¼ 0; having no edge, W consists of a single vertex (u = v). This
vertex is a u–v path of length 0.
Induction step: l ! 1: We suppose that the claim holds for walks of length less
than l: If W has no repeated vertex, then its vertices and edges form a u–v path. If
W has a repeated vertex w, then deleting the edges and vertices between appear-
ances of w (leaving one copy of w) yields a shorter u-v walk W0
contained in W.
By the induction hypothesis, W0
contains a u–v path P, and this path P is contained
in W (Fig. 2.11). This proves the theorem. h
Theorem 2.5 The minimum number of edges in a connected graph with n vertices
is n - 1.
Proof Let m be the number of edges of such a graph. We have to show m ! n À 1:
We prove this by method of induction on m. If m = 0 then obviously n = 1
(otherwise G will be disconnected). Clearly, then m ! n À 1: Let the result be true
for m ¼ 0; 1; 2; 3; . . .; k: We shall show that the result is true for m = k ? 1. Let
G be a graph with k ? 1 edges. Let e be an edge of G. Then the subgraph G - e has
Fig. 2.10 A 2-cycle
Fig. 2.11 A walk W and a shorter walk W0
of W containing a path P
2.5 Cycles 19
k edges and n number of vertices. If G - e is also connected then by our hypothesis
k ! n À 1, i.e., k þ 1 ! n [ n À 1.
If G - e is disconnected then it would have two connected components. Let the
two components have k1; k2 number of edges and n1; n2 number of vertices,
respectively. So, by our hypothesis, k1 ! n1 À 1 and k2 ! n2 À 1. These two imply
that k1 þ k2 ! n1 þ n2 À 2, i.e., k ! n À 2 (since, k1 þ k2 ¼ k; n1 þ n2 ¼ n), i.e.,
k þ 1 ! n À 1.
Thus, the result is true for m = k ? 1. h
Theorem 2.6 A graph G is bipartite if and only if it has no odd cycles.
Proof Necessary condition:
Let G be a bipartite graph with bipartition X; Yð Þ, i.e., V ¼ X [ Y:
For any cycle C : v1 ! v2 Á Á Á ! vkþ1 ¼ v1ð Þ of length k; v1 2 X ) v2 2 Y; v3 2
X ) v4 2 Y Á Á Á ) v2m 2 Y ) v2mþ1 2 X: Consequently, k þ 1 ¼ 2m þ 1 is odd
and k ¼ Cj j is even. Hence, G has no odd cycle.
Sufficient condition:
Suppose that, all the cycles in G are even, i.e., G be a graph with no odd cycle.
To show: G is a bipartite graph. It is sufficient to prove this theorem for the
connected graph only.
Let us assume that G is connected. Let v 2 G be an arbitrary chosen vertex.
Now, we define,
X ¼ x dG v; xð Þj is evenf g;
i.e., X is the set of all vertices x of G with the property that any shortest v À x path
of G has even length and Y ¼ y dG v; yð Þj is oddf g, i.e., Y is the set of all vertices y
of G with the property that any shortest v À y path of G has odd length.
Here,
dG u; vð Þ ¼ shortest distance from the vertex u to the vertex v
¼ min k : u !
k
v
n o
[If the graph G is connected then this shortest distance should be finite, i.e.,
dG u; vð Þ1 for 8u; v 2 G. Otherwise, G is disconnected]
Then clearly, since the graph G is connected V ¼ X [ Y and also by definition
of distance X  Y ¼ ;.
Now, we show that V ¼ X [ Y is a bipartition of G by showing that any edge of
G must have one end vertex in X and another in Y:
Suppose that u; w 2 V Gð Þ are both either in X or in Y and they are adjacent.
Let P : v !
Ã
u and Q : v !
Ã
w be the two shortest paths from v to u and v to w,
respectively.
Let x be the last common vertex of the two shortest paths P and Q such that
P ¼ P1P2 and Q ¼ Q1Q2 where P2 : x !
Ã
u and Q2 : x !
Ã
w are independent
(Fig. 2.12).
20 2 Subgraphs, Paths and Connected Graphs
Since P and Q are shortest paths, therefore, P1 : v !
Ã
x and Q1 : v !
Ã
x are
shortest paths from v to x.
Consequently, P1j j ¼ Q1j j
Now consider the following two cases.
Case 1: u; w 2 X, then Pj j is even and Qj j is even (Also, P1j j ¼ Q1j j)
Case 2: u; w 2 Y, then Pj j is odd and Qj j is odd (Also, P1j j ¼ Q1j j)
Therefore, in either case, P2j j þ Q2j j must be even and so uw 62 E Gð Þ. Other-
wise, x !
Ã
u ! w !
Ã
x would be an odd cycle, which is a contradiction.
Therefore, X and Y are stable subsets of V: This implies X; Yð Þ is a bipartition
of G: Therefore, G½XŠ and G½YŠ are discrete induced subgraphs of G:
Hence, G is a bipartite graph.
If G is disconnected then each cycle of G will belong to any one of the
connected components of G say G1; G2; . . .; Gp.
If Gi is bipartite with bipartition Xi; Yið Þ; then X1 [ X2 [ X3 [ Á Á Á Á Á Á [ Xp;
À
Y1 [ Y2 [ Á Á Á Á Á Á [ YpÞ is a bipartition of G.
Hence, the disconnected graph G is bipartite. h
Exercises:
1. Show that the following two graphs are isomorphic (Fig. 2.13).
Fig. 2.13
Fig. 2.12 Two shortest paths P and Q
2.5 Cycles 21
2. Check whether the following two graphs are isomorphic or not (Fig. 2.14).
Fig. 2.14
3. Show that the following graphs are isomorphic and each graph has the same
bipartition (Fig. 2.15).
Fig. 2.15
4. What is the difference between a closed trail and a cycle?
5. Are the following graphs isomorphic? (Fig. 2.16).
22 2 Subgraphs, Paths and Connected Graphs
Fig. 2.16
6. Prove that a simple graph having n number of vertices must be connected if it
has more than n À 1ð Þ n À 2ð Þ=2 edges.
7. Check whether the following two given graphs G1 and G2 are isomorphic or
not (Fig. 2.17).
Fig. 2.17
8. Prove that the number of edges in a bipartite graph with n vertices is at
most n2
=2ð Þ.
9. Prove that there exists no simple graph with five vertices having degree
sequence 4; 4; 4; 2; 2.
10. Find, if possible, a simple graph with five vertices having degree sequence
2; 3; 3; 3; 3.
11. If a simple regular graph has n vertices and 24 edges, find all possible values
of n:
2.5 Cycles 23
12. If d Gð Þ and D Gð Þ be the minimum and maximum degrees of the vertices of a
graph G with n vertices and e edges, show that
d Gð Þ
2e
n
D Gð Þ
13. Show that the minimum number of edges in a simple graph with n vertices is
n À k; where k is the number of connected components of the graph.
14. Find the maximum number of edges in
(a) a simple graph with n vertices
(b) a bipartite graph with bipartition X; Yð Þ where Xj j ¼ m and Yj j ¼ n;
respectively.
24 2 Subgraphs, Paths and Connected Graphs
http://www.springer.com/978-81-322-0749-8

Contenu connexe

Tendances

NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automatadeepinderbedi
 
Automata theory -- NFA and DFA construction
Automata theory -- NFA and DFA  constructionAutomata theory -- NFA and DFA  construction
Automata theory -- NFA and DFA constructionAkila Krishnamoorthy
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphsArham Khan G
 
Cs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersCs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersappasami
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Akila Krishnamoorthy
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFAkunj desai
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler DesignKuppusamy P
 
Removing ambiguity-from-cfg
Removing ambiguity-from-cfgRemoving ambiguity-from-cfg
Removing ambiguity-from-cfgAshik Khan
 
2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt2_2Specification of Tokens.ppt
2_2Specification of Tokens.pptRatnakar Mikkili
 
LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxAkhilJoseph63
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free GrammarAkhil Kaushik
 

Tendances (20)

NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
 
Kruskal’s algorithm
Kruskal’s algorithmKruskal’s algorithm
Kruskal’s algorithm
 
Automata theory -- NFA and DFA construction
Automata theory -- NFA and DFA  constructionAutomata theory -- NFA and DFA  construction
Automata theory -- NFA and DFA construction
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphs
 
Cs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papersCs2303 theory of computation all anna University question papers
Cs2303 theory of computation all anna University question papers
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
Finite automata
Finite automataFinite automata
Finite automata
 
Minimization of DFA
Minimization of DFAMinimization of DFA
Minimization of DFA
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
FInite Automata
FInite AutomataFInite Automata
FInite Automata
 
Lexical analysis - Compiler Design
Lexical analysis - Compiler DesignLexical analysis - Compiler Design
Lexical analysis - Compiler Design
 
Type Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLikeType Checking(Compiler Design) #ShareThisIfYouLike
Type Checking(Compiler Design) #ShareThisIfYouLike
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
Removing ambiguity-from-cfg
Removing ambiguity-from-cfgRemoving ambiguity-from-cfg
Removing ambiguity-from-cfg
 
2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt2_2Specification of Tokens.ppt
2_2Specification of Tokens.ppt
 
Chomsky Normal Form
Chomsky Normal FormChomsky Normal Form
Chomsky Normal Form
 
LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptx
 
Context Free Grammar
Context Free GrammarContext Free Grammar
Context Free Grammar
 

Similaire à Graph theory with algorithms and its applications

Ass. (3)graph d.m
Ass. (3)graph d.mAss. (3)graph d.m
Ass. (3)graph d.mSyed Umair
 
Graph terminologies & special type graphs
Graph terminologies & special type graphsGraph terminologies & special type graphs
Graph terminologies & special type graphsNabeel Ahsen
 
Lecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptxLecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptxChandanGiri21
 
Elements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxElements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxmiki304759
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............eustaquiojm1
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxujjwalmatoliya
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graphRounak Biswas
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringSaurabh Kaushik
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theoryArvindBorge
 
Cs6702 graph theory and applications 2 marks questions and answers
Cs6702 graph theory and applications 2 marks questions and answersCs6702 graph theory and applications 2 marks questions and answers
Cs6702 graph theory and applications 2 marks questions and answersappasami
 

Similaire à Graph theory with algorithms and its applications (20)

Graph-theory.ppt
Graph-theory.pptGraph-theory.ppt
Graph-theory.ppt
 
Graph.ppt
Graph.pptGraph.ppt
Graph.ppt
 
Ass. (3)graph d.m
Ass. (3)graph d.mAss. (3)graph d.m
Ass. (3)graph d.m
 
Graph terminologies & special type graphs
Graph terminologies & special type graphsGraph terminologies & special type graphs
Graph terminologies & special type graphs
 
graph theory
graph theorygraph theory
graph theory
 
Lecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptxLecture 1--Graph Algorithms -- Basics.pptx
Lecture 1--Graph Algorithms -- Basics.pptx
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptx
 
Elements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptxElements of Graph Theory for IS.pptx
Elements of Graph Theory for IS.pptx
 
Graph theory
Graph theory Graph theory
Graph theory
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............
 
Graph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptxGraph in Discrete mathemaetics.pptx
Graph in Discrete mathemaetics.pptx
 
Isograph
IsographIsograph
Isograph
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
 
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph ColouringGraph Theory,Graph Terminologies,Planar Graph & Graph Colouring
Graph Theory,Graph Terminologies,Planar Graph & Graph Colouring
 
Graphs.pdf
Graphs.pdfGraphs.pdf
Graphs.pdf
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theory
 
Cs6702 graph theory and applications 2 marks questions and answers
Cs6702 graph theory and applications 2 marks questions and answersCs6702 graph theory and applications 2 marks questions and answers
Cs6702 graph theory and applications 2 marks questions and answers
 
Chapter 1
Chapter   1Chapter   1
Chapter 1
 
Graph theory
Graph theoryGraph theory
Graph theory
 

Plus de Springer

The chemistry of the actinide and transactinide elements (set vol.1 6)
The chemistry of the actinide and transactinide elements (set vol.1 6)The chemistry of the actinide and transactinide elements (set vol.1 6)
The chemistry of the actinide and transactinide elements (set vol.1 6)Springer
 
Transition metal catalyzed enantioselective allylic substitution in organic s...
Transition metal catalyzed enantioselective allylic substitution in organic s...Transition metal catalyzed enantioselective allylic substitution in organic s...
Transition metal catalyzed enantioselective allylic substitution in organic s...Springer
 
Total synthesis of natural products
Total synthesis of natural productsTotal synthesis of natural products
Total synthesis of natural productsSpringer
 
Solid state nmr
Solid state nmrSolid state nmr
Solid state nmrSpringer
 
Mass spectrometry
Mass spectrometryMass spectrometry
Mass spectrometrySpringer
 
Higher oxidation state organopalladium and platinum
Higher oxidation state organopalladium and platinumHigher oxidation state organopalladium and platinum
Higher oxidation state organopalladium and platinumSpringer
 
Principles and applications of esr spectroscopy
Principles and applications of esr spectroscopyPrinciples and applications of esr spectroscopy
Principles and applications of esr spectroscopySpringer
 
Inorganic 3 d structures
Inorganic 3 d structuresInorganic 3 d structures
Inorganic 3 d structuresSpringer
 
Field flow fractionation in biopolymer analysis
Field flow fractionation in biopolymer analysisField flow fractionation in biopolymer analysis
Field flow fractionation in biopolymer analysisSpringer
 
Thermodynamics of crystalline states
Thermodynamics of crystalline statesThermodynamics of crystalline states
Thermodynamics of crystalline statesSpringer
 
Theory of electroelasticity
Theory of electroelasticityTheory of electroelasticity
Theory of electroelasticitySpringer
 
Tensor algebra and tensor analysis for engineers
Tensor algebra and tensor analysis for engineersTensor algebra and tensor analysis for engineers
Tensor algebra and tensor analysis for engineersSpringer
 
Springer handbook of nanomaterials
Springer handbook of nanomaterialsSpringer handbook of nanomaterials
Springer handbook of nanomaterialsSpringer
 
Shock wave compression of condensed matter
Shock wave compression of condensed matterShock wave compression of condensed matter
Shock wave compression of condensed matterSpringer
 
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solids
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solidsPolarization bremsstrahlung on atoms, plasmas, nanostructures and solids
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solidsSpringer
 
Nanostructured materials for magnetoelectronics
Nanostructured materials for magnetoelectronicsNanostructured materials for magnetoelectronics
Nanostructured materials for magnetoelectronicsSpringer
 
Nanobioelectrochemistry
NanobioelectrochemistryNanobioelectrochemistry
NanobioelectrochemistrySpringer
 
Modern theory of magnetism in metals and alloys
Modern theory of magnetism in metals and alloysModern theory of magnetism in metals and alloys
Modern theory of magnetism in metals and alloysSpringer
 
Mechanical behaviour of materials
Mechanical behaviour of materialsMechanical behaviour of materials
Mechanical behaviour of materialsSpringer
 

Plus de Springer (20)

The chemistry of the actinide and transactinide elements (set vol.1 6)
The chemistry of the actinide and transactinide elements (set vol.1 6)The chemistry of the actinide and transactinide elements (set vol.1 6)
The chemistry of the actinide and transactinide elements (set vol.1 6)
 
Transition metal catalyzed enantioselective allylic substitution in organic s...
Transition metal catalyzed enantioselective allylic substitution in organic s...Transition metal catalyzed enantioselective allylic substitution in organic s...
Transition metal catalyzed enantioselective allylic substitution in organic s...
 
Total synthesis of natural products
Total synthesis of natural productsTotal synthesis of natural products
Total synthesis of natural products
 
Solid state nmr
Solid state nmrSolid state nmr
Solid state nmr
 
Mass spectrometry
Mass spectrometryMass spectrometry
Mass spectrometry
 
Higher oxidation state organopalladium and platinum
Higher oxidation state organopalladium and platinumHigher oxidation state organopalladium and platinum
Higher oxidation state organopalladium and platinum
 
Principles and applications of esr spectroscopy
Principles and applications of esr spectroscopyPrinciples and applications of esr spectroscopy
Principles and applications of esr spectroscopy
 
Inorganic 3 d structures
Inorganic 3 d structuresInorganic 3 d structures
Inorganic 3 d structures
 
Field flow fractionation in biopolymer analysis
Field flow fractionation in biopolymer analysisField flow fractionation in biopolymer analysis
Field flow fractionation in biopolymer analysis
 
Thermodynamics of crystalline states
Thermodynamics of crystalline statesThermodynamics of crystalline states
Thermodynamics of crystalline states
 
Theory of electroelasticity
Theory of electroelasticityTheory of electroelasticity
Theory of electroelasticity
 
Tensor algebra and tensor analysis for engineers
Tensor algebra and tensor analysis for engineersTensor algebra and tensor analysis for engineers
Tensor algebra and tensor analysis for engineers
 
Springer handbook of nanomaterials
Springer handbook of nanomaterialsSpringer handbook of nanomaterials
Springer handbook of nanomaterials
 
Shock wave compression of condensed matter
Shock wave compression of condensed matterShock wave compression of condensed matter
Shock wave compression of condensed matter
 
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solids
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solidsPolarization bremsstrahlung on atoms, plasmas, nanostructures and solids
Polarization bremsstrahlung on atoms, plasmas, nanostructures and solids
 
Nanostructured materials for magnetoelectronics
Nanostructured materials for magnetoelectronicsNanostructured materials for magnetoelectronics
Nanostructured materials for magnetoelectronics
 
Nanobioelectrochemistry
NanobioelectrochemistryNanobioelectrochemistry
Nanobioelectrochemistry
 
Modern theory of magnetism in metals and alloys
Modern theory of magnetism in metals and alloysModern theory of magnetism in metals and alloys
Modern theory of magnetism in metals and alloys
 
Mechanical behaviour of materials
Mechanical behaviour of materialsMechanical behaviour of materials
Mechanical behaviour of materials
 
Magnonics
MagnonicsMagnonics
Magnonics
 

Dernier

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Dernier (20)

Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Graph theory with algorithms and its applications

  • 1. Chapter 2 Subgraphs, Paths, and Connected Graphs 2.1 Subgraphs and Spanning Subgraphs (Supergraphs) Subgraph: Let H be a graph with vertex set V(H) and edge set E(H), and similarly let G be a graph with vertex set V(G) and edge set E(G). Then, we say that H is a subgraph of G if V(H) ( V(G) and E(H) ( E(G). In such a case, we also say that G is a supergraph of H. In Fig. 2.1, G1 is a subgraph of both G2 and G3 but G3 is not a subgraph of G2. Any graph isomorphic to a subgraph of G is also referred to as a subgraph of G. If H is a subgraph of G then we write H ( G. When H ( G but H = G, i.e., V(H) = V(G) or E(H) = E(G), then H is called a proper subgraph of G. Spanning subgraph (or Spanning supergraph): A spanning subgraph (or spanning supergraph) of G is a subgraph (or supergraph) H with V(H) = V(G), i.e. H and G have exactly the same vertex set. It follows easily from the definitions that any simple graph on n vertices is a subgraph of the complete graph Kn. In Fig. 2.1, G1 is a proper spanning subgraph of G3. Fig. 2.1 G1 is a subgraph of G2 and G3 S. Saha Ray, Graph Theory with Algorithms and its Applications, DOI: 10.1007/978-81-322-0750-4_2, Ó Springer India 2013 11
  • 2. 2.2 Operations on Graphs The union of two graphs G1 ¼ V1; E1ð Þ and G2 ¼ V2; E2ð Þ is another graph G3 ¼ V3; E3ð Þ denoted by G3 ¼ G1 [ G2, where vertex set V3 ¼ V1 [ V2 and the edge set E3 ¼ E1 [ E2: The intersection of two graphs G1 and G2 denoted by G1 G2 is a graph G4 consisting only of those vertices and edges that are in both G1 and G2. The ring sum of two graphs G1 and G2, denoted by G1 È G2; is a graph consisting of the vertex set V1 [ V2 and of edges that are either in G1 or G2; but not in both. Figure 2.2 shows union, intersection, and ring sum on two graphs G1 and G2: Three operations are commutative, i.e., G1 [ G2 ¼ G2 [ G1; G1 G2 ¼ G2 G1; G1 È G2 ¼ G2 È G1 If G1 and G2 are edge disjoint, then G1 G2 is a null graph, and G1 È G2 ¼ G1 [ G2: If G1 and G2 are vertex disjoint, then G1 G2 is empty. For any graph G, G G ¼ G [ G ¼ G and G È G = a null graph. If g is a subgraph of G, i.e., g ( G, then G È g = G - g, and is called a complement of g in G. Fig. 2.2 Union, intersection, and ring sum of two graphs 12 2 Subgraphs, Paths and Connected Graphs
  • 3. Decomposition: A graph G is said to be decomposed into two subgraphs G1 and G2, if G1 [ G2 ¼ G and G1 G2 is a null graph. Deletion: If vi is a vertex in graph G, then G À vi denotes a subgraph of G obtained by deleting vi from G. Deletion of a vertex always implies the deletion of all edges incident on that vertex. If ej is an edge in G, then G À ej is a subgraph of G obtained by deleting ej from G. Deletion of an edge does not imply deletion of its end vertices. Therefore, G À ej ¼ G È ej (Fig. 2.3). Fusion: A pair of vertices a, b in a graph G are said to be fused if the two vertices are replaced by a single new vertex such that every edge, that was incident on either a or b or on both, is incident on the new vertex. Thus, fusion of two vertices does not alter the number of edges, but reduces the number of vertices by one (Fig. 2.4). Induced subgraph: A subgraph H G is an induced subgraph, if EH ¼ EG E VHð Þ: In this case, H is induced by its set VH of vertices. In an induced subgraph H G; the set EH of edges consists of all e 2 EG, such that e 2 E VHð Þ: To each nonempty subset A VG; there corresponds a unique induced subgraph G½AŠ ¼ A; EG E Að Þð Þ (Fig. 2.5). Fig. 2.3 Vertex deletion and edge deletion from a graph G Fig. 2.4 Fusion of two vertices a and b 2.2 Operations on Graphs 13
  • 4. Trivial graph: A graph G ¼ V; Eð Þ is trivial, if it has only one vertex. Otherwise G is nontrivial. Discrete graph: A graph is called discrete graph if EG ¼ /. Stable: A subset X VG is stable, if G[X] is a discrete graph. 2.3 Walks, Trails, and Paths Walk: A walk in a graph G is a finite sequence W v0e1v1e2 Á Á Á vkÀ1ekvk whose terms are alternately vertices and edges such that for 1 i k; the edge ei has ends viÀ1 and vi. Thus, each edge ei is immediately preceded and succeeded by the two vertices with which it is incident. We say that W is a v0 À vk walk or a walk from v0 to vk: Origin and terminus: The vertex v0 is the origin of the walk W, while vk is called the terminus of W. v0 and vk need not be distinct. The vertices v1; v2; . . .; vkÀ1 in the above walk W are called its internal vertices. The integer k, the number of edges in the walk, is called the length of W, denoted by Wj j. In a walk W, there may be repetition of vertices and edges. Trivial walk: A trivial walk is one containing no edge. Thus for any vertex v of G, W : v gives a trivial walk. It has length 0. Fig. 2.5 Spanning subgraph and induced subgraph of a graph G 14 2 Subgraphs, Paths and Connected Graphs
  • 5. In Fig. 2.6, W1 v1e1v2e5v3e10v3e5v2e3v5 and W2 v1e1v2e1v1e1v2 are both walks of length 5 and 3, respectively, from v1 to v5 and from v1 to v2 , respectively. Given two vertices u and v of a graph G, a u–v walk is called closed or open, depending on whether u = v or u = v. Two walks W1 and W2 above are both open, while W3 v1v5v2v4v3v1 is closed in Fig. 2.6. Trail: If the edges e1; e2; . . .; ek of the walk W v0e1v1e2v2 Á Á Á Á Á Á ekvk are distinct then W is called a trail. In other words, a trail is a walk in which no edge is repeated. W1 and W2 are not trails, since for example e5 is repeated in W1, while e1 is repeated in W2. However, W3 is a trail. Path: If the vertices v0; v1; . . .; vk of the walk W v0e1v1e2v2 Á Á Á ekvk are dis- tinct then W is called a path. Clearly, any two paths with the same number of vertices are isomorphic. A path with n vertices will sometimes be denoted by Pn. Note that Pn has length n - 1. In other words, a path is a walk in which no vertex is repeated. Thus, in a path no edge can be repeated either, so a every path is a trail. Not every trail is a path, though. For example, W3 is not a path since v1 is repeated. However, W4 v2v4v3v5v1 is a path in the graph G as shown in Fig. 2.6. 2.4 Connected Graphs, Disconnected Graphs, and Components Connected vertices: A vertex u is said to be connected to a vertex v in a graph G if there is a path in G from u to v. Connected graph: A graph G is called connected if every two of its vertices are connected. Disconnected graph: A graph that is not connected is called disconnected. Fig. 2.6 A graph with five vertices and ten edges 2.3 Walks, Trails, and Paths 15
  • 6. It is easy to see that a disconnected graph consists of two or more connected graphs. Each of these connected subgraphs is called a component. Figure 2.7 shows a disconnected graph with two components. Theorem 2.1 A graph G is disconnected iff its vertex set V can be partitioned into two non-empty, disjoint subsets V1 and V2 such that there exists no edge in G whose one end vertex is in subset V1 and the other in subset V2. Proof Suppose that such a partitioning exists. Consider two arbitrary vertices a and b of G, such that a 2 V1 and b 2 V2: No path can exist between vertices a and b; otherwise there would be at least one edge whose one end vertex would be in V1 and the other in V2: Hence, if a partition exists, G is not connected. Conversely, let G be a disconnected graph. Consider a vertex a in G. Let V1 be the set of all vertices that are connected by paths to a. Since G is disconnected, V1 does not include all vertices of G. The remaining vertices will form a (non-empty) set V2: No vertex in V1 is connected to any vertex in V2 by path. Hence the partition exists. h Theorem 2.2 If a graph (connected or disconnected) has exactly two vertices of odd degree, there must be a path joined by these two vertices. Proof Let G be a graph with all even vertices except vertices v1 and v2, which are odd. From Handshaking lemma, which holds for every graph and therefore for every component of a disconnected graph, no graph can have an odd number of odd vertices. Therefore, in graph G, v1 and v2 must belong to the same component, and hence there must be a path between them. h Theorem 2.3 A simple graph with n vertices and k components can have at most (n - k)(n - k ? 1)/2 edges. Fig. 2.7 A disconnected graph with two components 16 2 Subgraphs, Paths and Connected Graphs
  • 7. Proof Let the number of vertices in each of the k components of a graph G be n1; n2; . . .; nk. Thus, we have n1 þ n2 þ Á Á Á þ nk ¼ n where ni ! 1 for i ¼ 1; 2; . . .; k: Now, Pk i¼1 ni À 1ð Þ ¼ n À k ) Pk i¼1 ni À 1ð Þ 2 ¼ n2 þ k2 À 2nk ) n1 À 1ð Þ þ n2 À 1ð Þ þ Á Á Á þ nk À 1ð Þ½ Š2 ¼ n2 þ k2 À 2nk ) Pk i¼1 ni À 1ð Þ2 þ2 Pk i;j¼1;i6¼j ni À 1ð Þ nj À 1 À Á ¼ n2 þ k2 À 2nk ) Pk i¼1 nið Þ2 À2 Pk i¼1 ni þ k þ 2 Pk i;j¼1;i6¼j ni À 1ð Þ nj À 1 À Á ¼ n2 þ k2 À 2nk ) Pk i¼1 n2 i À 2n þ k þ 2 Pk i;j¼1;i6¼j ni À 1ð Þ nj À 1 À Á ¼ n2 þ k2 À 2nk ) Pn i¼1 n2 i þ 2 Pk i;j¼1;i6¼j ni À 1ð Þ nj À 1 À Á ¼ n2 þ k2 À 2nk þ 2n À k: Since each ni À 1ð Þ ! 0: Xn i¼1 n2 i n2 þ k2 À 2nk þ 2n À k ¼ n2 þ k k À 2nð Þ À k À 2nð Þ ¼ n2 À k À 1ð Þ 2n À kð Þ Now, the maximum number of edges in the ith component of G is ni ni À 1ð Þ=2. Since the maximum number of edges in a simple graph with n vertices is n(n -1)/2 therefore, the maximum number of edges in G is 1 2 Pk i¼1 ni ni À 1ð Þ ¼ 1 2 Pn i¼1 n2 i À n 2 1 2 n2 À k À 1ð Þ 2n À kð Þ½ Š À n 2 ¼ 1 2 n2 À 2nk þ 2n þ k2 À k À n½ Š ¼ 1 2 n À kð Þ2 þ n À kð Þ h i ¼ 1 2 n À kð Þ n À k þ 1ð Þ h 2.5 Cycles Cycle: A nontrivial closed trail in a graph G is called a cycle if its origin and internal vertices are distinct. In detail, the closed trail 2.4 Connected Graphs, Disconnected Graphs, and Components 17
  • 8. C v1v2 Á Á Á vnv1 is a cycle if 1. C has at least one edge and 2. v1; v2; . . .; vnare n distinct vertices. k-Cycle: A cycle of length k; , i.e., with k edges, is called a k-cycle. A k-cycle is called odd or even depending on whether k is odd or even. Figure 2.8 cites C3; C4; C5; and C6. A 3-cycle is often called a triangle. Clearly, any two cycles of the same length are isomorphic. An n-cycle, i.e., a cycle with n vertices, will sometimes be denoted by Cn: In Fig. 2.9, C v1v2v3v4v1; is a 4-cycle and T v1v2v5v3v4v5v1 is a non-trivial closed trail which is not a cycle (because v5 occurs twice as an internal vertex) and C0 v1v2v5v1 is a triangle. Fig. 2.8 Cycles C3, C4, C5 and C6 Fig. 2.9 A graph containing 3-cycles and 4-cycles 18 2 Subgraphs, Paths and Connected Graphs
  • 9. Note that, a loop is just a 1-cycle. Also, given parallel edges e1 and e2 in Fig. 2.10 with distinct end vertices v1 and v2; we can find the cycle v1e1v2e2v1 of length 2. Conversely, the two edges of any cycle of length 2 are a pair of parallel edges. Theorem 2.4 Given any two vertices u and v of a graph G, every u–v walk contains a u–v path. Proof We prove the statement by induction on the length l of a u–v walk W. Basic step: l ¼ 0; having no edge, W consists of a single vertex (u = v). This vertex is a u–v path of length 0. Induction step: l ! 1: We suppose that the claim holds for walks of length less than l: If W has no repeated vertex, then its vertices and edges form a u–v path. If W has a repeated vertex w, then deleting the edges and vertices between appear- ances of w (leaving one copy of w) yields a shorter u-v walk W0 contained in W. By the induction hypothesis, W0 contains a u–v path P, and this path P is contained in W (Fig. 2.11). This proves the theorem. h Theorem 2.5 The minimum number of edges in a connected graph with n vertices is n - 1. Proof Let m be the number of edges of such a graph. We have to show m ! n À 1: We prove this by method of induction on m. If m = 0 then obviously n = 1 (otherwise G will be disconnected). Clearly, then m ! n À 1: Let the result be true for m ¼ 0; 1; 2; 3; . . .; k: We shall show that the result is true for m = k ? 1. Let G be a graph with k ? 1 edges. Let e be an edge of G. Then the subgraph G - e has Fig. 2.10 A 2-cycle Fig. 2.11 A walk W and a shorter walk W0 of W containing a path P 2.5 Cycles 19
  • 10. k edges and n number of vertices. If G - e is also connected then by our hypothesis k ! n À 1, i.e., k þ 1 ! n [ n À 1. If G - e is disconnected then it would have two connected components. Let the two components have k1; k2 number of edges and n1; n2 number of vertices, respectively. So, by our hypothesis, k1 ! n1 À 1 and k2 ! n2 À 1. These two imply that k1 þ k2 ! n1 þ n2 À 2, i.e., k ! n À 2 (since, k1 þ k2 ¼ k; n1 þ n2 ¼ n), i.e., k þ 1 ! n À 1. Thus, the result is true for m = k ? 1. h Theorem 2.6 A graph G is bipartite if and only if it has no odd cycles. Proof Necessary condition: Let G be a bipartite graph with bipartition X; Yð Þ, i.e., V ¼ X [ Y: For any cycle C : v1 ! v2 Á Á Á ! vkþ1 ¼ v1ð Þ of length k; v1 2 X ) v2 2 Y; v3 2 X ) v4 2 Y Á Á Á ) v2m 2 Y ) v2mþ1 2 X: Consequently, k þ 1 ¼ 2m þ 1 is odd and k ¼ Cj j is even. Hence, G has no odd cycle. Sufficient condition: Suppose that, all the cycles in G are even, i.e., G be a graph with no odd cycle. To show: G is a bipartite graph. It is sufficient to prove this theorem for the connected graph only. Let us assume that G is connected. Let v 2 G be an arbitrary chosen vertex. Now, we define, X ¼ x dG v; xð Þj is evenf g; i.e., X is the set of all vertices x of G with the property that any shortest v À x path of G has even length and Y ¼ y dG v; yð Þj is oddf g, i.e., Y is the set of all vertices y of G with the property that any shortest v À y path of G has odd length. Here, dG u; vð Þ ¼ shortest distance from the vertex u to the vertex v ¼ min k : u ! k v n o [If the graph G is connected then this shortest distance should be finite, i.e., dG u; vð Þ1 for 8u; v 2 G. Otherwise, G is disconnected] Then clearly, since the graph G is connected V ¼ X [ Y and also by definition of distance X Y ¼ ;. Now, we show that V ¼ X [ Y is a bipartition of G by showing that any edge of G must have one end vertex in X and another in Y: Suppose that u; w 2 V Gð Þ are both either in X or in Y and they are adjacent. Let P : v ! Ã u and Q : v ! Ã w be the two shortest paths from v to u and v to w, respectively. Let x be the last common vertex of the two shortest paths P and Q such that P ¼ P1P2 and Q ¼ Q1Q2 where P2 : x ! Ã u and Q2 : x ! Ã w are independent (Fig. 2.12). 20 2 Subgraphs, Paths and Connected Graphs
  • 11. Since P and Q are shortest paths, therefore, P1 : v ! Ã x and Q1 : v ! Ã x are shortest paths from v to x. Consequently, P1j j ¼ Q1j j Now consider the following two cases. Case 1: u; w 2 X, then Pj j is even and Qj j is even (Also, P1j j ¼ Q1j j) Case 2: u; w 2 Y, then Pj j is odd and Qj j is odd (Also, P1j j ¼ Q1j j) Therefore, in either case, P2j j þ Q2j j must be even and so uw 62 E Gð Þ. Other- wise, x ! Ã u ! w ! Ã x would be an odd cycle, which is a contradiction. Therefore, X and Y are stable subsets of V: This implies X; Yð Þ is a bipartition of G: Therefore, G½XŠ and G½YŠ are discrete induced subgraphs of G: Hence, G is a bipartite graph. If G is disconnected then each cycle of G will belong to any one of the connected components of G say G1; G2; . . .; Gp. If Gi is bipartite with bipartition Xi; Yið Þ; then X1 [ X2 [ X3 [ Á Á Á Á Á Á [ Xp; À Y1 [ Y2 [ Á Á Á Á Á Á [ YpÞ is a bipartition of G. Hence, the disconnected graph G is bipartite. h Exercises: 1. Show that the following two graphs are isomorphic (Fig. 2.13). Fig. 2.13 Fig. 2.12 Two shortest paths P and Q 2.5 Cycles 21
  • 12. 2. Check whether the following two graphs are isomorphic or not (Fig. 2.14). Fig. 2.14 3. Show that the following graphs are isomorphic and each graph has the same bipartition (Fig. 2.15). Fig. 2.15 4. What is the difference between a closed trail and a cycle? 5. Are the following graphs isomorphic? (Fig. 2.16). 22 2 Subgraphs, Paths and Connected Graphs
  • 13. Fig. 2.16 6. Prove that a simple graph having n number of vertices must be connected if it has more than n À 1ð Þ n À 2ð Þ=2 edges. 7. Check whether the following two given graphs G1 and G2 are isomorphic or not (Fig. 2.17). Fig. 2.17 8. Prove that the number of edges in a bipartite graph with n vertices is at most n2 =2ð Þ. 9. Prove that there exists no simple graph with five vertices having degree sequence 4; 4; 4; 2; 2. 10. Find, if possible, a simple graph with five vertices having degree sequence 2; 3; 3; 3; 3. 11. If a simple regular graph has n vertices and 24 edges, find all possible values of n: 2.5 Cycles 23
  • 14. 12. If d Gð Þ and D Gð Þ be the minimum and maximum degrees of the vertices of a graph G with n vertices and e edges, show that d Gð Þ 2e n D Gð Þ 13. Show that the minimum number of edges in a simple graph with n vertices is n À k; where k is the number of connected components of the graph. 14. Find the maximum number of edges in (a) a simple graph with n vertices (b) a bipartite graph with bipartition X; Yð Þ where Xj j ¼ m and Yj j ¼ n; respectively. 24 2 Subgraphs, Paths and Connected Graphs