SlideShare a Scribd company logo
1 of 18
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
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)}

More Related Content

What's hot

Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesFellowBuddy.com
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic NotationsRishabh Soni
 
Time space trade off
Time space trade offTime space trade off
Time space trade offanisha talwar
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplicationMegha V
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithmMohd Arif
 
Topological Sorting
Topological SortingTopological Sorting
Topological SortingShahDhruv21
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmGaurav Kolekar
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's AlgorithmTanmay Baranwal
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithmsana younas
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptAntaraBhattacharya12
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsMohamed Loey
 

What's hot (20)

Design & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture NotesDesign & Analysis of Algorithms Lecture Notes
Design & Analysis of Algorithms Lecture Notes
 
Asymptotic Notations
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
 
Time space trade off
Time space trade offTime space trade off
Time space trade off
 
Strassen's matrix multiplication
Strassen's matrix multiplicationStrassen's matrix multiplication
Strassen's matrix multiplication
 
Daa notes 1
Daa notes 1Daa notes 1
Daa notes 1
 
Heaps
HeapsHeaps
Heaps
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Tsp is NP-Complete
Tsp is NP-CompleteTsp is NP-Complete
Tsp is NP-Complete
 
Graph algorithms
Graph algorithmsGraph algorithms
Graph algorithms
 
Topological Sorting
Topological SortingTopological Sorting
Topological Sorting
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
 
N queen problem
N queen problemN queen problem
N queen problem
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Bellman Ford's Algorithm
Bellman Ford's AlgorithmBellman Ford's Algorithm
Bellman Ford's Algorithm
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Bfs and Dfs
Bfs and DfsBfs and Dfs
Bfs and Dfs
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 

Viewers also liked

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 strctureszukun
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graphgetacew
 
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 graphT-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 connectivityzukun
 
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 graphMiguel Pereira
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchAmrinder 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 TraversalAmrinder Arora
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of GraphAbhishek Pachisia
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
2.2 topological sort 02
2.2 topological sort 022.2 topological sort 02
2.2 topological sort 02Krish_ver2
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theoryChuckie Balbuena
 

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
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
 
1535 graph algorithms
1535 graph algorithms1535 graph algorithms
1535 graph algorithms
 
Ch18
Ch18Ch18
Ch18
 
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
 
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
 
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
 
Graph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First SearchGraph Traversal Algorithms - Breadth First Search
Graph Traversal Algorithms - Breadth First Search
 
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
 
Matrix Representation Of Graph
Matrix Representation Of GraphMatrix Representation Of Graph
Matrix Representation Of Graph
 
Graph representation
Graph representationGraph representation
Graph representation
 
2.2 topological sort 02
2.2 topological sort 022.2 topological sort 02
2.2 topological sort 02
 
introduction to graph theory
introduction to graph theoryintroduction to graph theory
introduction to graph theory
 

Similar to Graph algorithm

Eurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdfEurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdfRydaS1
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfansariparveen06
 
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.pdfmurniatimurni9
 
euler paths and circuit theorem.pptx
euler paths and circuit theorem.pptxeuler paths and circuit theorem.pptx
euler paths and circuit theorem.pptxMArunyNandinikkutty
 
koningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxkoningsbergproblem-140215072342-phpapp02 (1).pptx
koningsbergproblem-140215072342-phpapp02 (1).pptxAlpa Rajput
 
Koningsberg bridge problem
Koningsberg  bridge  problemKoningsberg  bridge  problem
Koningsberg bridge problemSudiksha Joshi
 

Similar to Graph algorithm (20)

Eurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdfEurler_Hamilton_Path_Circuit.pdf
Eurler_Hamilton_Path_Circuit.pdf
 
ch10.5.pptx
ch10.5.pptxch10.5.pptx
ch10.5.pptx
 
Ds lec 5_chap4
Ds lec 5_chap4Ds lec 5_chap4
Ds lec 5_chap4
 
distructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdfdistructweek15graphstheoryupdated-160227143444.pdf
distructweek15graphstheoryupdated-160227143444.pdf
 
Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)Distruct week 15 graphs theory (updated)
Distruct week 15 graphs theory (updated)
 
nossi ch 6
nossi ch 6nossi ch 6
nossi ch 6
 
Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............Final-term Coverage.pptx. ..............
Final-term Coverage.pptx. ..............
 
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdfISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
ISOMORFISME, CONNECTIVITY EULER HAMILTON.pdf
 
euler paths and circuit theorem.pptx
euler paths and circuit theorem.pptxeuler paths and circuit theorem.pptx
euler paths and circuit theorem.pptx
 
Unit 2: All
Unit 2: AllUnit 2: All
Unit 2: All
 
Presentation on graphs
Presentation on graphsPresentation on graphs
Presentation on graphs
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Euler graph
Euler graphEuler graph
Euler graph
 
FCS (graphs).pptx
FCS (graphs).pptxFCS (graphs).pptx
FCS (graphs).pptx
 
Graph theory.pptx
Graph theory.pptxGraph theory.pptx
Graph theory.pptx
 
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 ds
Graph dsGraph ds
Graph ds
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Koningsberg bridge problem
Koningsberg  bridge  problemKoningsberg  bridge  problem
Koningsberg bridge problem
 

More from University of Potsdam (20)

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

Recently uploaded

Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of PlayPooky Knightsmith
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsNbelano25
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfstareducators107
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonhttgc7rh9c
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17Celine George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use CasesTechSoup
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningMarc Dusseiller Dusjagr
 

Recently uploaded (20)

Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Simple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdfSimple, Complex, and Compound Sentences Exercises.pdf
Simple, Complex, and Compound Sentences Exercises.pdf
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Introduction to TechSoup’s Digital Marketing Services and Use Cases
Introduction to TechSoup’s Digital Marketing  Services and Use CasesIntroduction to TechSoup’s Digital Marketing  Services and Use Cases
Introduction to TechSoup’s Digital Marketing Services and Use Cases
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 

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.
  • 15.
  • 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)}