Graph Theory - Introduction In the domain of mathematics and computer science, graph theory is the study of graphs that concerns with the relationship among edges and vertices . It is a popular
subject
having
its
applications
in
computer
science,
information
technology, biosc iences, mathematics, and linguistics to name a few. Without further ado, let us start with defining a graph.
What is a Graph? graph is a pictorial representation of a set of objects where some pairs of objects are connected by lin!s. The interconnected objects are represented by points termed as vertices, and the lin!s that connect the vertices are callededges. "ormally, a graph is a pair of sets (V, E), where V is the set of vertices and E is the set of edges, connecting the pairs of vertices. Ta!e a loo! at the following graph #
In the above graph, $ % &a, b, c, d, e' ( % &ab, ac, bd, cd, de'
pplications of Graph Theory Graph theory has its applications in diverse fields of engineering # •
Electrical Engineering # The concepts of graph theory is used e)tensively in designing circuit connections. The types or organi*ation of connections are named as topologies. +ome e)amples for topologies are star, bridge, series, and parallel topologies.
•
Computer Science # Graph theory is used for the study of algorithms. "or e)ample,
•
o
rus!als lgorithm
o
rims lgorithm
o
/ij!stras lgorithm
Computer Network # The relationships among interconnected computers in the networ! follows the principles of graph theory.
•
Science # The molecular structure and chemical structure of a substance, the /0 structure of an organism, etc., are represented by graphs.
•
Linguistics # The parsing tree of a language and grammar of a language uses graphs.
•
General # 1outes between the cities can be represented using graphs. /epicting hierarchical ordered information such as family tree can be used as a special type of graph called tree.
Graph Theory - "undamentals graph is a diagram of points and lines connected to the points. It has at least one line joining a set of two vertices with no verte) connecting itself. The concept of graphs in graph theory stands up on some basic terms such as point, line, verte), edge, degree of vertices, properties of graphs, etc. 2ere, in this chapter, we will cover these fundamentals of graph theory.
oint A point is a particular position in a one-dimensional, two-dimensional, or threedimensional space. "or better understanding, a point can be denoted by an alphabet. It can be represented with a dot.
()ample
2ere, the dot is a point named 3a4.
5ine Line is a connection between two points. It can be represented with a solid line.
()ample
2ere, 3a4 and 3b4 are the points. The lin! between these two points is called a line.
$erte) verte) is a point where multiple lines meet. It is also called a
node. +imilar to
points, a verte) is also denoted by an alphabet.
()ample
2ere, the verte) is named with an alphabet 3a4.
(dge n edge is the mathematical term for a line that connects two vertices. 6any edges can be formed from a single verte). Without a verte), an edge cannot be formed. There must be a starting verte) and an ending verte) for an edge.
()ample
2ere, 3a4 and 3b4 are the two vertices and the lin! between them is called an edge.
Graph graph 3G4 is defined as G % 7$, (8 Where $ is a set of all vertices and ( is a set of all edges in the graph.
()ample 9
In the above e)ample, ab, ac, cd, and bd are the edges of the graph. +imilarly, a, b, c, and d are the vertices of the graph.
()ample :
In this graph, there are four vertices a, b, c, and d, and four edges ab, ac, ad, and cd.
5oop In a graph, if an edge is drawn from verte) to itself, it is called a loop.
()ample 9
In the above graph, $ is a verte) for which it has an edge 7$, $8 forming a loop.
()ample :
In this graph, there are two loops which are formed at verte) a, and verte) b.
/egree of $erte) It is the number of vertices incident with the verte) $. Notation # deg7$8. In a simple graph with n number of vertices, the degree of any vertices is # deg(v) ≤ n – 1 ∀ v ∈ G
verte) can form an edge with all other vertices e)cept by itself. +o the degree of a verte) will be up to the number o vertices in t!e grap! minus " . This 9 is for the self-verte) as it cannot form a loop by itself. If there is a loop at any of the vertices, then it is not a +imple Graph. /egree of verte) can be considered under two cases of graphs # •
;ndirected Graph
•
/irected Graph
/egree of $erte) in an ;ndirected Graph n undirected graph has no directed edges.
()ample 9 Ta!e a loo! at the following graph #
In the above ;ndirected Graph, •
deg7a8 % :, as there are : edges meeting at verte) 3a4.
•
deg7b8 % =, as there are = edges meeting at verte) 3b4.
•
deg7c8 % 9, as there is 9 edge formed at verte) 3c4
+o 3c4 is a pendent verte#. •
deg7d8 % :, as there are : edges meeting at verte) 3d4.
•
deg7e8 % >, as there are > edges formed at verte) 3e4. +o 3e4 is an isolated verte#.
()ample : Ta!e a loo! at the following graph #
In the above graph, deg7a8 % :, deg7b8 % :, deg7c8 % :, deg7d8 % :, and deg7e8 % >. The verte) 3e4 is an isolated verte). The graph does not have any pendent verte).
/egree of $erte) in a /irected Graph
In a directed graph, each verte) has an indegree and an outdegree.
Indegree of a Graph •
Indegree of verte) $ is the number of edges which are coming into the verte) $.
•
Notation # deg7$8.
@utdegree of a Graph •
@utdegree of verte) $ is the number of edges which are going out from the verte) $.
•
Notation # deg-7$8.
()ample 9 Ta!e a loo! at the following directed graph. $erte) 3a4 has two edges, 3ad4 and 3ab4, which are going outwards. 2ence its outdegree is :. +imilarly, there is an edge 3ga4, coming towards verte) 3a4. 2ence the indegree of 3a4 is 9.
The indegree and outdegree of other vertices are shown in the following table # Verte#
$ndegree
%utdegree
a
9
:
b
:
>
c
:
9
d
9
9
e
9
9
f
9
9
g
>
:
()ample : Ta!e a loo! at the following directed graph. $erte) 3a4 has an edge 3ae4 going outwards from verte) 3a4. 2ence its outdegree is 9. +imilarly, the graph has an edge 3ba4 coming towards verte) 3a4. 2ence the indegree of 3a4 is 9.
The indegree and outdegree of other vertices are shown in the following table # Verte#
$ndegree
%utdegree
a
9
9
b
>
:
c
:
>
d
9
9
e
9
9
endent $erte) Ay using degree of a verte), we have a two special types of vertices. verte) with degree one is called a pendent verte).
()ample
2ere, in this e)ample, verte) 3a4 and verte) 3b4 have a connected edge 3ab4. +o with respect to the verte) 3a4, there is only one edge towards verte) 3b4 and similarly with respect to the verte) 3b4, there is only one edge towards verte) 3a4. "inally, verte) 3a4 and verte) 3b4 has degree as one which are also called as the pendent verte).
Isolated $erte) verte) with degree *ero is called an isolated verte).
()ample
2ere, the verte) 3a4 and verte) 3b4 has a no connectivity between each other and also to any other vertices. +o the degree of both the vertices 3a4 and 3b4 are *ero. These are also called as isolated vertices.
djacency 2ere are the norms of adjacency # •
In a graph, two vertices are said to be ad&acent, if there is an edge between the two vertices. 2ere, the adjacency of vertices is maintained by the single edge that is connecting those two vertices.
•
In a graph, two edges are said to be adjacent, if there is a common verte) between the two edges. 2ere, the adjacency of edges is maintained by the single verte) that is connecting two edges.
()ample 9
In the above graph # •
3a4 and 3b4 are the adjacent vertices, as there is a common edge 3ab4 between them.
•
3a4 and 3d4 are the adjacent vertices, as there is a common edge 3ad4 between them.
•
ab4 and 3be4 are the adjacent edges, as there is a common verte) 3b4 between them.
•
be4 and 3de4 are the adjacent edges, as there is a common verte) 3e4 between them.
()ample :
In the above graph # •
a4 and 3d4 are the adjacent vertices, as there is a common edge 3ad4 between them.
•
3c4 and 3b4 are the adjacent vertices, as there is a common edge 3cb4 between them.
•
3ad4 and 3cd4 are the adjacent edges, as there is a common verte) 3d4 between them.
•
ac4 and 3cd4 are the adjacent edges, as there is a common verte) 3c4 between them.
arallel (dges In a graph, if a pair of vertices is connected by more than one edge, then those edges are called parallel edges.
In the above graph, 3a4 and 3b4 are the two vertices which are connected by two edges 3ab4 and 3ab4 between them. +o it is called as a parallel edge.
6ulti Graph graph having parallel edges is !nown as a 6ultigraph.
()ample 9
In the above graph, there are five edges 3ab4, 3ac4, 3cd4, 3cd4, and 3bd4. +ince 3c4 and 3d4 have two parallel edges between them, it a 6ultigraph.
()ample :
In the above graph, the vertices 3b4 and 3c4 have two edges. The vertices 3e4 and 3d4 also have two edges between them. 2ence it is a 6ultigraph.
/egree +eBuence of a Graph If the degrees of all vertices in a graph are arranged in descending or ascending order, then the seBuence obtained is !nown as the degree seBuence of the graph.
()ample 9
Verte#
b
c
d
e
Connecting to
b,c
a,d
a,d
c,b,e
d
'egree
:
:
:
=
9
In the above graph, for the vertices &d, a, b, c, e', the degree seBuence is &=, :, :, :, 9'.
()ample :
Verte#
b
Connecting to
b,e
'egree
:::::>
a,c
c
d
e
f
b,d
c,e
a,d
-
In the above graph, for the vertices &a, b, c, d, e, f', the degree seBuence is &:, :, :, :, :, >'.
Graph Theory - Aasic roperties Graphs come with various properties which are used for characteri*ation of graphs depending on their structures. These properties are defined in specific terms pertaining to the domain of graph theory. In this chapter, we will discuss a few basic properties that are common in all graphs.
/istance between Two $ertices It is number of edges in a shortest path between $erte) ; and $erte) $. If there are multiple paths connecting two vertices, then the shortest path is considered as the distance between the two vertices. Notation # d7;,$8 There can be any number of paths present from one verte) to other. mong those, you need to choose only the shortest one.
()ample Ta!e a loo! at the following graph #
2ere, the distance from verte) 3d4 to verte) 3e4 or simply 3de4 is 9 as there is one edge between them. There are many paths from verte) 3d4 to verte) 3e4 # •
da, ab, be
•
df, fg, ge
•
de 7It is considered for distance between the vertices8
•
df, fc, ca, ab, be
•
da, ac, cf, fg, ge
(ccentricity of a$erte) The ma)imum distance between a verte) to all other vertices is considered as the eccentricity of verte). Notation # e7$8
The distance from a particular verte) to all other vertices in the graph is ta!en and among those distances, the eccentricity is the highest of distances.
()ample In the above graph, the eccentricity of 3a4 is =. The distance from 3a4 to 3b4 is 9 73ab48, from 3a4 to 3c4 is 9 73ac48, from 3a4 to 3d4 is 9 73ad48, from 3a4 to 3e4 is : 73ab4-3be48 or 73ad4-3de48, from 3a4 to 3f4 is : 73ac4-3cf48 or 73ad4-3df48, from 3a4 to 3g4 is = 73ac4-3cf4-3fg48 or 73ad4-3df4-3fg48. +o the eccentricity is =, which is a ma)imum from verte) 3a4 from the distance between 3ag4 which is ma)imum. In other words, e7b8 % = e7c8 % = e7d8 % : e7e8 % = e7f8 % = e7g8 % =
1adius of a
Notation # r7G8
"rom all the eccentricities of the vertices in a graph, the radius of the connected graph is the minimum of all those eccentricities. E#ample # In the above graph r7G8 % :, which is the minimum eccentricity for 3d4.
/iameter of a Graph The ma)imum eccentricity from all the vertices is considered as the diameter of the Graph G. The ma)imum among all the distances between a verte) to all other vertices is considered as the diameter of the Graph G. Notation # d7G8 "rom all the eccentricities of the vertices in a graph, the diameter of the connected graph is the ma)imum of all those eccentricities. E#ample # In the above graph, d7G8 % =C which is the ma)imum eccentricity.
E#ample # In the e)ample graph, the circumference is D, which we derived from the longest cycle a-c-f-g-e-b-a or a-c-f-d-e-b-a.
Girth The number of edges in the shortest cycle of 3G4 is called its Girth. Notation # g7G8. E#ample # In the e)ample graph, the Girth of the graph is E, which we derived from the shortest cycle a-c-f-d-a or d-f-g-e-d or a-b-e-d-a.
+um of /egrees of $ertices Theorem If G % 7$, (8 be a non-directed graph with vertices $ % &$ 9, $:,F$n' then
i+" deg(Vi) + -E-
n
i+" deg.(Vi) + -E- + ni+" deg/(Vi)
n
Graph Theory - Types of Graphs
There are various types of graphs depending upon the number of vertices, number of edges, interconnectivity, and their overall structure. We will discuss only a certain few important types of graphs in this chapter.
0ull Graph grap! !aving no edges is called a 0ull Graph.
()ample
In the above graph, there are three vertices named 3a4, 3b4, and 3c4, but there are no edges among them. 2ence it is a 0ull Graph.
Trivial Graph grap! wit! onl one verte# is called a Trivial Graph.
()ample
In the above shown graph, there is only one verte) 3a4 with no other edges. 2ence it is a Trivial graph.
0on-/irected Graph non-directed graph contains edges but the edges are not directed ones.
()ample
In this graph, 3a4, 3b4, 3c4, 3d4, 3e4, 3f4, 3g4 are the vertices, and 3ab4, 3bc4, 3cd4, 3da4, 3ag4, 3gf4, 3ef4 are the edges of the graph. +ince it is a non-directed graph, the edges 3ab4 and 3ba4 are same. +imilarly other edges also considered in the same way.
/irected Graph In a directed graph, each edge has a direction.
()ample
In the above graph, we have seven vertices 3a4, 3b4, 3c4, 3d4, 3e4, 3f4, and 3g4, and eight edges 3ab4, 3cb4, 3dc4, 3ad4, 3ec4, 3fe4, 3gf4, and 3ga4. s it is a directed graph, each edge bears an arrow mar! that shows its direction. 0ote that in a directed graph, 3ab4 is different from 3ba4.
+imple Graph graph wit! no loops and no parallel edges is called a simple graph. •
The ma)imum number of edges possible in a single graph with 3n4 vertices is n<: where n<: % n7n L 98M:.
•
The number of simple graphs possible with 3n4 vertices % : nc: % :n7n-98M:.
()ample In the following graph, there are = vertices with = edges which is ma)imum e)cluding the parallel edges and loops. This can be proved by using the above formulae.
The ma)imum number of edges with n%= vertices # n
C2 = n(n–1)/2 = 3(3–1)/2 = 6/2 = 3 edges
The ma)imum number of simple graphs with n%= vertices # 2nC2 = 2n(n-1)/2 = 23(3-1)/2 = 23 =8
These N graphs are as shown below #
()ample In the following graph, each verte) has its own edge connected to other edge. 2ence it is a connected graph.
/isconnected Graph graph G is disconnected, if it does not contain at least two connected vertices.
()ample 9 The following graph is an e)ample of a /isconnected Graph, where there are two components, one with 3a4, 3b4, 3c4, 3d4 vertices and another with 3e4, 4f4, 3g4, 3h4 vertices.
The two components are independent and not connected to each other. 2ence it is called disconnected graph.
()ample :
In this e)ample, there are two independent components, a-b-f-e and c-d, which are not connected to each other. 2ence this is a disconnected graph.
1egular Graph graph G is said to be regular, i all its vertices !ave t!e same degree . In a graph, if the degree of each verte) is 3!4, then the graph is called a 3!-regular graph4.
()ample
In the following graphs, all the vertices have the same degree. +o these graphs are called regular graphs.
In both the graphs, all the vertices have degree :. They are called :-1egular Graphs.
()ample In the following graphs, each verte) in the graph is connected with all the remaining vertices in the graph e)cept by itself.
In graph I, a
b
c
a
0ot
b
0ot
c
0ot
In graph II, p1rs
p
0ot
1
0ot
r
0ot
s
0ot
then it is called a
Graph. Notation #
()ample Ta!e a loo! at the following graphs # •
Graph I has = vertices with = edges which is forming a cycle 3ab-bc-ca4.
•
Graph II has E vertices with E edges which is forming a cycle 3pB-Bs-sr-rp4.
•
Graph III has J vertices with J edges which is forming a cycle 3i!-!m-ml-lj-ji4.
2ence all the given graphs are cycle graphs.
Wheel Graph wheel graph is obtained from a cycle graph <
n-9
by adding a new verte). That
new verte) is called a 2ub which is connected to all the vertices of < n. Notation # Wn No. of edges in Wn = No. of edges from !" #o $%% o#er ver#i&es ' No. of edges from $%% o#er nodes in &&%e gr$ *i#o!# $ !". = (n–1) ' (n–1) = 2(n–1)
()ample Ta!e a loo! at the following graphs. They are all wheel graphs.
In graph I, it is obtained from < = by adding an verte) at the middle named as 3d4. It is denoted as WE. N!m"er of edges in W+ = 2(n-1) = 2(3) = 6
In graph II, it is obtained from < E by adding a verte) at the middle named as 3t4. It is denoted as WJ.
N!m"er of edges in W, = 2(n-1) = 2(+) = 8
In graph III, it is obtained from < D by adding a verte) at the middle named as 3o4. It is denoted as WP. N!m"er of edges in W+ = 2(n-1) = 2(6) = 12
In the above e)ample graph, we have two cycles a-b-c-d-a and c-f-g-e-c. 2ence it is called a cyclic graph.
cyclic Graph graph wit! no ccles is called an acyclic graph.
()ample
In the above e)ample graph, we do not have any cycles. 2ence it is a non-cyclic graph.
Aipartite Graph
simple graph G % 7$, (8 with verte) partition $ % &$
, $:' is called a bipartite
9
graph i ever edge o E &oins a verte# in V " to a verte# in V . In general, a Aipertite graph has two sets of vertices, let us say, $ 9 and $ :, and if an edge is drawn, it should connect any verte) in set $ 9 to any verte) in set $ :.
()ample
In this graph, you can observe two sets of vertices # $
9
and $ :. 2ere, two edges
named 3ae4 and 3bd4 are connecting the vertices of two sets $ 9 and $:.
9
to each
verte) from set $ :.
()ample The following graph is a complete bipartite graph because it has edges connecting each verte) from set $9 to each verte) from set $ :.
If H$9H % m and H$:H % n, then the complete bipartite graph is denoted by m, n. •
m,n has 7mn8 vertices and 7mn8 edges.
•
m,n is a regular graph if m%n.
In general, a complete bipartite grap! is not a complete grap!. m,n is a complete graph if m%n%9.
The ma)imum number of edges in a bipartite graph with n vertices is Q n2E R
If n%9>, !J, J% n2E % 102E % :J +imilarly D, E%:E P, =%:9 N, :%9D S, 9%S If n%S, !J, E % n2E % 92E % :> +imilarly D, =%9N P, :%9E N, 9%N 3G4 is a bipartite graph if 3G4 has no cycles of odd length. special case of bipartite graph is a star grap!.
+tar Graph complete bipartite graph of the form 9, n-9 is a star graph with n-vertices. star graph is a complete bipartite graph if a single verte) belongs to one set and all the remaining vertices belong to the other set.
()ample
In the above graphs, out of 3n4 vertices, all the 3nL94 vertices are connected to a single verte). 2ence it is in the form of 9, n-9 which are star graphs.
()ample In the following e)ample, graph-I has two edges 3cd4 and 3bd4. Its complement graph-II has four edges.
0ote that the edges in graph-I are not present in graph-II and vice versa. 2ence, the combination of both the graphs gives a complete graph of 3n4 vertices. Note # combination of two complementary graphs gives a complete graph. If 3G4 is any simple graph, then H(7G8H H(7'G-'8H % H(7n8H, where n % number of vertices in the graph.
()ample 5et 3G4 be a simple graph with nine vertices and twelve edges, find the number of edges in 'G-'. ou have, H(7G8H H(7'G-'8H % H(7n8H -
9: H(7'G '8H %
S7S-98 M : % S<:
9: H(7'G-'8H % =D H(7'G-'8H % :E 3G4 is a simple graph with E> edges and its complement 'G−' has =N edges. "ind the number of vertices in the graph G or 'G−'. 5et the number of vertices in the graph be 3n4. We have, H(7G8H H(7'G-'8H % H(7n8H E> =N % n7n-98: 9JD % n7n-98 9=79:8 % n7n-98 n % 9=
Graph Theory - Trees Trees are graphs that do not contain even a single cycle. They represent hierarchical structure in a graphical form. Trees belong to the simplest class of graphs. /espite their simplicity, they have a rich structure. Trees provi de a range of useful applications as simple as a family tree to as comple) as trees in data structures of computer science.
Tree connected acclic grap! is called a tree. In other words, a connected graph with no cycles is called a tree. The edges of a tree are !nown as branc!es. (lements of trees are called theirnodes. The nodes without child nodes are called lea nodes. tree with 3n4 vertices has 3n-94 edges. If it has one more edge e)tra than 3n-94, then the e)tra edge should obviously has to pair up with two vertices which leads to form a cycle. Then, it becomes a cyclic graph which is a violation for the tree graph.
()ample 9 The graph shown here is a tree because it has no cycles and it is connected. It has four vertices and three edges, i.e., for 3n4 vertices 3n-94 edges as mentioned in the definition.
Note # (very tree has at least two vertices of degree one.
()ample :
In the above e)ample, the vertices 3a4 and 3d4 has degree one. nd the other two vertices 3b4 and 3c4 has degree two. This is possible because for not forming a cycle, there should be at least two single edges anywhere in the graph. It is nothing but two edges with a degree of one.
"orest disconnected acclic grap! is called a forest. In other words, a disjoint collection of trees is called a forest.
()ample The following graph loo!s li!e two sub-graphsC but it is a single disconnected graph. There are no cycles in this graph. 2ence, clearly it is a forest.
+panning Trees
5et G be a connected graph, then the sub-graph 2 of G is called a spanning tree of G if # •
2 is a tree
•
2 contains all vertices of G.
spanning tree T of an undirected graph G is a subgraph that includes all of the vertices of G.
()ample
In the above e)ample, G is a connected graph and 2 is a sub-graph of G.
()ample
Ta!e a loo! at the following graph #
"or the graph given in the above e)ample, you have m%P edges and n%J vertices. Then the circuit ran! is G = m – (n – 1) = – (, – 1) =3
()ample 5et 3G4 be a connected graph with si) vertices and the degree of each verte) is three. "ind the circuit ran! of 3G4. Ay the sum of degree of vertices theorem,
i+" deg(Vi) + -E-
n
D U = % :H(H H(H % S
irchoff4s Theorem irchoff4s theorem is useful in finding the number of spanning trees that can be formed from a connected graph.
()ample
The matri) 34 be filled as, if there is an edge between two vertices, then it should be given as 394, else 3>4.
Graph Theory -
connected i t!ere is a pat! between ever pair o
verte#. "rom every verte) to any other verte), there should be some path to
traverse. That is called the connectivity of a graph. graph with multiple disconnected vertices and edges is said to be disconnected.
()ample 9 In the following graph, it is possible to travel from one verte) to any other verte). "or e)ample, one can traverse from verte) 3a4 to verte) 3e4 using the path 3a-b-e4.
()ample : In the following e)ample, traversing from verte) 3a4 to verte) 3f4 is not possible because there is no path between them directly or indirectly. 2ence it is a disconnected graph.
()ample In the following graph, vertices 3e4 and 3c4 are the cut vertices.
Ay removing 3e4 or 3c4, the graph will become a disconnected graph.
Without 3g4, there is no path between verte) 3c4 and verte) 3h4 and many other. 2ence it is a disconnected graph with cut verte) as 3e4. +imilarly, 3c4 is also a cut verte) for the above graph.
()ample In the following graph, the cut edge is Q7c, e8R
Ay removing the edge 7c, e8 from the graph, it becomes a disconnected graph.
In the above graph, removing the edge 7c, e8 brea!s the graph into two which is nothing but a disconnected graph. 2ence, the edge 7c, e8 is a cut edge of the graph. Note # 5et 3G4 be a connected graph with 3n4 vertices, then •
a cut edge e ∈ G if and only if the edge 3e4 is not a part of any cycle in G.
•
the ma)imum number of cut edges possible is 3n-94.
•
whenever cut edges e)ist, cut vertices also e)ist because at least one verte) of a cut edge is a cut verte).
•
if a cut verte) e)ists, then a cut edge may or may not e)ist.
()ample Ta!e a loo! at the following graph. Its cut set is (9 % &e9, e=, eJ, eN'.
fter removing the cut set (9 from the graph, it would appear as follows #
+imilarly there are other cut sets that can disconnect the graph # •
(= % &eS' L +mallest cut set of the graph.
•
(E % &e=, eE, eJ'
(dge
Notation # V7G8 In other words, the number o edges in a smallest cut set o G is called the edge connectivity of G. If 3G4 has a cut edge, then λ(G is 9. 7edge connectivity of G.8
()ample Ta!e a loo! at the following graph. Ay removing two minimum edges, the connected graph becomes disconnected. 2ence, its edge connectivity 7V7G88 is :.
2ere are the four ways to disconnect the graph by removing two edges #
$erte)
()ample In the above graph, removing the vertices 3e4 and 3i4 ma!es the graph disconnected.
If G has a cut verte), then 7G8 % 9. Notation # "or any connected graph G, 7G8 V7G8 7G8 $erte) connectivity 77G88, edge connectivity 7V7G88, minimum number of degrees of G77G88.
()ample
Solution "rom the graph, 7G8 % = 7G8 V7G8 7G8 % = 798 7G8 K : 7:8 /eleting the edges &d, e' and &b, h', we can disconnect G. Therefore,
V7G8 % : : V7G8 7G8 % : 7=8 "rom 7:8 and 7=8, verte) connectivity 7G8 % :
Graph Theory -
covering graph is a subgraph which contains either all the vertices or all the edges corresponding to some other graph. subgraph which contains all the vertices is called a line3edge covering. subgraph which contains all the edges is called a verte# covering.
5ine
()ample Ta!e a loo! at the following graph #
Its subgraphs having line covering are as follows # C1 C2 C3 C+
= = = =
00$ 00$ 00$ 00$
" 0& d d 0" & " 0" & 0" d " 0" & 0& d
5ine covering of 3G4 does not e)ist if and only if 3G4 has an isolated verte). 5ine covering of a graph with 3n4 vertices has at least n: edges.
6inimal 5ine
i no edge can be deleted
rom C.
()ample In the above graph, the subgraphs having line covering are as follows # C1 C2 C3 C+
= = = =
00$ 00$ 00$ 00$
" 0& d d 0" & " 0" & 0" d " 0" & 0& d
2ere, < 9, < :, <= are minimal line coverings, while < E is not because we can delete &b, c'.
6inimum 5ine
line covering
number of 3G4 7X98.
()ample In the above e)ample, < 9 and <: are the minimum line covering of G and X 9 % :. •
(very line covering contains a minimal line covering.
•
(very line covering does not contain a minimum line covering 7< = does not contain any minimum line covering.
•
0o minimal line covering contains a cycle.
•
If a line covering 3<4 contains no paths of length = or more, then 3<4 is a minimal line covering because all the components of 3<4 are star graph and from a star graph, no edge can be deleted.
$erte)
()ample
Ta!e a loo! at the following graph #
The subgraphs that can be derived from the above graph are as follows # 1 = 0" & 2 = 0$ " & 3 = 0" & d + = 0$ d
2ere, 9, :, and = have verte) covering, whereas
E
does not have any verte)
covering as it does not cover the edge &bc'.
6inimal $erte)
()ample In the above graph, the subgraphs having verte) covering are as follows # 9 % &b, c' : % &a, b, c' = % &b, c, d' 2ere, 9 and : are minimal verte) coverings, whereas in =, verte) 3d4 can be deleted.
6inimum $erte)
()ample In the following graph, the subgraphs having verte) covering are as follows # 9 % &b, c' : % &a, b, c' = % &b, c, d'
2ere, 9 is a minimum verte) cover of G, as it has only two vertices. X : % :.
Graph Theory - 6atchings matching graph is a subgraph of a graph where there are no edges adjacent to each other. +imply, there should not be any common verte) between any two edges.
6atching 5et 3G4 % 7$, (8 be a graph. subgraph is called a matching 67G8, i eac! verte# o G is incident wit! at most one edge in 4, i.e., deg7$8 9
$
∀
G
∈
which means in the matching graph 67G8, the vertices should have a degree of 9 or >, where the edges should be incident from the graph G. Notation # 67G8
()ample
In a matching, if deg7$8 % 9, then 7$8 is said to be matched if deg7$8 % >, then 7$8 is not matched. In a matching, no two edges are adjacent. It is because if any two edges are adjacent, then the degree of the verte) which is joining those two edges will have a degree of : which violates the matching rule.
6a)imal 6atching matching 6 of graph 3G4 is said to ma)imal added to 4 .
()ample
i no ot!er edges o G* can be
69, 6:, 6= from the above graph are the ma)imal matching of G.
6a)imum 6atching It is also !nown as largest ma)imal matching. 6a)imum matching is defined as the ma)imal matching with ma)imum number of edges. The number of edges in the ma)imum matching of 3G4 is called its number.
()ample
matc!ing
"or a graph given in the above e)ample, 69 and 6: are the ma)imum matching of 3G4 and its matching number is :. 2ence by using the graph G, we can form only the subgraphs with only : edges ma)imum. 2ence we have the matching number as two.
erfect 6atching matching 768 of graph 7G8 is said to be a perfect match,
i ever verte# o
grap! g (G) is incident to e#actl one edge o t!e matc!ing (4), i.e., deg7$8 % 9 ∀ $ The degree of each and every verte) in the subgraph should have a degree of 9.
()ample In the following graphs, 6 9 and 6: are e)amples of perfect matching o f G.
Note # (very perfect matching of graph is also a ma)imum matching of graph, because there is no chance of adding one more edge in a perfect matching graph. ma)imum matching of graph need not be perfect. If a graph 3G4 has a perfect match, then the number of vertices H$7G8H is even. If it is odd, then the last verte) pairs with the other verte), and finally there remains a single verte) which cannot be paired with any other verte) for which the degree is *ero. It clearly violates the perfect matching principle.
()ample
Note # The converse of the above statement need not be true. If G has even number of vertices, then 69 need not be perfect.
()ample
It is matching, but it is not a perfect match, even though it has even number of vertices.
Graph Theory - Independent +ets Independent sets are represented in sets, in which •
there should not be an edges ad&acent to eac! ot!er . There should not be any common verte) between any two edges.
•
there should not be an vertices ad&acent to eac! ot!er . There should not be any common edge between any two vertices.
Independent 5ine +et 5et 3G4 % 7$, (8 be a graph. subset 5 of ( is called an independent line set of 3G4 if two edges in 5 are adjacent. +uch a set is called an independent line set.
()ample
5et us consider the following subsets # 41 = 0$" 42 = 0$" 0&e 43 = 0$d 0"&
In this e)ample, the subsets 5
:
and 5 = are clearly not the adjacent edges in the
given graph. They are independent line sets. 2owever 5 9 is not an independent line set, as for ma!ing an independent line set, there should be at least two edges.
6a)imal Independent 5ine +et n independent line set is said to be the ma)imal independ ent line set of a graph 3G4 if no other edge of 3G4 can be added to 354.
()ample
5et us consider the following subsets # 41 = 0$ " 42 = 00" e 0& f 43 = 00$ e 0" & 0d f 4+ = 00$ " 0& f
5: and 5 = are ma)imal independ ent line setsMma)ima l matching. s for only these two subsets, there is no chance of adding any other edge which is not an adjacent. 2ence these two subsets are considered as the ma)imal independent line sets.
6a)imum Independent 5ine +et ma)imum independent line set of 3G4 with ma)imum number of edges is called a ma)imum independent line set of 3G4. N!m"er of edges in $ m$5im!m indeenden# %ine se# of G ( 1) = 4ine indeenden# n!m"er of G = 7$#&ing n!m"er of G
()ample
5et us consider the following subsets # 41 = 0$ " 42 = 00" e 0& f 43 = 00$ e 0" & 0d f 4+ = 00$ " 0& f
5= is the ma)imum independent line set of G with ma)imum edges which are not the adjacent edges in graph and is denoted by 5" % =. Note # "or any graph G with no isolated verte), X9 Y9 % number of vertices in a graph % H$H
()ample 5ine covering number of nM
5ine independent number 76atching number8 % 5" + ⌊n⌋ 6" . 5" + n
Independent $erte) +et 5et 3G4 % 7$, (8 be a graph. subset of 3$4 is called an independent set of 3G4 if no two vertices in 3+4 are adjacent.
()ample
= = = =
0e 0e f 0$ g & 0e d
6a)imal Independent $erte) +et 5et 3G4 be a graph, then an independent verte) set of 3G4 is said to be ma)imal if no other verte) of 3G4 can be added to 3+4.
()ample
= = = =
0e 0e f 0$ g & 0e d
+: and + = are ma)imal independent verte) sets of 3G4. In +
9
and + E, we can add
other verticesC but in + : and +=, we cannot add any other verte)
6a)imum Independent $erte) +et ma)imal independent verte) set of 3G4 with ma)imum number of vertices is called as the ma)imum independent verte) set.
()ample
= = = =
0e 0e f 0$ g & 0e d
@nly + = is the ma)imum independent verte) set, as it covers the highest number of vertices. The number of vertices in a ma)imum independent verte) set of 3G4 is called the independent verte) number of G 7Y :8.
()ample 9or #e &om%e#e gr$ n :er#e5 &overing n!m"er = ; 2 = n<1 :er#e5 indeenden# n!m"er = 2 = 1 o! $ve ; 2 ' 2 = n >n $ &om%e#e gr$ e$& ver#e5 is $d?$&en# #o i#s rem$ining (n < 1) ver#i&es. @erefore $ m$5im!m indeenden# se# of n &on#$ins on% one ver#e5. @erefore 2=1 $nd ;2=AvA < 2 = n-1
Note # "or any graph 3G4 % 7$, (8 •
X: Y: % HvH
•
If 3+4 is an independent verte) set of 3G4, then 7$ L +8 is a verte) cover of G.
Graph Theory -
$erte)
()ample
G is a null graph. If
G is not a
null graph, then [7G8
Note # graph 3G4 is said to be n-coverable if there is a verte) coloring that uses at most n colors, i.e., Z7G8 n.
1egion
()ample Ta!e a loo! at the following graph. The regions 3aeb4 and 3befc4 are adjacent, as there is a common edge 3be4 between those two regions.
+imilarly the other regions are also coloured based on the adjacency. This graph is coloured as follows #
()ample The chromatic number of n is a8 n b8 nL9 c8 n: d8 Bn:
In the complete graph, each verte) is adjacent to remaining 7n L 98 vertices. 2ence, each verte) reBuires a new color. 2ence the chromatic number of n % n.
pplications of Graph
•
/ata mining
•
Image capturing
•
Image segmentation
•
0etwor!ing
•
1esource allocation
•
rocesses scheduling
Graph Theory - Isomorphism
graph can e)ist in different forms having the same number of vertices, edges, and also the same edge connectivity. +uch graphs are called isomorphic graphs. 0ote that we label the graphs in this chapter mainly for the purpose of referring to them and recogni*ing them from one another.
Isomorphic Graphs Two graphs G9 and G: are said to be isomorphic if # •
Their number of components 7vertices and edges8 are same.
•
Their edge connectivity is retained.
Note # In short, out of the two isomorphic graphs, one is a twea!ed version of the other. n unlabelled graph also can be thought of as an isomorphic graph. @ere e5is#s $ f!nion DfE from ver#i&es of G1 #o ver#i&es of G2 Ff :(G 1) H :(G2)I s!& #$# C$se (i) f is $ "i?eion ("o# one-one $nd on#o) C$se (ii) f reserves $d?$&en& of ver#i&es i.e. if #e edge 0J : ∈ 1G #en #e edge 0f(J) f(:) ∈ G 2 #en G1 K G2.
Note If G9 \ G: then # •
H$7G98H % H$7G:8H
•
H(7G98H % H(7G:8H
•
/egree seBuences of G9 and G: are same.
•
If the vertices &$9, $ :, .. $!' form a cycle of length in G 9, then the vertices &f7$ 98, f7$:8,F f7$!8' should form a cycle of length in G:.
ll the above conditions are necessary for the graphs G 9 and G : to be isomorphic, but not sufficient to prove that the graphs are isomorphic. •
7G9 K G:8 if and only if 7G1− K G2−8 where G9 and G: are simple graphs.
•
7G9 K G:8 if the adjacency matrices of G 9 and G: are same.
•
7G9 K G:8 if and only if the corr esponding subgr aphs of G
9
and G :7obtained by
deleting some vertices in G 9 and their images in graph G :8 are isomorphic.
()ample Which of the following graphs are isomorphic?
In the graph G=, verte) 3w4 has only degree =, whereas all the other graph vertices has degree :. 2ence G= not isomorphic to G 9 or G:. Ta!ing complements of G9 and G:, you have #
2ere, 7G1− \ G2−8, hence 7G9 \ G:8.
lanar Graphs graph 3G4 is said to be planar if it can be drawn on a plane or a sphere so that no two edges cross each other at a non-verte) point.
()ample
1egions (very planar graph divides the plane into connected areas called regions.
()ample
/egree of a bounded region r + deg(r) % 0umber of edges enclosing the regions r. deg(1) = 3 deg(2) = + deg(3) = + deg(+) = 3 deg(,) = 8
/egree of an unbounded region
r + deg(r) % 0umber of edges enclosing the
regions r. deg(L1) = + deg(L2) = 6
In planar graphs, the following properties hold good # •
"7 In a planar graph with 3n4 vertices, sum of degrees of all the vertices is
n •
i+" deg(Vi) + -E-
7 ccording to Sum o 'egrees o 8egions Theorem, in a planar graph with 3n4 regions, +um of degrees of regions is #
i+" deg(ri) + -E-
n
Aased on the above theorem, you can draw the following conclusions # In a planar graph, •
If degree of each region is , then the sum of degrees of regions is H1H % :H(H
•
If the degree of each region is at least 7K 8, then H1H :H(H
•
If the degree of each region is at most 7 8, then H1H K :H(H
Note # ssume that all the regions have same degree. 97 ccording to Euler*s :ormulae on planar graphs, •
If a graph 3G4 is a connected planar, then H$H H1H % H(H :
•
If a planar graph with 34 components then H$H H1H%H(H 798
Where, H$H is the number of vertices, H(H is the number of edges, and H1H is the number of regions. ;7 Edge Verte# $ne1ualit If 3G4 is a connected planar graph with degree of each region at least 34 then, H(H !! − 2&HvH - :' ou !now, H$H H1H % H(H : .H1H :H(H 7H(H - H$H :8 :H(H
7 - :8H(H 7H$H - :8 H(H !! − 2&HvH - :' <7 $ G* is a simple connected planar grap!, t!en AMA ≤ 3A:A < 6 ALA ≤ 2A:A < +
There e)ists at least one verte) $
∈ G, such that deg7$8 J
=7 $ G* is a simple connected planar grap! (wit! at least edges) and no triangles, t!en AMA ≤ 02A:A – +
>7 0uratowski*s ?!eorem graph 3G4 is non-planar if and only if 3G4 has a subgraph which is homeomorphic to J or =,=.
2omomorphism Two graphs G9 and G : are said to be homomorphic, if each of these graphs can be obtained from the same graph 3G4 by dividing some edges of G with more vertices. Ta!e a loo! at the following e)ample #
/ivide the edge 3rs4 into two edges by adding one verte).
The graphs shown below are homomorphic to the first graph.
If G9 is isomorphic to G :, then G is homeomorphic to G : but the converse need not be true. •
ny graph with E or less vertices is planar.
•
ny graph with N or less edges is planar.
•
complete graph n is planar if and only if n E.
•
The complete bipartite graph m, n is planar if and only if m : or n :.
•
simple non-planar graph with minimum number of vertices is the complete graph J.
•
The simple non-planar graph with minimum number of edges is =, =.
olyhedral graph simple connected planar graph is called a polyhedral graph if the degree of each verte) is K =, i.e., deg7$8 K = •
=H$H :H(H
•
=H1H :H(H
∀ $ ∈ G.
Graph Theory - Traversability graph is traversable if you can draw a path between all the vertices without retracing the same path. Aased on this path, there are some categories li!e (uler4s path and (uler4s circuit which are described in this chapter.
(uler4s ath n (uler4s path contains each edge of 3G4 e)actly once and each verte) of 3G4 at least once. connected graph G is said to be traversable if it contains an (uler4s path.
()ample
Euler*s @at! % d-c-a-b-d-e.
(uler4s
()ample
Euler*s @at! % a-b-c-d-a-g-f-e-c-a.
(uler4s . connected graph G can contain an (uler4s path, but not an (uler4s circuit, if it has e)actly two vertices with an odd degree. Note # This (uler path begins with a verte) of odd degree and ends with the other verte) of odd degree.
()ample
Euler*s @at! # b-e-a-b-d-c-a is not an (uler4s circuit, but it is an (uler4s path. , then (uler4s circuit e)ists.
2amiltonian Graph connected graph G is said to be a 2amiltonian graph, if there e)ists a cycle which contains all the vertices of G. (very cycle is a circuit but a circuit may contain multiple cycles. +uch a cycle is called a 2amiltonian ccle of G.
2amiltonian ath connected graph is said to be 2amiltonian if it contains each verte) of G e)actly once. +uch a path is called a 2amiltonian pat!.
()ample
2amiltonian @at! # e-d-b-a-c. Note # •
(uler4s circuit contains each edge of the graph e)actly once.
•
In a 2amiltonian cycle, some edges of the graph can be s!ipped.
()ample Ta!e a loo! at the following graph #
"or the graph shown above # •
(uler path e)ists L false
•
(uler circuit e)ists L false
•
2amiltonian cycle e)ists L true
•
2amiltonian path e)ists L true
G has four vertices with odd degree, hence it is not traversable. Ay s!ipping the internal edges, the graph has a 2amiltonian cycle passing through all the vertices.
Graph Theory - ()amples
In this chapter, we will cover a few standard e)amples to demonstrate the concepts we already discussed in the earlier chapters.
()ample 9 :ind t!e number o spanning trees in t!e ollowing grap!7
+olution The number of spanning trees obtained from the above graph is =. They are as follows #
These three are the spanning trees for the given graphs. 2ere the graphs I and II are isomorphic to each other.
()ample : 2ow man simple nonisomorp!ic grap!s are possible wit! 9 verticesB
+olution There are E non-isomorphic graphs possible with = vertices. They are shown below.
()ample = Let G* be a connected planar grap! wit! vertices and t!e degree o eac! verte# is 97 :ind t!e number o regions in t!e grap!7
+olution Ay the sum of degrees theorem,
i%9 deg7$ 8 % :H(H
:>
i
:>7=8 % :H(H H(H % => Ay (uler4s formula, H$H H1H % H(H : :> H1H % => : H1H % 9: 2ence, the number of regions is 9:.
()ample E D!at is t!e c!romatic number o complete grap! 0 nB
+olution
In a complete graph, each verte) is adjacent to is remaining 7nL98 vertices. 2ence, each verte) reBuires a new color. 2ence the chromatic number "n # n.
()ample J D!at is t!e matc!ing number or t!e ollowing grap!B
+olution
0umber of vertices % S We can match only N vertices. 6atching number is E.
()ample D D!at is t!e line covering number o or t!e ollowing grap!B
+olution
0umber of vertices % H$H % n % P 5ine covering number % 7X 98 K Bn: % = X9 K = Ay using = edges, we can cover all the vertices. 2ence, the line covering number is =.