SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Presented By:
Abhishek Pachisia
B.Tech-IT(V Sem)
   090102801
Graph is a set of edges and vertices.

Graph can be represented in the form of matrix.

Different matrix that can be formed are:

   1. Incidence Matrix

   2. Adjacency Matrix

   3. Cut-Set Matrix

   4. Circuit Matrix

   5. Path Matrix
Edge connected to the vertex is known as incidence edge to that vertex.

If vertex is incident on vertex then put 1 else 0.                   Vertex       Edges
                                                                        1          a, b
                                                                        2          a, b, c, f
  aij =1, if edge ej is incident on vertex vi                           3          c, d, g
       =0, otherwise                                                    4          d, e
                                                                        5          d, e, f, g, h
                                                                        6          h
     V1        a                         V6
                       V2   f   V5 h
           b                                                            Edges
                                                              a   b    c d e         f    g h
                                                         V1   1   1    0   0   0     0    0   0
                                                         V2   1   1    1   0   0     1    0   0
                                                Vertex

                   c                 e                   V3   0   0    1   1   1     0    1   0
                                                         V4   0   0    0   1   1     0    1   0
                                                         V5   0   0    0   1   1     1    1   1
                                                         V6   0   0    0   0   0     0    0   1
               V3           d   V4
 If two vertices are connected by single path than they are known as adjacent vertices.

 If vertex is connected to itself then vertex is said to be adjacent to itself.

If vertex is adjacent then put 1 else 0.

     V1       a                                 V6
                      V2       f   V5       h                            Vertices
          b                                                          V1 V2 V3 V V5 V6
                                                                                4
                                                                V1   0 1 0 0 0 0
                                                                V2   1 0 1 0 1 0

                                                     Vertices
                  c                     e                       V3   0 1 0 1 1 0
                                                                V4   0 0 1 1 1 0
                                                                V5   0 1 1 1 0 1
                                                                V6   0 0 0 0 0 1


              V3           d       V4
Cut set is a “Set of edges in a graph whose removal leaves the graph disconnected”.

If edge of graph is a part of given cut set then put 1 else 0.
                                                                Cut Set   Edges
  Cij =1, if  jth
               cutset contains edge                               1       f, g, d
      =0, otherwise                                               2       c, g, e
                                                                  3       h
     V1       a                                 V6                4       a, b
                      V2       f   V5       h
          b                                                                      Edges
                                                                      a   b    c d e        f   g   h

                                                                1     0   0    0    1   0   1   1   0
                                                     Cut Sets

                  c                     e                       2     0   0    1    0   1   0   1   0
                                                                3     0   0    0    0   0   0   0   1
                                                                4     1   1    0    0   0   0   0   0


                V3         d       V4
Circuit can be defined as “A close walk in which no vertex/edge can appear twice”.

If edge of graph is a part of given circuit then put 1 else 0.
                                                        Circuit   Edges
  Cij =1, if circuit contains edge                         1      d, e, g
      =0, otherwise                                        2      c, f, g
                                                           3      c, d, e, f
     V1       a                         V6                 4      a, b
                      V2   f   V5 h
          b                                                              Edges
                                                              a   b    c d e           f   g   h

                                                        1     0   0    0       1   1   0   1   0
                                             Circuits

                  c                 e                   2     0   0    1       0   0   1   1   0
                                                        3     0   0    1       1   1   1   0   0
                                                        4     1   1    0       0   0   0   0   0


              V3           d   V4
Path can be defined as “A open walk in which no vertex/edge can appear twice”.

If edge of graph is a part of given path then put 1 else 0.             Path       Edges
                                                                          1         a, f, h
  P( Vj,Vi)=1,if edge is on path                        Ex: P ( V1,V6)    2         a, c, g, h
            =0, otherwise                                                 3         a, c, d, e, h
                                                                          4         b, f, h
V1       a                         V6                                     5         b, c, g, h
                                                                          6         b,c, d, e, h
                 V2   f   V5 h                                Edges
     b
                                                    a   b   c d e        f      g   h

                                                1   1   0   0   0    0   1      0   1
                                                        0
                                        Paths



             c                 e                2   1       1   0    0   0      1   1
                                                3   1   0   1   1    1   0      0   1
                                                4   0   1   0   0    0   1      0   1
                                                5   0   1   1   0    0   0      1   1
                                                6   0   1   1   1    1   0      0   1
         V3           d   V4
Matrix Representation Of Graph

Weitere ähnliche Inhalte

Was ist angesagt?

Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data StructureAnuj Modi
 
Application Of Graph Data Structure
Application Of Graph Data StructureApplication Of Graph Data Structure
Application Of Graph Data StructureGaurang Dobariya
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - GraphMadhu Bala
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graphumair khan
 
Map Coloring and Some of Its Applications
Map Coloring and Some of Its Applications Map Coloring and Some of Its Applications
Map Coloring and Some of Its Applications MD SHAH ALAM
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Graphs in data structure
Graphs in data structureGraphs in data structure
Graphs in data structurehamza javed
 
Lattices AND Hasse Diagrams
Lattices AND Hasse DiagramsLattices AND Hasse Diagrams
Lattices AND Hasse DiagramsDebarati Das
 
Adjacency And Incidence Matrix
Adjacency And Incidence MatrixAdjacency And Incidence Matrix
Adjacency And Incidence MatrixAbir Junayed
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network systemManikanta satyala
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 

Was ist angesagt? (20)

Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Application Of Graph Data Structure
Application Of Graph Data StructureApplication Of Graph Data Structure
Application Of Graph Data Structure
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
 
Euler and hamilton paths
Euler and hamilton pathsEuler and hamilton paths
Euler and hamilton paths
 
Graph theory
Graph  theoryGraph  theory
Graph theory
 
Map Coloring and Some of Its Applications
Map Coloring and Some of Its Applications Map Coloring and Some of Its Applications
Map Coloring and Some of Its Applications
 
Graph representation
Graph representationGraph representation
Graph representation
 
Trees
Trees Trees
Trees
 
Hamilton path and euler path
Hamilton path and euler pathHamilton path and euler path
Hamilton path and euler path
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Graphs in data structure
Graphs in data structureGraphs in data structure
Graphs in data structure
 
Lattices AND Hasse Diagrams
Lattices AND Hasse DiagramsLattices AND Hasse Diagrams
Lattices AND Hasse Diagrams
 
Adjacency And Incidence Matrix
Adjacency And Incidence MatrixAdjacency And Incidence Matrix
Adjacency And Incidence Matrix
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
 
Introduction to Hypergraphs
Introduction to HypergraphsIntroduction to Hypergraphs
Introduction to Hypergraphs
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 

Andere mochten auch (7)

Exergy
ExergyExergy
Exergy
 
Exergy
ExergyExergy
Exergy
 
Exergy
ExergyExergy
Exergy
 
Torsion
TorsionTorsion
Torsion
 
Ocular torsion
Ocular torsionOcular torsion
Ocular torsion
 
Shaft & Torsion
Shaft & TorsionShaft & Torsion
Shaft & Torsion
 
Cast iron its types , properties and its applications....
Cast iron its types , properties and its applications....Cast iron its types , properties and its applications....
Cast iron its types , properties and its applications....
 

Ähnlich wie Matrix Representation Of Graph

Discrete maths assignment
Discrete maths assignmentDiscrete maths assignment
Discrete maths assignmentKeshav Somani
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data StructureAnuj Modi
 
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...CORE-Materials
 
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
 
Signal Processing Course : Wavelets
Signal Processing Course : WaveletsSignal Processing Course : Wavelets
Signal Processing Course : WaveletsGabriel Peyré
 

Ähnlich wie Matrix Representation Of Graph (8)

Discrete maths assignment
Discrete maths assignmentDiscrete maths assignment
Discrete maths assignment
 
Graphs In Data Structure
Graphs In Data StructureGraphs In Data Structure
Graphs In Data Structure
 
Graph
GraphGraph
Graph
 
Graphs
GraphsGraphs
Graphs
 
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...
TALAT Lecture 2301: Design of Members Example 8.2: Torsion constants for holl...
 
07 - Graphs
07 - Graphs07 - Graphs
07 - Graphs
 
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)
 
Signal Processing Course : Wavelets
Signal Processing Course : WaveletsSignal Processing Course : Wavelets
Signal Processing Course : Wavelets
 

Mehr von Abhishek Pachisia (20)

Telecom Industry
Telecom IndustryTelecom Industry
Telecom Industry
 
Strategic alignment model (SAM)
Strategic alignment model (SAM)Strategic alignment model (SAM)
Strategic alignment model (SAM)
 
V.G. siddhartha
V.G. siddharthaV.G. siddhartha
V.G. siddhartha
 
Boeing- The Frontiers
Boeing- The FrontiersBoeing- The Frontiers
Boeing- The Frontiers
 
Top Management of 5 recognized comapanies
Top Management of 5 recognized comapaniesTop Management of 5 recognized comapanies
Top Management of 5 recognized comapanies
 
Fourier transform
Fourier transformFourier transform
Fourier transform
 
Inference engine
Inference engineInference engine
Inference engine
 
Work breakdown structure
Work breakdown structureWork breakdown structure
Work breakdown structure
 
IEEE 802.11
IEEE 802.11IEEE 802.11
IEEE 802.11
 
Cloud Service Models
Cloud Service ModelsCloud Service Models
Cloud Service Models
 
Exception handling in Java
Exception handling in JavaException handling in Java
Exception handling in Java
 
Perl
PerlPerl
Perl
 
Rpc
RpcRpc
Rpc
 
Program Evaluation and Review Technique (PERT)
Program Evaluation and Review Technique (PERT)Program Evaluation and Review Technique (PERT)
Program Evaluation and Review Technique (PERT)
 
Hydrogen energy
Hydrogen energyHydrogen energy
Hydrogen energy
 
Rms titanic
Rms titanicRms titanic
Rms titanic
 
Vb.net (loop structure)
Vb.net (loop structure)Vb.net (loop structure)
Vb.net (loop structure)
 
Tree
TreeTree
Tree
 
File System Implementation
File System ImplementationFile System Implementation
File System Implementation
 
Exception handling
Exception handlingException handling
Exception handling
 

Kürzlich hochgeladen

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 

Kürzlich hochgeladen (20)

Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 

Matrix Representation Of Graph

  • 2. Graph is a set of edges and vertices. Graph can be represented in the form of matrix. Different matrix that can be formed are: 1. Incidence Matrix 2. Adjacency Matrix 3. Cut-Set Matrix 4. Circuit Matrix 5. Path Matrix
  • 3. Edge connected to the vertex is known as incidence edge to that vertex. If vertex is incident on vertex then put 1 else 0. Vertex Edges 1 a, b 2 a, b, c, f aij =1, if edge ej is incident on vertex vi 3 c, d, g =0, otherwise 4 d, e 5 d, e, f, g, h 6 h V1 a V6 V2 f V5 h b Edges a b c d e f g h V1 1 1 0 0 0 0 0 0 V2 1 1 1 0 0 1 0 0 Vertex c e V3 0 0 1 1 1 0 1 0 V4 0 0 0 1 1 0 1 0 V5 0 0 0 1 1 1 1 1 V6 0 0 0 0 0 0 0 1 V3 d V4
  • 4.  If two vertices are connected by single path than they are known as adjacent vertices.  If vertex is connected to itself then vertex is said to be adjacent to itself. If vertex is adjacent then put 1 else 0. V1 a V6 V2 f V5 h Vertices b V1 V2 V3 V V5 V6 4 V1 0 1 0 0 0 0 V2 1 0 1 0 1 0 Vertices c e V3 0 1 0 1 1 0 V4 0 0 1 1 1 0 V5 0 1 1 1 0 1 V6 0 0 0 0 0 1 V3 d V4
  • 5. Cut set is a “Set of edges in a graph whose removal leaves the graph disconnected”. If edge of graph is a part of given cut set then put 1 else 0. Cut Set Edges Cij =1, if jth cutset contains edge 1 f, g, d =0, otherwise 2 c, g, e 3 h V1 a V6 4 a, b V2 f V5 h b Edges a b c d e f g h 1 0 0 0 1 0 1 1 0 Cut Sets c e 2 0 0 1 0 1 0 1 0 3 0 0 0 0 0 0 0 1 4 1 1 0 0 0 0 0 0 V3 d V4
  • 6. Circuit can be defined as “A close walk in which no vertex/edge can appear twice”. If edge of graph is a part of given circuit then put 1 else 0. Circuit Edges Cij =1, if circuit contains edge 1 d, e, g =0, otherwise 2 c, f, g 3 c, d, e, f V1 a V6 4 a, b V2 f V5 h b Edges a b c d e f g h 1 0 0 0 1 1 0 1 0 Circuits c e 2 0 0 1 0 0 1 1 0 3 0 0 1 1 1 1 0 0 4 1 1 0 0 0 0 0 0 V3 d V4
  • 7. Path can be defined as “A open walk in which no vertex/edge can appear twice”. If edge of graph is a part of given path then put 1 else 0. Path Edges 1 a, f, h P( Vj,Vi)=1,if edge is on path Ex: P ( V1,V6) 2 a, c, g, h =0, otherwise 3 a, c, d, e, h 4 b, f, h V1 a V6 5 b, c, g, h 6 b,c, d, e, h V2 f V5 h Edges b a b c d e f g h 1 1 0 0 0 0 1 0 1 0 Paths c e 2 1 1 0 0 0 1 1 3 1 0 1 1 1 0 0 1 4 0 1 0 0 0 1 0 1 5 0 1 1 0 0 0 1 1 6 0 1 1 1 1 0 0 1 V3 d V4