SlideShare a Scribd company logo
1 of 42
Graph -Theory
by
Manash Kumar Mondal
M.Tech(CSE)
University of Kalyani
Outline
• Definition
• Finite and infinite graphs
• Directed and undirected graphs
• Degree
• Isolated vertex
• Pendent vertex
• Walks
• Null graphs
• Path
• Circuit
• Connected and disconnected
graph
• Euler's graph
• Hamiltonian path and circuit
• Trees
8/6/2018 Manash Kumar Mondal 2
• A graph G is a tuple consisting of a finite set V of vertices and a finite set E of
edges where each edge is an unordered pair of vertices. The two vertices associated
with an edge e are called the end-vertices of e. We often denote by (u,v), an edge
between two vertices u and v. We also denote the set of vertices of a graph G by
V(G) and the set of edges of G by E(G).A vertex of a graph is also called as a node
of a graph.
• Example-
8/6/2018 Manash Kumar Mondal 3
Definition of graph
Multigraph
• A loop is an edge whose end-vertices are the same.
• Multiple edges (or parallel edges) are edges with the same pair of end-vertices.
• If a graph G does not have any loop or multiple edge, then G is called a simple
graph; otherwise, it is called a multigraph.
• A simple graph has no loop or multiple edge.
8/6/2018 Manash Kumar Mondal 4
• A graph with a finite number of nodes and edges. If it has n nodes and has no
multiple edges or graph loops (i.e., it is simple), it is a subgraph of the complete
graph Kn.
• A graph which is not finite is called infinite. If every node has finite degree, the
graph is called locally finite. The Cayley graph of a group with respect to a finite
generating set is always locally finite, even if the group itself is infinite.
8/6/2018 Manash Kumar Mondal 5
Finite and infinite graphs
• A graph is called directed graph or digraph if each edge is associated
with a direction.
• An undirected graph is a graph where each edge is directed in both
directions.
8/6/2018 Manash Kumar Mondal 6
Undirected
graphs
Directed graphs
Directed and Undirected Graphs
• Adjacency and incident :Let e = (u,v) be an edge of a graph G. Then
the two vertices u and v are said to be adjacent in G, and the edge e is
said to be incident to the vertices u and v. The vertex u is also called a
neighbor of v in G and vice versa.
• Example-In the graph in
the vertices v1 and v3 are
adjacent; the edge e is incident
to the vertices v1 and v3 .The
neighbors of the vertex v1 in G are v2 , v3, v6, v9,and v11.
8/6/2018 Manash Kumar Mondal 7
Adjacency and incident
Degree of a vertex
• The degree of a vertex v in a graph G, denoted by deg(v) or d(v), is the
number of edges incident to v in G, with each loop at v counted twice.
• Since the degree of a vertex counts its incident edges, it is obvious that
the summation of the degrees of
all the vertices in a graph is related
to the total number of edges
in the graph.
8/6/2018 Manash Kumar Mondal 8
Degree is 3
(Degree-sum Formula)
• Let G = (V, E) be a graph with m edges. Then 𝑣∈𝑉 deg(𝑣) =
2m.
• Solution: Every non loop edge is incident to exactly two distinct vertices
of G. On the other hand, every loop edge is counted twice in the degree
of its incident vertex in G. Thus, every edge, whether it is loop or not,
contributes a two to the summation of the degrees of the vertices of G.
8/6/2018 Manash Kumar Mondal 9
Isolated vertex and Pendent vertex
• An isolated vertex is a vertex with degree zero; that is, a vertex that is
not an endpoint of any edge (the example image illustrates one isolated
vertex).
• A vertex of a graph is said to be pendant if its neighborhood contains
exactly one vertex. A leaf vertex (also pendant vertex) is a vertex with
degree one.
8/6/2018 Manash Kumar Mondal 10
Pendent vertex
Isolated vertex
Null Graphs
• An empty graph on n nodes consists of n isolated nodes with no edges.
Such graphs are sometimes also called edgeless graphs or null graphs
(though the term "null graph" is also used to refer in particular to the
empty graph on 0 nodes).
• The empty graph on 0 nodes is called the null graph, and the empty
graph on 1 node is called the singleton graph. The empty graph on n
vertices is the graph complement of the complete graph K_n, and is
commonly denoted K^n.
8/6/2018 Manash Kumar Mondal 11
Regular graphs
• If all the vertices of a graph G have equal degrees, then we call G a
regular graph. We call it a k-regular graph if the common degree is k.
• Only the graphs with empty edge sets(having non empty vertex sets) are
0-regular.These are called null graphs.
• A 1-regular graph consists of a set of edges such that no two edges are
incident to a common vertex.
• A graph which consists of a list of vertices such that each pair of
consecutive vertices are adjacent with each other and the first vertex is
also adjacent with the last vertex, is a 2-regular graph. Such a graph is
called a cycle or a simple cycle. A graph which is a collection of simple
cycles is also a 2-regular graph.
8/6/2018 Manash Kumar Mondal 12
Regular Graphs(cont.)
• A 3-regular graph is also called a cubic graph. Each vertices has degree 3.
8/6/2018 Manash Kumar Mondal 13
2 -regular
3 –regular
Peterson graph
4-regular 5 -regular
Regular Graphs(cont.)
• Corollary : Every regular graph with an odd degree has an even number
of vertices.
• Corollary : A k-regular graph with n vertices has nk/2 edges.
8/6/2018 Manash Kumar Mondal 14
SubGraph
• A subgraph of a graph G = (V, E) is a graph G ‘ = (V ‘ , E ‘ ) such that
V ‘ ⊆ V and E ‘ ⊆ E.
• We can obtain subgraphs of a graph G by deleting some vertices and
edges of G.
8/6/2018 Manash Kumar Mondal 15
Graph G Subgraph of G Subgraph of G
Subgraph of G Subgraph of G
Complete Graphs
• A graph in which each pair of distinct vertices are adjacent is called a
complete graph. A complete graph with n vertices is denoted by Kn . It
is trivial to see that Kn contains n(n − 1)/2 edges.
• Example- A complete graph K6 with six vertices.
8/6/2018 Manash Kumar Mondal 16
Complete Graph (K8)
Complete Graph (K6)
Independent Set and Bipartite Graphs
• Let G = (V, E) be a graph. A subset of vertices V’ ⊆ V is called an
independent set in G if for every pair of vertices u, v ∈ V’ , there is no
edge in G joining the two vertices u and v.
• A graph G is called a bipartite graph if the vertex set V of G can be
partitioned into two disjoint nonempty sets V 1 and V 2 , both of which
are independent. The two sets V 1 and V 2 are often called the partite
sets of G.
• 2 𝑛
− 2 possible bipartition of a graph with n vertices.
8/6/2018 Manash Kumar Mondal 17
Bipartite Graphs
8/6/2018 Manash Kumar Mondal 18
• Example-
Independent set Independent setIndependent set
Independent set
Path Graphs
• A path graph is a graph G that contains a list of vertices v 1 , v 2 , ..., v p
of G such that for 1 ≤ i ≤ p−1, there is an edge (v i ,v i+1 ) in G and
these are the only edges in G. The two vertices v 1 and v p are called the
end-vertices of G. A path graph with n vertices is denoted by Pn .
• Note that the degree of each vertex of a path graph is two except for the
two end-vertices, both of which have degree one
• Example- a path graph with six vertices
8/6/2018 Manash Kumar Mondal 19
Path Graph
Cycle Graphs and Wheel Graphs
• A cycle graph is one that is obtained by joining the two end-vertices of a
path graph. Thus, the degree of each vertex of a cycle graph is two. A
cycle graph with n vertices is often denoted by Cn .
• A wheel graph with n vertices, denoted by W n , is obtained from a cycle
graph Cn−1 with n − 1 vertices by adding a new vertex w and joining an
edge from w to each vertex of Cn−1
8/6/2018 Manash Kumar Mondal 20
Cycle graph
Wheel graph
Walks
• Let G be a graph. A walk in G is a nonempty list W = v 0 , e1 , v1 , ..., v
f−1 , ef ,vf , whose elements are alternately vertices and edges of G
where for 1 ≤ i ≤ f ,the edge e i has end vertices vi−1 and v i . The
vertices v 0 and v f are called the end vertices of W. If the end vertices
of a walk W of a graph G are u and v respectively, W is also called an u,
v-walk in G.
• Example-W = a,(a,i),i,(i,h),h,(h,c),c,(c,b),b
is a walk. W is also an a, b-walk in G
since the end vertices of W are a and b.
8/6/2018 Manash Kumar Mondal 21
Trails
• A trail of a graph G is a walk in G with no repeated edges. That is, in a
trail an edge can not appear more than once.
• The walk W1 = a,(a,i),i,(i,h),h,(h,c),c,(c,b),b is a trail but the walk W2 =
a,(a,i),i,(i,h),h,(h,c),c,(c,b),b,(b,a), a,(a,i) is not a trail since the edge (a,i) has
appeared in W2 more than once. A trail is called a circuit when the two
end vertices of the trail are the same.
• A trail is called a circuit when the
two end vertices of the trail are the same.
8/6/2018 Manash Kumar Mondal 22
Paths
• A path is a walk with no repeated vertex (except end vertices). When the
end vertices repeat, then it is called a closed path.
• In this a,(a,i),i,(i,h),h,(h,c),c,(c,b),b,(b,a),a is a closed path.
• A closed path is called a cycle. A
u,v-path is a path whose end
vertices are u and v.
8/6/2018 Manash Kumar Mondal 23
Cycles
• A closed path is called a cycle. A u,v-path is a path whose end vertices
are u and v.
• A vertex on a path P which is not an end vertex of P is called an internal
vertex of P. The length of a walk, a trail, a path, or a cycle is its number
of edges. Thus a path of n vertices has length n − 1, and a cycle of n
vertices has length n.
8/6/2018 Manash Kumar Mondal 24
Connected and disconnected graph
• A graph is connected when there is a path between every pair of vertices.
In a connected graph, there are no unreachable vertices.
• A graph that is not connected is disconnected. A graph G is said to
be disconnected if there exist two nodes in G such that no path in G has
those nodes as end points. A graph with just one vertex is connected.
An edgeless graph with two or more vertices is disconnected.
• Example-With vertex 0, this graph is
disconnected. The rest of the graph
is connected.
8/6/2018 Manash Kumar Mondal 25
Connected and disconnected
graph(cont.)
Components: A maximal connected subgraph of G is a subgraph that is
connected and is not contained in any other connected subgraph of G. A
maximal connected subgraph of G is called a connected component of G.
• A directed graph is called weakly connected if replacing all of its directed
edges with undirected edges produces a connected (undirected) graph. It
is connected if it contains a directed path from u to v or a directed path
from v to u for every pair of vertices u, v. It is strongly connected, di-
connected, or simply strong if it contains a directed path from u to v and
a directed path from v to u for every pair of vertices u, v. The strong
components are the maximal strongly connected subgraphs.
8/6/2018 Manash Kumar Mondal 26
Connected and disconnected
graph(cont.)
8/6/2018 Manash Kumar Mondal 27
Eulerian Graphs
• In graph theory, an Eulerian trail (or Eulerian path) is a trail in a finite
graph which visits every edge exactly once.
• An Eulerian circuit or Eulerian cycle is an Eulerian trail which starts and
ends on the same vertex.
• Example-
(a) An Eulerian graph
(b) a graph which is not
Eulerian
8/6/2018 Manash Kumar Mondal 28
Theorem(Euler graph)
• A connected graph G is Eulerian if and only if every vertex of G
has even degree.
Proof: Necessity: Suppose G is Eulerian. We wills how that every vertex
ofG has even degree. Since G is Eulerian, G contains an Eulerian circuit,
say, v0 ,e1 ,v1 ,e2 ,...,en ,v0 . Both edges e1 and en contribute 1 to the
degree of v 0 ; so degree of v 0 is at least 2.Each time the circuit passes
through a vertex (including v 0 ), the degree of the vertex is increased by
two. Therefore, the degree of every vertex including v 0 is an even integer.
Sufficiency: Assume that every vertex of G has even degree. We will
show that G is Eulerian, that is, G contains an Eulerian circuit.
8/6/2018 Manash Kumar Mondal 29
Theorem(Euler graph)(cont.)
We give a constructive proof.
Let v0 be an arbitrary vertex. Starting from v0 , we find a maximal trail T. Since
every vertex of G has even degree, T will be a closed trail. If T contains all the edges
of G, then G is Eulerian. Otherwise, let G’ be the graph obtained from G by deleting
all the edges of T (see Fig next page). Since T has even degree at every vertex, every
vertex of G’ has even degree. Since G is connected, some edge e of G’ is incident to
a vertex v of T. We find a maximal trail T’ in G’ starting from v along e. Combining
T and T’ we get a longer circuit. Let T = T ∪ T’ and we repeat the argument.
Since E(G) is finite, this process must end, and it can only end by constructing
an Eulerian circuit.
8/6/2018 Manash Kumar Mondal 30
Theorem(Euler graph)(cont.)
8/6/2018 Manash Kumar Mondal 31
Hamiltonian Graphs
• Let G be a graph. A path in G that includes every vertex of G is called a
Hamiltonian path of G. A cycle in G that includes every vertex in G is
called a Hamiltonian cycle of G. If G contains a Hamiltonian cycle,then
G is called a Hamiltonian Graph.
• Every Hamiltonian cycle of a Hamiltonian graph of n vertices has
exactly n vertices and n edges. If the graph is not a cycle, some edges of
G are not included in a Hamiltonian Cycle.
8/6/2018 Manash Kumar Mondal 32
Hamiltonian Graphs(cont.)
8/6/2018 Manash Kumar Mondal 33
Non -Hamiltonian
Hamiltonian
Connectivity
• The connectivity κ(G) of a connected graph G is the minimum number of vertices
whose removal results in a disconnected graph or a single vertex graph K 1 . A graph
G is k-connected if κ(G) ≥ k. A separating set or a vertex cut of a connected graph
G is a set S ⊂ V(G) such that G − S has more than one component. If a vertex cut
contains exactly one vertex, then we call the vertex cut a cut vertex. If a vertex cut
in a 2-connected graph contains exactly two vertices, then we call the two vertices a
separation-pair.
8/6/2018 Manash Kumar Mondal 34
Tree
• A tree is a connected graph that contains no cycle.
• A path is always a tree.
• A path with n vertices has n − 1 edges.
• In fact, every tree with n vertices has n − 1 edges
• A vertex with degree one in a tree T is called a leaf of T. All the vertices
of T other than the leaves are called the internal vertices of T.
• A collection of trees is called a forest. In other words, a forest is a graph
with no cycle. Such a graph is also called an acyclic graph. Each
component of a forest is a tree.
8/6/2018 Manash Kumar Mondal 35
Tree(cont.)
8/6/2018 Manash Kumar Mondal 36
Properties of a Tree
• Every tree with two or more vertices has at least two leaves.
• Every edge in a tree is a cut edge.
• Let G be a graph with n vertices. Then, any two of the following
three statements imply the third (and characterize a tree of n
vertices).
• (a) G is connected.
• (b) G contains no cycle.
• (c) G has n − 1 edges.
• A simple graph G is a tree if and only if for each pair of vertices u
and v of G, there is a unique u,v-path in G
8/6/2018 Manash Kumar Mondal 37
Rooted Tree
• A rooted tree is a tree in which one of the vertices is distinguished from
the others.
• The distinguished vertex is called the root of the tree. The root of a tree
is usually drawn at the top.
8/6/2018 Manash Kumar Mondal 38
Rooted Tree
8/6/2018 Manash Kumar Mondal 39
In this fig. the root is v1 . If a rooted
tree is regarded as a directed graph in
which each edge is directed from top to
bottom, then every vertex u other than
the root is connected by an edge from
some other vertex p, called the parent of
u. We also call u a child of vertex p.
Spanning Trees of a Graph
• A subgraph G‘ of a graph G is a spanning subgraph of G if G’ contains
all vertices of G. A spanning subgraph T of a graph G is a spanning tree
of G if T is a tree.
8/6/2018 Manash Kumar Mondal 40
Spanning Trees of a Graph(cont.)
• Let G = (V, E)be a connected graph and let S ⊆ E such that G−S is
disconnected. Then every spanning tree of G has an edge in S.
Let G be a connected graph. If G has no cycle, then G itself a spanning tree
of G. We thus assume that G has cycles. We delete edges from cycles one by one
until the resulting graph G ‘ is acyclic. Since no edge on a cycle is a cut edge by
Lemma 3.1.4(An edge is a cut-edge if and only if it belongs to no cycle.), G’ is
connected. Hence, G’ is a desired spanning tree T of G.’
Based on the proof of Lemma 4.4.1, one can develop an algorithm for finding a
spanning tree of a connected graph as follows: Check whether the graph has a cycle
or not. If the graph has a cycle, delete an edge from the cycle and repeat the process
until the resulting graph is acyclic.
8/6/2018 Manash Kumar Mondal 41
8/6/2018 Manash Kumar Mondal 42

More Related Content

What's hot

Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theoryArvindBorge
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2showslidedump
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph TheoryYosuke Mizutani
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory IntroductionMANISH T I
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network systemManikanta satyala
 
Chapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptChapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptishan743441
 
Graph theory and its applications
Graph theory and its applicationsGraph theory and its applications
Graph theory and its applicationsManikanta satyala
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabatinabati
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
Graph theory
Graph theoryGraph theory
Graph theoryKumar
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmAcad
 
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
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - SamyMark Arokiasamy
 

What's hot (20)

Ppt of graph theory
Ppt of graph theoryPpt of graph theory
Ppt of graph theory
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Slides Chapter10.1 10.2
Slides Chapter10.1 10.2Slides Chapter10.1 10.2
Slides Chapter10.1 10.2
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Graph Theory Introduction
Graph Theory IntroductionGraph Theory Introduction
Graph Theory Introduction
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
 
Chapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).pptChapter 5 Graphs (1).ppt
Chapter 5 Graphs (1).ppt
 
Graph theory and its applications
Graph theory and its applicationsGraph theory and its applications
Graph theory and its applications
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Graph theory concepts complex networks presents-rouhollah nabati
Graph theory concepts   complex networks presents-rouhollah nabatiGraph theory concepts   complex networks presents-rouhollah nabati
Graph theory concepts complex networks presents-rouhollah nabati
 
Graph
GraphGraph
Graph
 
Hamilton path and euler path
Hamilton path and euler pathHamilton path and euler path
Hamilton path and euler path
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Topological Sort
Topological SortTopological Sort
Topological Sort
 
Prim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithmPrim Algorithm and kruskal algorithm
Prim Algorithm and kruskal algorithm
 
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
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - Samy
 

Similar to Graph theory

Graph data structure
Graph data structureGraph data structure
Graph data structureTech_MX
 
CS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on GraphsCS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on Graphsssuser034ce1
 
CS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on GraphsCS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on Graphsssuser034ce1
 
358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13sumitbardhan
 
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
 
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
 
Graphs (Models & Terminology)
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)zunaira saleem
 
Graphs in datastructures
Graphs in datastructuresGraphs in datastructures
Graphs in datastructuresLikhithaGunturi
 
koningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxkoningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxAlpa Rajput
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structureAbrish06
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptxARVIND SARDAR
 

Similar to Graph theory (20)

Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
 
Graph ds
Graph dsGraph ds
Graph ds
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Graph data structure
Graph data structureGraph data structure
Graph data structure
 
CS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on GraphsCS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on Graphs
 
CS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on GraphsCS-102 Data Structure lectures on Graphs
CS-102 Data Structure lectures on Graphs
 
Chapter 1
Chapter   1Chapter   1
Chapter 1
 
Unit ix graph
Unit   ix    graph Unit   ix    graph
Unit ix graph
 
358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13358 33 powerpoint-slides_13-graphs_chapter-13
358 33 powerpoint-slides_13-graphs_chapter-13
 
Unit 9 graph
Unit   9 graphUnit   9 graph
Unit 9 graph
 
Graphs.pptx
Graphs.pptxGraphs.pptx
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 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 (Models & Terminology)
Graphs (Models & Terminology)Graphs (Models & Terminology)
Graphs (Models & Terminology)
 
Graphs in datastructures
Graphs in datastructuresGraphs in datastructures
Graphs in datastructures
 
Presentation on graphs
Presentation on graphsPresentation on graphs
Presentation on graphs
 
koningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxkoningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptx
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
 

More from Manash Kumar Mondal

More from Manash Kumar Mondal (18)

Role of NDLI in Higher Education _ Research, KU.pdf
Role of NDLI in Higher Education _ Research, KU.pdfRole of NDLI in Higher Education _ Research, KU.pdf
Role of NDLI in Higher Education _ Research, KU.pdf
 
Various security issues and its solutions in the
Various security issues and its solutions in theVarious security issues and its solutions in the
Various security issues and its solutions in the
 
Omicron - A Covid 19 variant
Omicron - A Covid 19 variantOmicron - A Covid 19 variant
Omicron - A Covid 19 variant
 
Computer network
Computer networkComputer network
Computer network
 
Boolean alebra
Boolean alebraBoolean alebra
Boolean alebra
 
Introduction to Algorithm
Introduction to AlgorithmIntroduction to Algorithm
Introduction to Algorithm
 
Tiny OS
Tiny OSTiny OS
Tiny OS
 
File in C language
File in C languageFile in C language
File in C language
 
Pegasus, A spyware
Pegasus, A spywarePegasus, A spyware
Pegasus, A spyware
 
A comparative study between cloud computing and fog
A comparative study between cloud computing and fog A comparative study between cloud computing and fog
A comparative study between cloud computing and fog
 
Binary Semaphore
Binary SemaphoreBinary Semaphore
Binary Semaphore
 
Ocean- sat for Oceanography
Ocean- sat for Oceanography Ocean- sat for Oceanography
Ocean- sat for Oceanography
 
4 g and 5g Communication
4 g and 5g Communication4 g and 5g Communication
4 g and 5g Communication
 
Apache web service
Apache web serviceApache web service
Apache web service
 
Revolution of Mobile Communication, from 1G to 5G Communication
Revolution of Mobile Communication, from  1G to 5G CommunicationRevolution of Mobile Communication, from  1G to 5G Communication
Revolution of Mobile Communication, from 1G to 5G Communication
 
Introduction to Apache Web Services using latex
 Introduction to Apache Web Services using latex Introduction to Apache Web Services using latex
Introduction to Apache Web Services using latex
 
Cloud computing and Cloudsim
Cloud computing and CloudsimCloud computing and Cloudsim
Cloud computing and Cloudsim
 
Superscalar Processor
Superscalar ProcessorSuperscalar Processor
Superscalar Processor
 

Recently uploaded

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 

Recently uploaded (20)

Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 

Graph theory

  • 1. Graph -Theory by Manash Kumar Mondal M.Tech(CSE) University of Kalyani
  • 2. Outline • Definition • Finite and infinite graphs • Directed and undirected graphs • Degree • Isolated vertex • Pendent vertex • Walks • Null graphs • Path • Circuit • Connected and disconnected graph • Euler's graph • Hamiltonian path and circuit • Trees 8/6/2018 Manash Kumar Mondal 2
  • 3. • A graph G is a tuple consisting of a finite set V of vertices and a finite set E of edges where each edge is an unordered pair of vertices. The two vertices associated with an edge e are called the end-vertices of e. We often denote by (u,v), an edge between two vertices u and v. We also denote the set of vertices of a graph G by V(G) and the set of edges of G by E(G).A vertex of a graph is also called as a node of a graph. • Example- 8/6/2018 Manash Kumar Mondal 3 Definition of graph
  • 4. Multigraph • A loop is an edge whose end-vertices are the same. • Multiple edges (or parallel edges) are edges with the same pair of end-vertices. • If a graph G does not have any loop or multiple edge, then G is called a simple graph; otherwise, it is called a multigraph. • A simple graph has no loop or multiple edge. 8/6/2018 Manash Kumar Mondal 4
  • 5. • A graph with a finite number of nodes and edges. If it has n nodes and has no multiple edges or graph loops (i.e., it is simple), it is a subgraph of the complete graph Kn. • A graph which is not finite is called infinite. If every node has finite degree, the graph is called locally finite. The Cayley graph of a group with respect to a finite generating set is always locally finite, even if the group itself is infinite. 8/6/2018 Manash Kumar Mondal 5 Finite and infinite graphs
  • 6. • A graph is called directed graph or digraph if each edge is associated with a direction. • An undirected graph is a graph where each edge is directed in both directions. 8/6/2018 Manash Kumar Mondal 6 Undirected graphs Directed graphs Directed and Undirected Graphs
  • 7. • Adjacency and incident :Let e = (u,v) be an edge of a graph G. Then the two vertices u and v are said to be adjacent in G, and the edge e is said to be incident to the vertices u and v. The vertex u is also called a neighbor of v in G and vice versa. • Example-In the graph in the vertices v1 and v3 are adjacent; the edge e is incident to the vertices v1 and v3 .The neighbors of the vertex v1 in G are v2 , v3, v6, v9,and v11. 8/6/2018 Manash Kumar Mondal 7 Adjacency and incident
  • 8. Degree of a vertex • The degree of a vertex v in a graph G, denoted by deg(v) or d(v), is the number of edges incident to v in G, with each loop at v counted twice. • Since the degree of a vertex counts its incident edges, it is obvious that the summation of the degrees of all the vertices in a graph is related to the total number of edges in the graph. 8/6/2018 Manash Kumar Mondal 8 Degree is 3
  • 9. (Degree-sum Formula) • Let G = (V, E) be a graph with m edges. Then 𝑣∈𝑉 deg(𝑣) = 2m. • Solution: Every non loop edge is incident to exactly two distinct vertices of G. On the other hand, every loop edge is counted twice in the degree of its incident vertex in G. Thus, every edge, whether it is loop or not, contributes a two to the summation of the degrees of the vertices of G. 8/6/2018 Manash Kumar Mondal 9
  • 10. Isolated vertex and Pendent vertex • An isolated vertex is a vertex with degree zero; that is, a vertex that is not an endpoint of any edge (the example image illustrates one isolated vertex). • A vertex of a graph is said to be pendant if its neighborhood contains exactly one vertex. A leaf vertex (also pendant vertex) is a vertex with degree one. 8/6/2018 Manash Kumar Mondal 10 Pendent vertex Isolated vertex
  • 11. Null Graphs • An empty graph on n nodes consists of n isolated nodes with no edges. Such graphs are sometimes also called edgeless graphs or null graphs (though the term "null graph" is also used to refer in particular to the empty graph on 0 nodes). • The empty graph on 0 nodes is called the null graph, and the empty graph on 1 node is called the singleton graph. The empty graph on n vertices is the graph complement of the complete graph K_n, and is commonly denoted K^n. 8/6/2018 Manash Kumar Mondal 11
  • 12. Regular graphs • If all the vertices of a graph G have equal degrees, then we call G a regular graph. We call it a k-regular graph if the common degree is k. • Only the graphs with empty edge sets(having non empty vertex sets) are 0-regular.These are called null graphs. • A 1-regular graph consists of a set of edges such that no two edges are incident to a common vertex. • A graph which consists of a list of vertices such that each pair of consecutive vertices are adjacent with each other and the first vertex is also adjacent with the last vertex, is a 2-regular graph. Such a graph is called a cycle or a simple cycle. A graph which is a collection of simple cycles is also a 2-regular graph. 8/6/2018 Manash Kumar Mondal 12
  • 13. Regular Graphs(cont.) • A 3-regular graph is also called a cubic graph. Each vertices has degree 3. 8/6/2018 Manash Kumar Mondal 13 2 -regular 3 –regular Peterson graph 4-regular 5 -regular
  • 14. Regular Graphs(cont.) • Corollary : Every regular graph with an odd degree has an even number of vertices. • Corollary : A k-regular graph with n vertices has nk/2 edges. 8/6/2018 Manash Kumar Mondal 14
  • 15. SubGraph • A subgraph of a graph G = (V, E) is a graph G ‘ = (V ‘ , E ‘ ) such that V ‘ ⊆ V and E ‘ ⊆ E. • We can obtain subgraphs of a graph G by deleting some vertices and edges of G. 8/6/2018 Manash Kumar Mondal 15 Graph G Subgraph of G Subgraph of G Subgraph of G Subgraph of G
  • 16. Complete Graphs • A graph in which each pair of distinct vertices are adjacent is called a complete graph. A complete graph with n vertices is denoted by Kn . It is trivial to see that Kn contains n(n − 1)/2 edges. • Example- A complete graph K6 with six vertices. 8/6/2018 Manash Kumar Mondal 16 Complete Graph (K8) Complete Graph (K6)
  • 17. Independent Set and Bipartite Graphs • Let G = (V, E) be a graph. A subset of vertices V’ ⊆ V is called an independent set in G if for every pair of vertices u, v ∈ V’ , there is no edge in G joining the two vertices u and v. • A graph G is called a bipartite graph if the vertex set V of G can be partitioned into two disjoint nonempty sets V 1 and V 2 , both of which are independent. The two sets V 1 and V 2 are often called the partite sets of G. • 2 𝑛 − 2 possible bipartition of a graph with n vertices. 8/6/2018 Manash Kumar Mondal 17
  • 18. Bipartite Graphs 8/6/2018 Manash Kumar Mondal 18 • Example- Independent set Independent setIndependent set Independent set
  • 19. Path Graphs • A path graph is a graph G that contains a list of vertices v 1 , v 2 , ..., v p of G such that for 1 ≤ i ≤ p−1, there is an edge (v i ,v i+1 ) in G and these are the only edges in G. The two vertices v 1 and v p are called the end-vertices of G. A path graph with n vertices is denoted by Pn . • Note that the degree of each vertex of a path graph is two except for the two end-vertices, both of which have degree one • Example- a path graph with six vertices 8/6/2018 Manash Kumar Mondal 19 Path Graph
  • 20. Cycle Graphs and Wheel Graphs • A cycle graph is one that is obtained by joining the two end-vertices of a path graph. Thus, the degree of each vertex of a cycle graph is two. A cycle graph with n vertices is often denoted by Cn . • A wheel graph with n vertices, denoted by W n , is obtained from a cycle graph Cn−1 with n − 1 vertices by adding a new vertex w and joining an edge from w to each vertex of Cn−1 8/6/2018 Manash Kumar Mondal 20 Cycle graph Wheel graph
  • 21. Walks • Let G be a graph. A walk in G is a nonempty list W = v 0 , e1 , v1 , ..., v f−1 , ef ,vf , whose elements are alternately vertices and edges of G where for 1 ≤ i ≤ f ,the edge e i has end vertices vi−1 and v i . The vertices v 0 and v f are called the end vertices of W. If the end vertices of a walk W of a graph G are u and v respectively, W is also called an u, v-walk in G. • Example-W = a,(a,i),i,(i,h),h,(h,c),c,(c,b),b is a walk. W is also an a, b-walk in G since the end vertices of W are a and b. 8/6/2018 Manash Kumar Mondal 21
  • 22. Trails • A trail of a graph G is a walk in G with no repeated edges. That is, in a trail an edge can not appear more than once. • The walk W1 = a,(a,i),i,(i,h),h,(h,c),c,(c,b),b is a trail but the walk W2 = a,(a,i),i,(i,h),h,(h,c),c,(c,b),b,(b,a), a,(a,i) is not a trail since the edge (a,i) has appeared in W2 more than once. A trail is called a circuit when the two end vertices of the trail are the same. • A trail is called a circuit when the two end vertices of the trail are the same. 8/6/2018 Manash Kumar Mondal 22
  • 23. Paths • A path is a walk with no repeated vertex (except end vertices). When the end vertices repeat, then it is called a closed path. • In this a,(a,i),i,(i,h),h,(h,c),c,(c,b),b,(b,a),a is a closed path. • A closed path is called a cycle. A u,v-path is a path whose end vertices are u and v. 8/6/2018 Manash Kumar Mondal 23
  • 24. Cycles • A closed path is called a cycle. A u,v-path is a path whose end vertices are u and v. • A vertex on a path P which is not an end vertex of P is called an internal vertex of P. The length of a walk, a trail, a path, or a cycle is its number of edges. Thus a path of n vertices has length n − 1, and a cycle of n vertices has length n. 8/6/2018 Manash Kumar Mondal 24
  • 25. Connected and disconnected graph • A graph is connected when there is a path between every pair of vertices. In a connected graph, there are no unreachable vertices. • A graph that is not connected is disconnected. A graph G is said to be disconnected if there exist two nodes in G such that no path in G has those nodes as end points. A graph with just one vertex is connected. An edgeless graph with two or more vertices is disconnected. • Example-With vertex 0, this graph is disconnected. The rest of the graph is connected. 8/6/2018 Manash Kumar Mondal 25
  • 26. Connected and disconnected graph(cont.) Components: A maximal connected subgraph of G is a subgraph that is connected and is not contained in any other connected subgraph of G. A maximal connected subgraph of G is called a connected component of G. • A directed graph is called weakly connected if replacing all of its directed edges with undirected edges produces a connected (undirected) graph. It is connected if it contains a directed path from u to v or a directed path from v to u for every pair of vertices u, v. It is strongly connected, di- connected, or simply strong if it contains a directed path from u to v and a directed path from v to u for every pair of vertices u, v. The strong components are the maximal strongly connected subgraphs. 8/6/2018 Manash Kumar Mondal 26
  • 28. Eulerian Graphs • In graph theory, an Eulerian trail (or Eulerian path) is a trail in a finite graph which visits every edge exactly once. • An Eulerian circuit or Eulerian cycle is an Eulerian trail which starts and ends on the same vertex. • Example- (a) An Eulerian graph (b) a graph which is not Eulerian 8/6/2018 Manash Kumar Mondal 28
  • 29. Theorem(Euler graph) • A connected graph G is Eulerian if and only if every vertex of G has even degree. Proof: Necessity: Suppose G is Eulerian. We wills how that every vertex ofG has even degree. Since G is Eulerian, G contains an Eulerian circuit, say, v0 ,e1 ,v1 ,e2 ,...,en ,v0 . Both edges e1 and en contribute 1 to the degree of v 0 ; so degree of v 0 is at least 2.Each time the circuit passes through a vertex (including v 0 ), the degree of the vertex is increased by two. Therefore, the degree of every vertex including v 0 is an even integer. Sufficiency: Assume that every vertex of G has even degree. We will show that G is Eulerian, that is, G contains an Eulerian circuit. 8/6/2018 Manash Kumar Mondal 29
  • 30. Theorem(Euler graph)(cont.) We give a constructive proof. Let v0 be an arbitrary vertex. Starting from v0 , we find a maximal trail T. Since every vertex of G has even degree, T will be a closed trail. If T contains all the edges of G, then G is Eulerian. Otherwise, let G’ be the graph obtained from G by deleting all the edges of T (see Fig next page). Since T has even degree at every vertex, every vertex of G’ has even degree. Since G is connected, some edge e of G’ is incident to a vertex v of T. We find a maximal trail T’ in G’ starting from v along e. Combining T and T’ we get a longer circuit. Let T = T ∪ T’ and we repeat the argument. Since E(G) is finite, this process must end, and it can only end by constructing an Eulerian circuit. 8/6/2018 Manash Kumar Mondal 30
  • 32. Hamiltonian Graphs • Let G be a graph. A path in G that includes every vertex of G is called a Hamiltonian path of G. A cycle in G that includes every vertex in G is called a Hamiltonian cycle of G. If G contains a Hamiltonian cycle,then G is called a Hamiltonian Graph. • Every Hamiltonian cycle of a Hamiltonian graph of n vertices has exactly n vertices and n edges. If the graph is not a cycle, some edges of G are not included in a Hamiltonian Cycle. 8/6/2018 Manash Kumar Mondal 32
  • 33. Hamiltonian Graphs(cont.) 8/6/2018 Manash Kumar Mondal 33 Non -Hamiltonian Hamiltonian
  • 34. Connectivity • The connectivity κ(G) of a connected graph G is the minimum number of vertices whose removal results in a disconnected graph or a single vertex graph K 1 . A graph G is k-connected if κ(G) ≥ k. A separating set or a vertex cut of a connected graph G is a set S ⊂ V(G) such that G − S has more than one component. If a vertex cut contains exactly one vertex, then we call the vertex cut a cut vertex. If a vertex cut in a 2-connected graph contains exactly two vertices, then we call the two vertices a separation-pair. 8/6/2018 Manash Kumar Mondal 34
  • 35. Tree • A tree is a connected graph that contains no cycle. • A path is always a tree. • A path with n vertices has n − 1 edges. • In fact, every tree with n vertices has n − 1 edges • A vertex with degree one in a tree T is called a leaf of T. All the vertices of T other than the leaves are called the internal vertices of T. • A collection of trees is called a forest. In other words, a forest is a graph with no cycle. Such a graph is also called an acyclic graph. Each component of a forest is a tree. 8/6/2018 Manash Kumar Mondal 35
  • 37. Properties of a Tree • Every tree with two or more vertices has at least two leaves. • Every edge in a tree is a cut edge. • Let G be a graph with n vertices. Then, any two of the following three statements imply the third (and characterize a tree of n vertices). • (a) G is connected. • (b) G contains no cycle. • (c) G has n − 1 edges. • A simple graph G is a tree if and only if for each pair of vertices u and v of G, there is a unique u,v-path in G 8/6/2018 Manash Kumar Mondal 37
  • 38. Rooted Tree • A rooted tree is a tree in which one of the vertices is distinguished from the others. • The distinguished vertex is called the root of the tree. The root of a tree is usually drawn at the top. 8/6/2018 Manash Kumar Mondal 38
  • 39. Rooted Tree 8/6/2018 Manash Kumar Mondal 39 In this fig. the root is v1 . If a rooted tree is regarded as a directed graph in which each edge is directed from top to bottom, then every vertex u other than the root is connected by an edge from some other vertex p, called the parent of u. We also call u a child of vertex p.
  • 40. Spanning Trees of a Graph • A subgraph G‘ of a graph G is a spanning subgraph of G if G’ contains all vertices of G. A spanning subgraph T of a graph G is a spanning tree of G if T is a tree. 8/6/2018 Manash Kumar Mondal 40
  • 41. Spanning Trees of a Graph(cont.) • Let G = (V, E)be a connected graph and let S ⊆ E such that G−S is disconnected. Then every spanning tree of G has an edge in S. Let G be a connected graph. If G has no cycle, then G itself a spanning tree of G. We thus assume that G has cycles. We delete edges from cycles one by one until the resulting graph G ‘ is acyclic. Since no edge on a cycle is a cut edge by Lemma 3.1.4(An edge is a cut-edge if and only if it belongs to no cycle.), G’ is connected. Hence, G’ is a desired spanning tree T of G.’ Based on the proof of Lemma 4.4.1, one can develop an algorithm for finding a spanning tree of a connected graph as follows: Check whether the graph has a cycle or not. If the graph has a cycle, delete an edge from the cycle and repeat the process until the resulting graph is acyclic. 8/6/2018 Manash Kumar Mondal 41