DSGTChap 6 Graph Theory
DSGTChap 6 Graph Theory
GRAPH THEORY
B Y P R O F. M I T R A K S H I PAT I L
GRAPH
• Null Graph- A null graph has no edges. The null graph of n vertices is denoted by Nn.
• Simple Graph- A graph is called simple graph/strict graph if the graph is undirected and
does not contain any loops or multiple edges.
• Multi-Graph- If in a graph multiple edges between the same set of vertices are allowed, it
is called Multigraph. In other words, it is a graph having at least one loop or multiple
edges.
• Connected and disconnected graph- A graph is called connected, if there is a path from
any vertex to any other vertex in the graph. A graph is called disconnected if there
is no path between any two of its vertices.
• Discrete Graph- A graph Dn with n vertices & no edges is called discrete graph on n
vertices.
• Complete graph-For each integer n≥1, let Kn denote graph with vertices
{V1,V2,V3…Vn} with an edge {Vi,Vj} for every i & j. In other words, every vertex in Kn is
connected to every other vertex.
• Linear Graph-For each integer n ≥1, let Ln denote graph with vertices {V1,V2,V3…Vn}
with an edge {Vi,Vi+1} for 1≤i≤n .
• Directed graph- A directed graph or digraph is an ordered pair (V,E) where V is non-
empty set of elts called vertices & E is set of ordered pair elts called directed edges.
• Labelled or Weighted graph- A graph G is called a labelled graph if its edges and/or
vertices are assigned data of one kind or another.
• G is called weighted graph if each edge ‘e’ of G is assigned a non-negative number called
the weight or length of V .
REPRESENTATION OF GRAPHS
• There are mainly two ways to represent a graph −
• Adjacency Matrix
• Adjacency List
1. Adjacency Matrix of an- Undirected Graph
• Adjacency List of an undirected graph-
SUBGRAPH
• Consider a graph G with e number of edges & n number of vertices. Since each edge
contribute 2 degrees, the sum of degrees of all vertices in G is twice the number of
edges in G.
• How many nodes are necessary to construct a graph with exactly 6 edges in which each
node is of degree 2?
• Soln-
Suppose, there are n vertices, in graph with 6 edges.
Also, given degree of each vertex is 2.
So, by Handshaking lemma,
=2*6
d(V1)+ d(V2)+ d(V3)+… d(Vn)=2*6
2+2+….+2 =12
2n =12 So, n=6 nodes
EULAR PATHS & CIRCUITS
A Path in a graph is called an Eular path if it includes every edge exactly once.
Solution- 2 vertices B & C have odd degree 3. So, no Eu ckt by thm 1a.
π=B,A,E,D,C,B,D,A,C
Example3-
Find Eular path & circuit for the foll. Graph.
1. 4 vertices of odd degree, so there is NO Eular ckt & path by
thm 1a,1b & 2b.
HAMILTONIAN PATHS & CIRCUITS
• A Hamiltonian path is a path that contains each vertex exactly once.
• A Hamiltonian ckt is a ckt that contains each vertex exactly once except for the first
vertex which is also the last.
• Method-
1. Start with an arbitrary vertex & find the vertex to closest to starting vertex to form
an initial path of one edge.
2. Let, x’ denote latest vertex added to the path along all vertices that are not in path,
pick one that is closest to z & add to the path the edge connecting x & this vertex.
Repeat step 2 until all the vertices in G are included in the path.
3. Form a ckt by adding the edge connecting starting vertex & the last vertex added.
• Example- Use Nearest Neighbor method to find out H. ckt for graph shown in fig.
Starting vertex a.
• Solution-
1. There are 4 adjacent vertices to ‘a’- b,c,d,e
But, near. Neigh. is c.
So, H. path={a.c}
4. H.path= {a,c,b,d,e}
• In fig, G1≅G2.
• One-to-one correspondence between both vertices are-1-a,2-b,4-d, 3-c
• Two isomorphic Graphs must have-
• Suppose, we draw a planar graph on plane & take a sharp knife to cut along edges ,then
the plane will be divided into pieces that are called the regions of the graph.
• A region of planar graph is defined to be an area of the plane that is bounded by edges &
is not further divided into subareas.
• Example-
• Note that cutting along edge a does not divide region 1 further.
• Also, edges b, c, d-no further regions.
• A region is said to be finite if its area is finite & is said to be infinite if its area is infinite.
• A planar graph-exactly 1 infinite region.
• Example2 : Consider the graph shown in Fig. Determine the number of regions, finite and
infinite regions.
• Solution: There are five regions in the above graph, i.e. r1,r2,r3,r4,r5.
There are four finite regions in the graph, i.e., r2,r3,r4,r5.
There is only one finite region, i.e., r1
THEOREM 1
For any connected planar graph,
1.
v-e+r=2 …………..eqn.1
Where v,e,r- no. of vertices,edges & regions of the graph.
Example-
• No. of ver.=6
• Edges=9
• Regions=7
So, according to the Eular’s formula,
v-e+r=2
6-9+7=2
4 ≠ 2. So, the graph is not planar. Also, there are crossing edges.
CUT VERTEX
• Cut Vertex
• Let 'G' be a connected graph. A vertex V ∈ G is called a cut vertex of 'G', if 'G-V'
(Delete 'V' from 'G') results in a disconnected graph. Removing a cut vertex from a
graph breaks it in to two or more graphs.
• Note − Removing a cut vertex may render a graph disconnected.
• A connected graph 'G' may have at most (n–2) cut vertices.
• Example
• In the following graph, vertices 'e' and 'c' are
the cut vertices.
• By removing 'e' or 'c', the graph will become a disconnected graph.
• Without ‘e', there is no path between vertex 'c' and vertex 'h' and many other. Hence
it is a disconnected graph with cut vertex as 'e'. Similarly, 'c' is also a cut vertex for
the above graph.
CUT EDGE
• Example
In the following graph, the cut edge is (c, e).
• By removing the edge (c, e) from the graph, it becomes a disconnected graph.
• In the above graph, removing the edge (c, e) breaks the graph into two which is nothing
but a disconnected graph.
• Hence, the edge (c, e) is a cut edge of the graph.
• Important Points-
• Let 'G' be a connected graph with 'n' vertices, then a cut edge e ∈ G if and only if the
edge 'e' is not a part of any cycle in G.
• The maximum number of cut edges possible is 'n-1’.
• Whenever cut edges exist, cut vertices also exist because at least one vertex of a cut
edge is a cut vertex.
• If a cut vertex exists, then a cut edge may or may not exist.
CUT SET
• Similarly there are other cut sets that can disconnect the graph −