SlideShare a Scribd company logo
1 of 43
DR. ADEEL HASHMI
ASST. PROF., CSE 2ND SHIFT
MSIT
FCS (Graphs)
Graphs
⚫A graph G = (V, E) consists of V, a non-empty set of
vertices (or nodes) and E, a set of edges.
⚫Two vertices u and v in an undirected graph G are
called adjacent (or neighbors) in G if u and v are the
endpoints of an edge e of G.
⚫Edges that connect a vertex to itself are called loops.
Types of Graphs
⚫A graph in which each edge connects two different
vertices and where no two edges connect the same
pair of vertices is called a simple graph.
⚫Graphs that may have multiple edges connecting the
same vertices are called multigraphs. When there
are m directed edges, each associated to an ordered
pair of vertices (u, v), we say that (u, v) is an edge of
multiplicity m.
⚫Graphs that may include loops, and possibly multiple
edges connecting the same pair of vertices or a vertex
to itself, are sometimes called pseudo-graphs.
Types of Graphs (2)
⚫A directed graph / digraph (V,E) consists of a
nonempty set of vertices V and a set of directed edges
(or arcs) E. Each directed edge is associated with an
ordered pair of vertices. The directed edge associated
with the ordered pair (u, v) is said to start at u and
end at v. The converse of a directed graph is the
directed graph with directions of all edges reversed.
⚫So far the graphs we have introduced are
undirected graphs. Their edges are also said to be
undirected. A graph with both directed and
undirected edges is called a mixed graph.
Graph Representation
⚫A graph can be represented as either Adjacency
Matrix or Adjacency List or Incidence Matrix.
Graph Representation (2)
Graph Representation (3)
Degree of vertices
⚫ The degree of a vertex in an undirected graph is the
number of edges incident with it, except that a loop at a
vertex contributes twice to the degree of that vertex. The
degree of the vertex v is denoted by deg(v).
⚫ In a graph with directed edges the in-degree of a vertex
v, denoted by deg−(v), is the number of edges with v as
their terminal vertex. The out-degree of v, denoted by
deg+(v), is the number of edges with v as their initial
vertex. (Note that a loop at a vertex contributes 1 to both
the in-degree and the out-degree of this vertex.)
Question-1
Question-2
Hand-shaking theorem
Isomorphic
Two graphs are said to be isomorphic, if
⚫They have an equal number of vertices.
⚫They have an equal number of edges.
⚫They have an equal number of vertices for each
degree.
⚫The sub-graphs formed by vertices for a given
degree, also have equal number of vertices for each
degree.
Question-1
⚫ Are the following graphs isomorphic?
⚫ Both G and H have five vertices and six edges. However,
H has a vertex of degree one, namely, e, whereas G has
no vertices of degree one. It follows that G and H are not
isomorphic.
Question-2
⚫ Are the following
graphs isomorphic?
⚫ The graphs G and H both have
eight vertices and 10 edges.
They also both have four vertices
of degree two and four of degree three.
⚫ But it is not isomorphic,
as sub-graphs of vertices having
degree 3 are not isomorphic.
Connected Graphs
⚫A path/walk is a sequence of vertices/edges
e.g. v1v4v3v2 . A path which begins and ends at the
same vertex is called a cycle or a circuit.
⚫An undirected graph is called connected if there is
a path b/w every pair of distinct vertices of the
graph.
⚫A directed graph is strongly connected if there is a
path from a to b and from b to a whenever a and b
are vertices in the graph. A directed graph is weakly
connected if there is a path between every two
vertices in the underlying undirected graph.
Example
⚫ Are the following graphs connected?
⚫ G is strongly connected because there is a path between any two
vertices in this directed graph.
⚫ The graph H is not strongly connected. There is no path from a to b
in this graph. However, H is weakly connected, because there is a
path b/w any two vertices in the underlying undirected graph of H.
Connected Components
⚫ A connected component of a graph G is a maximal connected
subgraph of G.
⚫ If the removal of an edge from a graph results in a
disconnected graph, then it is called a cut-edge. Similarly, if
the removal of a vertex and all incident edges results in a
disconnected graph, then it is called a cut-vertex.
Cut-set
⚫ Find the cut vertices and cut edges in the graph G1 shown
in Figure.
⚫ The cut vertices of G1 are b, c, and e. The removal of one
of these vertices (and its adjacent edges) disconnects the
graph. The cut edges are {a, b} and {c, e}. Removing
either one of these edges disconnects G1.
Complete Graph
⚫A complete graph on n vertices, denoted by Kn, is a
simple graph that contains exactly one edge between
each pair of distinct vertices.
⚫Kn as n(n-1)/2 edges.
Bi-partite Graph
⚫A simple graph G is called bipartite if its vertex set
V can be partitioned into two disjoint sets V1 and V2
such that every edge in the graph connects a vertex
in V1 and a vertex in V2 (so that no edge in G
connects either two vertices in V1 or two vertices in
V2). When this condition holds, we call the pair (V1,
V2) a bipartition of the vertex set V of G.
Complete Bi-partite Graphs
⚫A complete bipartite graph Km,n is a graph that
has its vertex set partitioned into two subsets of m
and n vertices, respectively with an edge between two
vertices if and only if one vertex is in the first subset
and the other vertex is in the second subset.
Euler Path
⚫A Euler path in G is a simple path containing
every edge of G (each edge only once).
⚫A Euler circuit in a graph G is a simple circuit
containing every edge of G.
⚫A connected multi-graph with at least two vertices
has an Euler circuit if and only if each of its
vertices has an even degree.
⚫A connected multigraph has an Euler path but not
an Euler circuit if and only if it has exactly two
vertices of odd degree.
Example
⚫ Which of the undirected graphs in Fig. have a Euler
circuit? Of those that do not, which have a Euler path?
⚫ The graph G1 has Euler circuit(s), one such circuit is a, e,
c, d, e, b, a. Neither of the graphs G2 or G3 has an Euler
circuit. However, G3 has an Euler path, namely, a, c, d, e,
b, d, a, b. G2 does not have an Euler path.
Hamiltonian Path
⚫ A simple path in a graph G that passes through every
vertex exactly once is called a Hamiltonian path, and a
simple circuit in a graph G that passes through every
vertex exactly once is called a Hamiltonian circuit.
⚫ a, g, f, e, d, c, b, a is one of the Hamiltonian circuit.
⚫ a,b,g,c,f,d,e is one of th Hamiltonian path.
Planar Graph
⚫A graph is called planar if it can be drawn/re-drawn
in the plane without any edges crossing.
Homeomorphic
⚫If a graph is planar, so will be any graph obtained by
removing an edge {u, v} and adding a new vertex w
together with edges {u, w} and {w, v}. Such an
operation is called an elementary subdivision.
⚫The graphs G1 = (V1, E1) and G2 = (V2, E2) are
called homeomorphic if they can be obtained from
the same graph by a sequence of elementary
subdivisions.
Homeomorphic (2)
⚫A graph H homeomorphic to K5.
Kuratowski theorem
⚫A graph is nonplanar if and only if it contains
a subgraph homeomorphic to K3,3 or K5.
Example
⚫Check the graph shown in Fig for planarity.
Example (2)
⚫ The above graph is non-planar only if
its subgraph is homeomorphic to K5 or K3,3.
⚫ Let us try to find K3,3 in the given graph. We remove edges {a,b} {f,e} and
{g,h} to get a graph shown in Fig. We combine edges {a,g} and {g,d} to
obtain homeomorphic edge {a,d}.
⚫ The graph obtained is K3,3. Hence, the above given graph is non-planar.
Euler formula
⚫Let G be a connected planar simple graph with e
edges and v vertices. Let r be the number of regions
in a planar representation of G. Then
⚫r = e − v + 2.
⚫3 = 5 – 4 + 2
Euler formula (Proof by MI)
Euler formula (Proof) contd..
Theorem
⚫If G is a connected planar simple graph, then
G has at least one vertex of degree not
exceeding five.
Graph Coloring
⚫A coloring of a simple graph is the assignment of a
color to each vertex of the graph so that no two
adjacent vertices are assigned the same color.
⚫The chromatic number of a graph is the least
number of colors needed for a coloring of this graph.
The chromatic number of a graph G is denoted by 𝝌
(G). (Here 𝝌 is the Greek letter chi.)
Question
⚫ What is the chromatic number of the graph shown in Fig?
⚫ Let a=Red, b=Yellow, c=Green.
⚫ Now, d can be colored Red as it is not connected to a.
⚫ e can be colored Green as it is not connected to c.
⚫ f can be colored Yellow as it is not connected to b.
⚫ And, g can be colored Red as it is not connected to either a or d.
⚫ Hence, we can color the given graph by using at least 3 colors.
⚫ Hence, its chromatic number is 3.
Five-color theorem
⚫The chromatic number of a planar graph is
not greater than five.
Five-color theorem (Proof by MI)
⚫Basis step: Every graph with 5 or fewer vertices can
be colored with 5 or fewer colors.
⚫Inductive step: We know that every planar graph
has at least one vertex of degree not exceeding 5. We
take a graph with k+1 vertices (Gk+1) having a vertex
“v” with degree 5. We remove the vertex “v” to get a
graph with k vertices (Gk).
⚫We assume Gk to be 5-colorable, and prove that Gk+1
is also 5-colorable.
Proof (2)
Let above figure represent graph Gk+1, let the vertex with degree 5 or less be
denoted by “v”. In the graph given above, it has degree 5. We color all the
vertices adjacent to “v” with different colors (R=red, B=blue, G=green,
Y=yellow, O=orange).
Now, we remove vertex “v” from the above graph (Gk+1) to obtain graph Gk.
We assume, Gk to be 5-colorable.
Proof (3)
⚫ We select vertices colored Red and Green from Gk. Let’s
assume that these two vertices are connected (i.e. have a path
b/w them) with vertices of alternating colors Red & Green.
Proof (4)
⚫Now, we select vertices with colors Blue & Orange.
These two vertices cannot be connected (i.e. can’t
have a path b/w them) as then the paths of Red-
Green and Blue-Orange vertices will intersect, and
the graph will lose its property of planarity.
⚫If there is no path b/w Blue & Orange vertices, then
we can color both these vertices with the same color
i.e. either Blue or Orange, and free the other color.
This “freed” color can then be utilized to color vertex
“v” in Gk+1. So we free the orange color.
Proof (5)
Thank You

More Related Content

Similar to FCS (graphs).pptx

1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptxswapnilbs2728
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER) ijceronline
 
Connected and disconnected graph
Connected and disconnected graphConnected and disconnected graph
Connected and disconnected graphABDULLAHSHAUKAT4
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graphRounak Biswas
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptxARVIND SARDAR
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - GraphMadhu Bala
 
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
 

Similar to FCS (graphs).pptx (20)

Chapter 1
Chapter   1Chapter   1
Chapter 1
 
Graph-theory.ppt
Graph-theory.pptGraph-theory.ppt
Graph-theory.ppt
 
Graph.ppt
Graph.pptGraph.ppt
Graph.ppt
 
1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx1. Graph and Graph Terminologiesimp.pptx
1. Graph and Graph Terminologiesimp.pptx
 
International Journal of Computational Engineering Research(IJCER)
 International Journal of Computational Engineering Research(IJCER)  International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Magtibay buk bind#2
Magtibay buk bind#2Magtibay buk bind#2
Magtibay buk bind#2
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Am03102420247
Am03102420247Am03102420247
Am03102420247
 
ch8.3-8.4.ppt
ch8.3-8.4.pptch8.3-8.4.ppt
ch8.3-8.4.ppt
 
Aj26225229
Aj26225229Aj26225229
Aj26225229
 
graph ASS (1).ppt
graph ASS (1).pptgraph ASS (1).ppt
graph ASS (1).ppt
 
Connected and disconnected graph
Connected and disconnected graphConnected and disconnected graph
Connected and disconnected graph
 
Matrix representation of graph
Matrix representation of graphMatrix representation of graph
Matrix representation of graph
 
Graph ASS DBATU.pptx
Graph ASS DBATU.pptxGraph ASS DBATU.pptx
Graph ASS DBATU.pptx
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
 
Connectivity of graph
Connectivity of graphConnectivity of graph
Connectivity of graph
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
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
 
Types of graphs
Types of graphsTypes of graphs
Types of graphs
 

Recently uploaded

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...srsj9000
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 

Recently uploaded (20)

Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Design and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdfDesign and analysis of solar grass cutter.pdf
Design and analysis of solar grass cutter.pdf
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
Gfe Mayur Vihar Call Girls Service WhatsApp -> 9999965857 Available 24x7 ^ De...
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 

FCS (graphs).pptx

  • 1. DR. ADEEL HASHMI ASST. PROF., CSE 2ND SHIFT MSIT FCS (Graphs)
  • 2. Graphs ⚫A graph G = (V, E) consists of V, a non-empty set of vertices (or nodes) and E, a set of edges. ⚫Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if u and v are the endpoints of an edge e of G. ⚫Edges that connect a vertex to itself are called loops.
  • 3. Types of Graphs ⚫A graph in which each edge connects two different vertices and where no two edges connect the same pair of vertices is called a simple graph. ⚫Graphs that may have multiple edges connecting the same vertices are called multigraphs. When there are m directed edges, each associated to an ordered pair of vertices (u, v), we say that (u, v) is an edge of multiplicity m. ⚫Graphs that may include loops, and possibly multiple edges connecting the same pair of vertices or a vertex to itself, are sometimes called pseudo-graphs.
  • 4. Types of Graphs (2) ⚫A directed graph / digraph (V,E) consists of a nonempty set of vertices V and a set of directed edges (or arcs) E. Each directed edge is associated with an ordered pair of vertices. The directed edge associated with the ordered pair (u, v) is said to start at u and end at v. The converse of a directed graph is the directed graph with directions of all edges reversed. ⚫So far the graphs we have introduced are undirected graphs. Their edges are also said to be undirected. A graph with both directed and undirected edges is called a mixed graph.
  • 5. Graph Representation ⚫A graph can be represented as either Adjacency Matrix or Adjacency List or Incidence Matrix.
  • 8. Degree of vertices ⚫ The degree of a vertex in an undirected graph is the number of edges incident with it, except that a loop at a vertex contributes twice to the degree of that vertex. The degree of the vertex v is denoted by deg(v). ⚫ In a graph with directed edges the in-degree of a vertex v, denoted by deg−(v), is the number of edges with v as their terminal vertex. The out-degree of v, denoted by deg+(v), is the number of edges with v as their initial vertex. (Note that a loop at a vertex contributes 1 to both the in-degree and the out-degree of this vertex.)
  • 12. Isomorphic Two graphs are said to be isomorphic, if ⚫They have an equal number of vertices. ⚫They have an equal number of edges. ⚫They have an equal number of vertices for each degree. ⚫The sub-graphs formed by vertices for a given degree, also have equal number of vertices for each degree.
  • 13. Question-1 ⚫ Are the following graphs isomorphic? ⚫ Both G and H have five vertices and six edges. However, H has a vertex of degree one, namely, e, whereas G has no vertices of degree one. It follows that G and H are not isomorphic.
  • 14. Question-2 ⚫ Are the following graphs isomorphic? ⚫ The graphs G and H both have eight vertices and 10 edges. They also both have four vertices of degree two and four of degree three. ⚫ But it is not isomorphic, as sub-graphs of vertices having degree 3 are not isomorphic.
  • 15. Connected Graphs ⚫A path/walk is a sequence of vertices/edges e.g. v1v4v3v2 . A path which begins and ends at the same vertex is called a cycle or a circuit. ⚫An undirected graph is called connected if there is a path b/w every pair of distinct vertices of the graph. ⚫A directed graph is strongly connected if there is a path from a to b and from b to a whenever a and b are vertices in the graph. A directed graph is weakly connected if there is a path between every two vertices in the underlying undirected graph.
  • 16. Example ⚫ Are the following graphs connected? ⚫ G is strongly connected because there is a path between any two vertices in this directed graph. ⚫ The graph H is not strongly connected. There is no path from a to b in this graph. However, H is weakly connected, because there is a path b/w any two vertices in the underlying undirected graph of H.
  • 17. Connected Components ⚫ A connected component of a graph G is a maximal connected subgraph of G. ⚫ If the removal of an edge from a graph results in a disconnected graph, then it is called a cut-edge. Similarly, if the removal of a vertex and all incident edges results in a disconnected graph, then it is called a cut-vertex.
  • 18. Cut-set ⚫ Find the cut vertices and cut edges in the graph G1 shown in Figure. ⚫ The cut vertices of G1 are b, c, and e. The removal of one of these vertices (and its adjacent edges) disconnects the graph. The cut edges are {a, b} and {c, e}. Removing either one of these edges disconnects G1.
  • 19. Complete Graph ⚫A complete graph on n vertices, denoted by Kn, is a simple graph that contains exactly one edge between each pair of distinct vertices. ⚫Kn as n(n-1)/2 edges.
  • 20. Bi-partite Graph ⚫A simple graph G is called bipartite if its vertex set V can be partitioned into two disjoint sets V1 and V2 such that every edge in the graph connects a vertex in V1 and a vertex in V2 (so that no edge in G connects either two vertices in V1 or two vertices in V2). When this condition holds, we call the pair (V1, V2) a bipartition of the vertex set V of G.
  • 21. Complete Bi-partite Graphs ⚫A complete bipartite graph Km,n is a graph that has its vertex set partitioned into two subsets of m and n vertices, respectively with an edge between two vertices if and only if one vertex is in the first subset and the other vertex is in the second subset.
  • 22. Euler Path ⚫A Euler path in G is a simple path containing every edge of G (each edge only once). ⚫A Euler circuit in a graph G is a simple circuit containing every edge of G. ⚫A connected multi-graph with at least two vertices has an Euler circuit if and only if each of its vertices has an even degree. ⚫A connected multigraph has an Euler path but not an Euler circuit if and only if it has exactly two vertices of odd degree.
  • 23. Example ⚫ Which of the undirected graphs in Fig. have a Euler circuit? Of those that do not, which have a Euler path? ⚫ The graph G1 has Euler circuit(s), one such circuit is a, e, c, d, e, b, a. Neither of the graphs G2 or G3 has an Euler circuit. However, G3 has an Euler path, namely, a, c, d, e, b, d, a, b. G2 does not have an Euler path.
  • 24. Hamiltonian Path ⚫ A simple path in a graph G that passes through every vertex exactly once is called a Hamiltonian path, and a simple circuit in a graph G that passes through every vertex exactly once is called a Hamiltonian circuit. ⚫ a, g, f, e, d, c, b, a is one of the Hamiltonian circuit. ⚫ a,b,g,c,f,d,e is one of th Hamiltonian path.
  • 25. Planar Graph ⚫A graph is called planar if it can be drawn/re-drawn in the plane without any edges crossing.
  • 26. Homeomorphic ⚫If a graph is planar, so will be any graph obtained by removing an edge {u, v} and adding a new vertex w together with edges {u, w} and {w, v}. Such an operation is called an elementary subdivision. ⚫The graphs G1 = (V1, E1) and G2 = (V2, E2) are called homeomorphic if they can be obtained from the same graph by a sequence of elementary subdivisions.
  • 27. Homeomorphic (2) ⚫A graph H homeomorphic to K5.
  • 28. Kuratowski theorem ⚫A graph is nonplanar if and only if it contains a subgraph homeomorphic to K3,3 or K5.
  • 29. Example ⚫Check the graph shown in Fig for planarity.
  • 30. Example (2) ⚫ The above graph is non-planar only if its subgraph is homeomorphic to K5 or K3,3. ⚫ Let us try to find K3,3 in the given graph. We remove edges {a,b} {f,e} and {g,h} to get a graph shown in Fig. We combine edges {a,g} and {g,d} to obtain homeomorphic edge {a,d}. ⚫ The graph obtained is K3,3. Hence, the above given graph is non-planar.
  • 31. Euler formula ⚫Let G be a connected planar simple graph with e edges and v vertices. Let r be the number of regions in a planar representation of G. Then ⚫r = e − v + 2. ⚫3 = 5 – 4 + 2
  • 34. Theorem ⚫If G is a connected planar simple graph, then G has at least one vertex of degree not exceeding five.
  • 35. Graph Coloring ⚫A coloring of a simple graph is the assignment of a color to each vertex of the graph so that no two adjacent vertices are assigned the same color. ⚫The chromatic number of a graph is the least number of colors needed for a coloring of this graph. The chromatic number of a graph G is denoted by 𝝌 (G). (Here 𝝌 is the Greek letter chi.)
  • 36. Question ⚫ What is the chromatic number of the graph shown in Fig? ⚫ Let a=Red, b=Yellow, c=Green. ⚫ Now, d can be colored Red as it is not connected to a. ⚫ e can be colored Green as it is not connected to c. ⚫ f can be colored Yellow as it is not connected to b. ⚫ And, g can be colored Red as it is not connected to either a or d. ⚫ Hence, we can color the given graph by using at least 3 colors. ⚫ Hence, its chromatic number is 3.
  • 37. Five-color theorem ⚫The chromatic number of a planar graph is not greater than five.
  • 38. Five-color theorem (Proof by MI) ⚫Basis step: Every graph with 5 or fewer vertices can be colored with 5 or fewer colors. ⚫Inductive step: We know that every planar graph has at least one vertex of degree not exceeding 5. We take a graph with k+1 vertices (Gk+1) having a vertex “v” with degree 5. We remove the vertex “v” to get a graph with k vertices (Gk). ⚫We assume Gk to be 5-colorable, and prove that Gk+1 is also 5-colorable.
  • 39. Proof (2) Let above figure represent graph Gk+1, let the vertex with degree 5 or less be denoted by “v”. In the graph given above, it has degree 5. We color all the vertices adjacent to “v” with different colors (R=red, B=blue, G=green, Y=yellow, O=orange). Now, we remove vertex “v” from the above graph (Gk+1) to obtain graph Gk. We assume, Gk to be 5-colorable.
  • 40. Proof (3) ⚫ We select vertices colored Red and Green from Gk. Let’s assume that these two vertices are connected (i.e. have a path b/w them) with vertices of alternating colors Red & Green.
  • 41. Proof (4) ⚫Now, we select vertices with colors Blue & Orange. These two vertices cannot be connected (i.e. can’t have a path b/w them) as then the paths of Red- Green and Blue-Orange vertices will intersect, and the graph will lose its property of planarity. ⚫If there is no path b/w Blue & Orange vertices, then we can color both these vertices with the same color i.e. either Blue or Orange, and free the other color. This “freed” color can then be utilized to color vertex “v” in Gk+1. So we free the orange color.