SlideShare a Scribd company logo
Graph
Algorithm
Path
• Informally, a path is a sequence of edges that
begins at a vertex of a graph and travels from
vertex to vertex along edges of the graph.
Example
• In the simple graph shown in Figure 1, a,
d, c, f , e is a simple path of length 4,
because {a, d},{d, c}, {c, f }, and {f, e} are
all edges. However, d, e, c, a is not a
path, because {e, c} is not an edge.
• Note that b, c, f , e, b is a circuit of
length 4 because {b, c}, {c, f }, {f, e}, and
{e, b} are edges, and this path begins and
ends at b.
• The path a, b, e, d, a, b, which is of
length 5, is not simple because it
contains the edge {a, b} twice.
Euler circuit
1.Can we travel along the edges of a graph
starting at a vertex and returning to it by
traversing each edge of the graph exactly
once?
• This question, which asks whether a graph has
an Euler circuit.
Definition 1
• An Euler circuit in a graph G is a simple circuit
containing every edge of G. An Euler path in G
is a simple path containing every edge of G.
Example1
• The graph G1 has an Euler circuit, for example, a, e, c, d, e, b, a. Neither of
the graphs G2 or G3 has an Euler circuit (the reader should verify this).
However, G3 has an Euler path, namely, a, c, d, e, b, d, a, b. G2 does not
have an Euler path
Theorem 2
• A connected multigraph has an Euler path but
not an Euler circuit if and only if it has exactly
two vertices of odd degree.
Example2
• G1 contains exactly two vertices of odd degree, namely, b and d. Hence, it
has an Euler path that must have b and d as its endpoints. One such Euler
path is d, a, b, c, d, b. Similarly,G2 has exactly two vertices of odd degree,
namely, b and d. So it has an Euler path that must have b and d as
endpoints. One such Euler path is b, a, g, f, e, d, c, g, b, c, f, d. G3 has no
Euler path because it has six vertices of odd degree.
Hamilton circuit
2.Similarly, can we travel along the edges of a
graph starting at a vertex and returning to it
while visiting each vertex of the graph exactly
once?
This question, which asks whether a graph has
a Hamilton circuit
Which of the simple graphs in Figure 10 have a Hamilton circuit
or, if not, a Hamilton path?
Solution
• G1 has a Hamilton circuit: a, b, c, d, e, a.
• There is no Hamilton circuit in G2 (this can be seen by noting that any
circuit containing every vertex must contain the edge {a, b} twice),
but G2 does have a Hamilton path, namely, a, b, c, d.
• G3 has neither a Hamilton circuit nor a Hamilton path, because any path
containing all vertices must contain one of the edges {a, b},{e, f }, and {c,
d} more than once.
What is the length of a shortest path between a and z in the
weighted graph shown in Figure 3?
A shortest-path algorithm
• Due to Edsger W. Dijkstra, Dutch
computer scientist born in 1930
• Dijkstra's algorithm finds the length of the
shortest path from a single vertex to any
other vertex in a connected weighted
graph.
Dijkstra’s Algorithm
Graph algorithm
Hasse diagram
If we want to make a hasse diagram of a relation it must be
Reflexive,Transitive and Anti symmetric
To make a hasse diagram we have to do these:
•omit all loops,
•omit all arrows that can be inferred from transitivity,
•draw arrows without heads,
•understand that all arrows point upwards
Problem & Solution
The hasse diagram is:
Draw the hasse diagram of this
relation?
• A={1,2,3,4}
• R={(1,1),(2,2),(3,3),(4,4),(1,2),(2,3),(1,3),(1,4)}
Ad

More Related Content

What's hot (20)

Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
Gayathri Gaayu
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
Mohamed Loey
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
sana younas
 
Algorithm Complexity and Main Concepts
Algorithm Complexity and Main ConceptsAlgorithm Complexity and Main Concepts
Algorithm Complexity and Main Concepts
Adelina Ahadova
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
Muhammad Muzammal
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Swapnil Agrawal
 
Topological Sorting
Topological SortingTopological Sorting
Topological Sorting
ShahDhruv21
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
sumitbardhan
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
MdSajjadulislamBappi
 
All pair shortest path
All pair shortest pathAll pair shortest path
All pair shortest path
Arafat Hossan
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
Pankaj Thakur
 
Algorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms IIAlgorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms II
Mohamed Loey
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
Abdullah Al-hazmy
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
Madhu Bala
 
Time and Space Complexity
Time and Space ComplexityTime and Space Complexity
Time and Space Complexity
Ashutosh Satapathy
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
smruti sarangi
 
Master method
Master method Master method
Master method
Rajendran
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
Gayathri Gaayu
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
Mohamed Loey
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
sana younas
 
Algorithm Complexity and Main Concepts
Algorithm Complexity and Main ConceptsAlgorithm Complexity and Main Concepts
Algorithm Complexity and Main Concepts
Adelina Ahadova
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa
 
Design and Analysis of Algorithms
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Swapnil Agrawal
 
Topological Sorting
Topological SortingTopological Sorting
Topological Sorting
ShahDhruv21
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
sumitbardhan
 
All pair shortest path
All pair shortest pathAll pair shortest path
All pair shortest path
Arafat Hossan
 
Algorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms IIAlgorithms Lecture 3: Analysis of Algorithms II
Algorithms Lecture 3: Analysis of Algorithms II
Mohamed Loey
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
Abdullah Al-hazmy
 
Data structure - Graph
Data structure - GraphData structure - Graph
Data structure - Graph
Madhu Bala
 
Master method
Master method Master method
Master method
Rajendran
 

Viewers also liked (13)

Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctures
zukun
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
getacew
 
1535 graph algorithms
1535 graph algorithms1535 graph algorithms
1535 graph algorithms
Dr Fereidoun Dejahang
 
Ch18
Ch18Ch18
Ch18
leminhvuong
 
Basic Mathematics (PPISMP) - representing data into bar graph
Basic Mathematics (PPISMP) - representing data into bar graphBasic Mathematics (PPISMP) - representing data into bar graph
Basic Mathematics (PPISMP) - representing data into bar graph
T-ah Atirah
 
Skiena algorithm 2007 lecture12 topological sort connectivity
Skiena algorithm 2007 lecture12 topological sort connectivitySkiena algorithm 2007 lecture12 topological sort connectivity
Skiena algorithm 2007 lecture12 topological sort connectivity
zukun
 
Simple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graphSimple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graph
Miguel Pereira
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
Graph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search TraversalGraph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search Traversal
Amrinder Arora
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
Abhishek Pachisia
 
Graph representation
Graph representationGraph representation
Graph representation
Tech_MX
 
2.2 topological sort 02
2.2 topological sort 022.2 topological sort 02
2.2 topological sort 02
Krish_ver2
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
Chuckie Balbuena
 
Skiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strcturesSkiena algorithm 2007 lecture10 graph data strctures
Skiena algorithm 2007 lecture10 graph data strctures
zukun
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
getacew
 
Basic Mathematics (PPISMP) - representing data into bar graph
Basic Mathematics (PPISMP) - representing data into bar graphBasic Mathematics (PPISMP) - representing data into bar graph
Basic Mathematics (PPISMP) - representing data into bar graph
T-ah Atirah
 
Skiena algorithm 2007 lecture12 topological sort connectivity
Skiena algorithm 2007 lecture12 topological sort connectivitySkiena algorithm 2007 lecture12 topological sort connectivity
Skiena algorithm 2007 lecture12 topological sort connectivity
zukun
 
Simple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graphSimple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graph
Miguel Pereira
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
Amrinder Arora
 
Graph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search TraversalGraph Traversal Algorithms - Depth First Search Traversal
Graph Traversal Algorithms - Depth First Search Traversal
Amrinder Arora
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
Abhishek Pachisia
 
Graph representation
Graph representationGraph representation
Graph representation
Tech_MX
 
2.2 topological sort 02
2.2 topological sort 022.2 topological sort 02
2.2 topological sort 02
Krish_ver2
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
Chuckie Balbuena
 
Ad

Similar to Graph algorithm (20)

Eurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdfEurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdf
RydaS1
 
ch10.5.pptx
ch10.5.pptxch10.5.pptx
ch10.5.pptx
GauravGautam216125
 
Ds lec 5_chap4
Ds lec 5_chap4Ds lec 5_chap4
Ds lec 5_chap4
Self-Employed
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
ansariparveen06
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
Robert Almazan
 
nossi ch 6
nossi ch 6nossi ch 6
nossi ch 6
lesaturner
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............
eustaquiojm1
 
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdfISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
murniatimurni9
 
euler paths and circuit theorem.pptx
euler paths and circuit theorem.pptxeuler paths and circuit theorem.pptx
euler paths and circuit theorem.pptx
MArunyNandinikkutty
 
Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
Hector Zenil
 
Presentation on graphs
Presentation on graphsPresentation on graphs
Presentation on graphs
ForwardBlog Enewzletter
 
Graph theory
Graph theoryGraph theory
Graph theory
manikanta361
 
GRAPH THEORY - Basic definition with examples
GRAPH THEORY - Basic definition with examplesGRAPH THEORY - Basic definition with examples
GRAPH THEORY - Basic definition with examples
Gayathri M
 
Euler graph
Euler graphEuler graph
Euler graph
AAQIB PARREY
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptx
ShubhamBatwani
 
Graph theory.pptx
Graph theory.pptxGraph theory.pptx
Graph theory.pptx
SHRIRAMMANGE
 
Chapter 4_introduction on Graph theory.pptx
Chapter 4_introduction on  Graph theory.pptxChapter 4_introduction on  Graph theory.pptx
Chapter 4_introduction on Graph theory.pptx
josephinetagupa1
 
koningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxkoningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptx
Alpa Rajput
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
Rashmi Bhat
 
graphssssssssssssssssssssssssssssss.pptx
graphssssssssssssssssssssssssssssss.pptxgraphssssssssssssssssssssssssssssss.pptx
graphssssssssssssssssssssssssssssss.pptx
FarhanAli766749
 
Eurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdfEurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdf
RydaS1
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
ansariparveen06
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
Robert Almazan
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............
eustaquiojm1
 
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdfISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
murniatimurni9
 
euler paths and circuit theorem.pptx
euler paths and circuit theorem.pptxeuler paths and circuit theorem.pptx
euler paths and circuit theorem.pptx
MArunyNandinikkutty
 
GRAPH THEORY - Basic definition with examples
GRAPH THEORY - Basic definition with examplesGRAPH THEORY - Basic definition with examples
GRAPH THEORY - Basic definition with examples
Gayathri M
 
Chapter 4_introduction on Graph theory.pptx
Chapter 4_introduction on  Graph theory.pptxChapter 4_introduction on  Graph theory.pptx
Chapter 4_introduction on Graph theory.pptx
josephinetagupa1
 
koningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxkoningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptx
Alpa Rajput
 
graphssssssssssssssssssssssssssssss.pptx
graphssssssssssssssssssssssssssssss.pptxgraphssssssssssssssssssssssssssssss.pptx
graphssssssssssssssssssssssssssssss.pptx
FarhanAli766749
 
Ad

More from University of Potsdam (20)

Computer fundamentals 01
Computer fundamentals 01Computer fundamentals 01
Computer fundamentals 01
University of Potsdam
 
Workshop on android apps development
Workshop on android apps developmentWorkshop on android apps development
Workshop on android apps development
University of Potsdam
 
Transparency and concurrency
Transparency and concurrencyTransparency and concurrency
Transparency and concurrency
University of Potsdam
 
Database System Architecture
Database System ArchitectureDatabase System Architecture
Database System Architecture
University of Potsdam
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
University of Potsdam
 
indexing and hashing
indexing and hashingindexing and hashing
indexing and hashing
University of Potsdam
 
data recovery-raid
data recovery-raiddata recovery-raid
data recovery-raid
University of Potsdam
 
Query processing
Query processingQuery processing
Query processing
University of Potsdam
 
Machine Learning for Data Mining
Machine Learning for Data MiningMachine Learning for Data Mining
Machine Learning for Data Mining
University of Potsdam
 
Tree, function and graph
Tree, function and graphTree, function and graph
Tree, function and graph
University of Potsdam
 
Sonet
SonetSonet
Sonet
University of Potsdam
 
Sets in discrete mathematics
Sets in discrete mathematicsSets in discrete mathematics
Sets in discrete mathematics
University of Potsdam
 
Set in discrete mathematics
Set in discrete mathematicsSet in discrete mathematics
Set in discrete mathematics
University of Potsdam
 
Series parallel ac rlc networks
Series parallel ac rlc networksSeries parallel ac rlc networks
Series parallel ac rlc networks
University of Potsdam
 
Series parallel ac networks
Series parallel ac networksSeries parallel ac networks
Series parallel ac networks
University of Potsdam
 
Relations
RelationsRelations
Relations
University of Potsdam
 
Relations
RelationsRelations
Relations
University of Potsdam
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
University of Potsdam
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
University of Potsdam
 
Prim algorithm
Prim algorithmPrim algorithm
Prim algorithm
University of Potsdam
 

Recently uploaded (20)

Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
Kasdorf "Accessibility Essentials: A 2025 NISO Training Series, Session 5, Ac...
National Information Standards Organization (NISO)
 
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdfAPM Midlands Region April 2025 Sacha Hind Circulated.pdf
APM Midlands Region April 2025 Sacha Hind Circulated.pdf
Association for Project Management
 
Political History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptxPolitical History of Pala dynasty Pala Rulers NEP.pptx
Political History of Pala dynasty Pala Rulers NEP.pptx
Arya Mahila P. G. College, Banaras Hindu University, Varanasi, India.
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 4-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 4-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFAExercise Physiology MCQS By DR. NASIR MUSTAFA
Exercise Physiology MCQS By DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
Kenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 CohortKenan Fellows Participants, Projects 2025-26 Cohort
Kenan Fellows Participants, Projects 2025-26 Cohort
EducationNC
 
How to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odooHow to Set warnings for invoicing specific customers in odoo
How to Set warnings for invoicing specific customers in odoo
Celine George
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
How to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of saleHow to manage Multiple Warehouses for multiple floors in odoo point of sale
How to manage Multiple Warehouses for multiple floors in odoo point of sale
Celine George
 
Link your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRMLink your Lead Opportunities into Spreadsheet using odoo CRM
Link your Lead Opportunities into Spreadsheet using odoo CRM
Celine George
 
One Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learningOne Hot encoding a revolution in Machine learning
One Hot encoding a revolution in Machine learning
momer9505
 
Grade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable WorksheetGrade 2 - Mathematics - Printable Worksheet
Grade 2 - Mathematics - Printable Worksheet
Sritoma Majumder
 
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx   quiz by Ridip HazarikaTHE STG QUIZ GROUP D.pptx   quiz by Ridip Hazarika
THE STG QUIZ GROUP D.pptx quiz by Ridip Hazarika
Ridip Hazarika
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Herbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptxHerbs Used in Cosmetic Formulations .pptx
Herbs Used in Cosmetic Formulations .pptx
RAJU THENGE
 
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdfIntroduction-to-Communication-and-Media-Studies-1736283331.pdf
Introduction-to-Communication-and-Media-Studies-1736283331.pdf
james5028
 
2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx2541William_McCollough_DigitalDetox.docx
2541William_McCollough_DigitalDetox.docx
contactwilliamm2546
 
Engage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdfEngage Donors Through Powerful Storytelling.pdf
Engage Donors Through Powerful Storytelling.pdf
TechSoup
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 

Graph algorithm

  • 2. Path • Informally, a path is a sequence of edges that begins at a vertex of a graph and travels from vertex to vertex along edges of the graph.
  • 3. Example • In the simple graph shown in Figure 1, a, d, c, f , e is a simple path of length 4, because {a, d},{d, c}, {c, f }, and {f, e} are all edges. However, d, e, c, a is not a path, because {e, c} is not an edge. • Note that b, c, f , e, b is a circuit of length 4 because {b, c}, {c, f }, {f, e}, and {e, b} are edges, and this path begins and ends at b. • The path a, b, e, d, a, b, which is of length 5, is not simple because it contains the edge {a, b} twice.
  • 4. Euler circuit 1.Can we travel along the edges of a graph starting at a vertex and returning to it by traversing each edge of the graph exactly once? • This question, which asks whether a graph has an Euler circuit.
  • 5. Definition 1 • An Euler circuit in a graph G is a simple circuit containing every edge of G. An Euler path in G is a simple path containing every edge of G.
  • 6. Example1 • The graph G1 has an Euler circuit, for example, a, e, c, d, e, b, a. Neither of the graphs G2 or G3 has an Euler circuit (the reader should verify this). However, G3 has an Euler path, namely, a, c, d, e, b, d, a, b. G2 does not have an Euler path
  • 7. Theorem 2 • A connected multigraph has an Euler path but not an Euler circuit if and only if it has exactly two vertices of odd degree.
  • 8. Example2 • G1 contains exactly two vertices of odd degree, namely, b and d. Hence, it has an Euler path that must have b and d as its endpoints. One such Euler path is d, a, b, c, d, b. Similarly,G2 has exactly two vertices of odd degree, namely, b and d. So it has an Euler path that must have b and d as endpoints. One such Euler path is b, a, g, f, e, d, c, g, b, c, f, d. G3 has no Euler path because it has six vertices of odd degree.
  • 9. Hamilton circuit 2.Similarly, can we travel along the edges of a graph starting at a vertex and returning to it while visiting each vertex of the graph exactly once? This question, which asks whether a graph has a Hamilton circuit
  • 10. Which of the simple graphs in Figure 10 have a Hamilton circuit or, if not, a Hamilton path?
  • 11. Solution • G1 has a Hamilton circuit: a, b, c, d, e, a. • There is no Hamilton circuit in G2 (this can be seen by noting that any circuit containing every vertex must contain the edge {a, b} twice), but G2 does have a Hamilton path, namely, a, b, c, d. • G3 has neither a Hamilton circuit nor a Hamilton path, because any path containing all vertices must contain one of the edges {a, b},{e, f }, and {c, d} more than once.
  • 12. What is the length of a shortest path between a and z in the weighted graph shown in Figure 3?
  • 13. A shortest-path algorithm • Due to Edsger W. Dijkstra, Dutch computer scientist born in 1930 • Dijkstra's algorithm finds the length of the shortest path from a single vertex to any other vertex in a connected weighted graph.
  • 16. Hasse diagram If we want to make a hasse diagram of a relation it must be Reflexive,Transitive and Anti symmetric To make a hasse diagram we have to do these: •omit all loops, •omit all arrows that can be inferred from transitivity, •draw arrows without heads, •understand that all arrows point upwards
  • 17. Problem & Solution The hasse diagram is:
  • 18. Draw the hasse diagram of this relation? • A={1,2,3,4} • R={(1,1),(2,2),(3,3),(4,4),(1,2),(2,3),(1,3),(1,4)}