Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven...
Transcript of Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven...
![Page 2: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/2.jpg)
Graphs
![Page 3: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/3.jpg)
Even and Odd Degrees
Even: 2𝑘
Odd: 2𝑘 + 1
Basics of Graph Theory
![Page 4: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/4.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 5: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/5.jpg)
Even and Odd Degrees
Suppose we have 5 friends:
Alice, Bob, Carl, Diane, Eve
Basics of Graph Theory
![Page 6: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/6.jpg)
Basics of Graph Theory
![Page 7: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/7.jpg)
Basics of Graph Theory
![Page 8: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/8.jpg)
Basics of Graph Theory
![Page 9: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/9.jpg)
Basics of Graph Theory
![Page 10: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/10.jpg)
Basics of Graph Theory
![Page 11: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/11.jpg)
Basics of Graph Theory
![Page 12: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/12.jpg)
Basics of Graph Theory
![Page 13: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/13.jpg)
Basics of Graph Theory
![Page 14: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/14.jpg)
Basics of Graph Theory
![Page 15: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/15.jpg)
Basics of Graph Theory
![Page 16: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/16.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 17: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/17.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 18: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/18.jpg)
Basics of Graph Theory Even and Odd Degrees
Even: 2𝑘
Odd: 2𝑘 + 1
![Page 19: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/19.jpg)
Even and Odd Degrees
Basics of Graph Theory
This impliesIf a graph has an odd number of nodes,
then the number of nodes with odd degree is even
Because
Odd + Even = Odd|Even degree nodes| + |Odd degree nodes| = |Total nodes|
![Page 20: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/20.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 21: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/21.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 22: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/22.jpg)
Even and Odd Degrees
Basics of Graph Theory
This impliesIf a graph has an even number of nodes, then the number of nodes with odd degree is even Because
Even + Even = Even|Even degree nodes| + |Odd degree nodes| = |Total nodes|
![Page 23: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/23.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 24: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/24.jpg)
Proof
Basics of Graph Theory
![Page 25: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/25.jpg)
Proof
Basics of Graph Theory
![Page 26: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/26.jpg)
Proof
Basics of Graph Theory
|Odd-Degree Nodes| = Even
Even + 2 = Even
![Page 27: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/27.jpg)
Proof
Basics of Graph Theory
|Odd-Degree Nodes| = Even
Even – 2 = Even
![Page 28: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/28.jpg)
Proof
Basics of Graph Theory
|Odd-Degree Nodes| = Even
Odd + 1 = Even
Even + 1 = Odd
![Page 29: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/29.jpg)
Even and Odd Degrees
Basics of Graph Theory
![Page 30: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/30.jpg)
Basics of Graph Theory
![Page 31: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/31.jpg)
Practice ProblemsTry to solve at your own
![Page 32: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/32.jpg)
Practice ProblemsTry to solve at your own
![Page 33: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/33.jpg)
Practice ProblemsTry to solve at your own
![Page 34: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/34.jpg)
GraphsPaths, Cycles and Connectivity
![Page 35: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/35.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Paths
• Cycles
![Page 36: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/36.jpg)
Recap
• Graph: 𝐺(𝑉, 𝐸) – V: Set of vertices 𝑣0 , 𝑣1 , 𝑣2 ,⋯ , 𝑣𝑛 ,
E: Set of edges 𝑒0 , 𝑒1 , 𝑒2 , ⋯ , 𝑒𝑚
![Page 37: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/37.jpg)
Recap
• Graph: 𝐺(𝑉, 𝐸) – V: Set of vertices 𝑣0 , 𝑣1 , 𝑣2 ,⋯ , 𝑣𝑛 ,
E: Set of edges 𝑒0 , 𝑒1 , 𝑒2 , ⋯ , 𝑒𝑚
• Empty Graph: n vertices and Zero edges
• Complete Graph: 𝐾𝑛: n vertices and All Possible edges
Number of Edges = 𝑛2
=𝑛 𝑛−1
2
![Page 38: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/38.jpg)
Recap
• Graph: 𝐺(𝑉, 𝐸) – V: Set of vertices 𝑣0 , 𝑣1 , 𝑣2 ,⋯ , 𝑣𝑛 ,
E: Set of edges 𝑒0 , 𝑒1 , 𝑒2 , ⋯ , 𝑒𝑚
• Complement of a Graph: ҧ𝐺 𝑉, 𝐸 :
Draw the missing edges, and delete the existing edges (Just take the complement of Edge set E)
![Page 39: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/39.jpg)
Recap
• Graph: 𝐺(𝑉, 𝐸) – V: Set of vertices 𝑣0 , 𝑣1 , 𝑣2 ,⋯ , 𝑣𝑛 ,
E: Set of edges 𝑒0 , 𝑒1 , 𝑒2 , ⋯ , 𝑒𝑚
• Complement of a Graph: ҧ𝐺 𝑉, 𝐸 :
Draw the missing edges, and delete the existing edges (Just take the complement of Edge set E)
![Page 40: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/40.jpg)
Recap• Examples: Verify these at your own
Complement of a Graph: ҧ𝐺 𝑉, 𝐸 :
Draw the missing edges, and delete the existing edges (Just take the complement of Edge set E)
![Page 41: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/41.jpg)
• Star Graphs: Take a particular node and connect it to all other 𝑛 − 1 nodes.
This graph has 𝑛 − 1 edges.
Recap
![Page 42: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/42.jpg)
• SubGraphs: Take any part of the graph – it will be Subgraph of the Graph (just like subset of a set)
Recap
![Page 43: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/43.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Path: Place all the nodes in a row and connect the consecutive nodes – we shall get a chain (or path ) with 𝑛 − 1 edges.
The first and last nodes are called the end points.
End points have degree = 1
Intermediate nodes have degree = 2
![Page 44: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/44.jpg)
Basics of Graph Theory
![Page 45: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/45.jpg)
Basics of Graph Theory
![Page 46: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/46.jpg)
Basics of Graph Theory
![Page 47: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/47.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Path: Place all the nodes in a row and connect the consecutive nodes – we shall get a chain (or path ) with 𝑛 − 1 edges.
• If we also connect the first and last node – we complete a circular path – it is called CYCLE.
![Page 48: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/48.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Path: Place all the nodes in a row and connect the consecutive nodes – we shall get a chain (or path ) with 𝑛 − 1 edges.
• If we also connect the first and last node – we complete a circular path – it is called CYCLE.
We may draw same graph in many ways
![Page 49: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/49.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Connected Graph: If every two nodes in the graph are connected by a path.
We can reach from any node 𝑎 to a node 𝑏, following a path.
![Page 50: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/50.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Connected Graph: If every two nodes in the graph are connected by a path.
We can reach from any node 𝑎 to a node 𝑏, following a path.
![Page 51: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/51.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Connected Graph: If every two nodes in the graph are connected by a path.
We can reach from any node 𝑎 to a node 𝑏, following a path.
Bridge: if we remove this
edge, the graph becomes disconnected
![Page 52: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/52.jpg)
Paths and Cycles(Section 7.2 of textbook)
Example:Connected Graphs on 5 nodes
![Page 53: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/53.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Walk: A walk in a graph 𝐺 is a sequence of nodes 𝑣0 , 𝑣1 , ⋯ , 𝑣𝑛 which are connected by edges in the given sequence.
It is just like a PATH where nodes may be REPEATED.
![Page 54: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/54.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Walk: A walk in a graph 𝐺 is a sequence of nodes 𝑣0 , 𝑣1 , ⋯ , 𝑣𝑛 which are connected by edges in the given sequence.
It is just like a PATH where nodes may be REPEATED.
For example:
![Page 55: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/55.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Walk: A walk in a graph 𝐺 is a sequence of nodes 𝑣0 , 𝑣1 , ⋯ , 𝑣𝑛 which are connected by edges in the given sequence.
It is just like a PATH where nodes may be REPEATED.
For example:
![Page 56: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/56.jpg)
Paths and Cycles(Section 7.2 of textbook)
• Walk: A walk in a graph 𝐺 is a sequence of nodes 𝑣0 , 𝑣1 , ⋯ , 𝑣𝑛 which are connected by edges in the given sequence.
It is just like a PATH where nodes may be REPEATED.
For example:
![Page 57: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/57.jpg)
• Eulerian Walk: A walk in a graph 𝐺 such that each edge is visited ONLY ONCE.
Eulerian Walk and Hamiltonian Cycles(Section 7.3 of textbook)
![Page 58: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/58.jpg)
Seven Bridges of Königsberg
• Cross each of seven bridges once and return back to starting point.
Eulerian Walk and Hamiltonian Cycles(Section 7.3 of textbook)
![Page 59: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/59.jpg)
Seven Bridges of Königsberg
• Cross each of seven bridges once and return back to starting point.
• Let’s make graph of the problem. Replace LAND by NODESand BRIDGES by EDGES, connecting the lands.
Eulerian Walk and Hamiltonian Cycles(Section 7.3 of textbook)
![Page 60: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/60.jpg)
Let’s Re-draw it: … and the Eulerian Trail
• Cross each of seven bridges once and return back to starting point.
• Eulerian Trail/Path: In a graph G, there is a closed path which traverse each edge ONLY ONCE and returns back to the starting point. ➔ such graph is called Eulerian Graph.
Eulerian Walk and Hamiltonian Cycles(Section 7.3 of textbook)
![Page 61: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/61.jpg)
• Eulerian Graph: A graph containing Eulerian Path
Eulerian Graph(Section 7.3 of textbook)
1
2 3
4
5
6
7
89
10
11
12
![Page 62: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/62.jpg)
• Eulerian Graph: A graph containing Eulerian Path
Eulerian Graph Semi-Eulerian Graph Non-Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 63: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/63.jpg)
• Which graph is an Eulerian Graph ?
Eulerian Graph Semi-Eulerian Graph Non-Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 64: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/64.jpg)
• Which graph is an Eulerian Graph ?
• Lemma: If in a graph G, every vertex has a degree at least 2, then G contains a cycle.
Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 65: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/65.jpg)
• Which graph is an Eulerian Graph ?
• Lemma: If in a graph G, every vertex has a degree at least 2, then G contains a cycle.
• Theorem (Euler, 1736): A connected graph G is Eulerian if and only if the degree of each vertex is even.• Proof: ☺
Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 66: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/66.jpg)
• Which graph is an Eulerian Graph ?
• Lemma: If in a graph G, every vertex has a degree at least 2, then G contains a cycle.
• Theorem (Euler, 1736): A connected graph G is Eulerian if and only if the degree of each vertex is even.• Proof: ☺
• Semi-Eulerian: if and only if it has exactly
two vertices of odd degree. Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 67: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/67.jpg)
• Theorem (Euler, 1736): A connected graph G is Eulerian if and only if the degree of each vertex is even.
• Proof: ☺
• How to construct: Fleury’s Algorithm:
Eulerian Graph
Eulerian Graph(Section 7.3 of textbook)
![Page 68: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/68.jpg)
Eulerian Graph: Fleury’s Algorithm
• How to construct:
Eulerian Graph(Section 7.3 of textbook)
![Page 69: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/69.jpg)
Eulerian Graph: Fleury’s Algorithm
• Try with these:
Eulerian Graph(Section 7.3 of textbook)
![Page 70: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/70.jpg)
Eulerian Graph: Fleury’s Algorithm
• Try with these: Seven Bridges of Königsberg
Eulerian Graph(Section 7.3 of textbook)
![Page 71: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/71.jpg)
Eulerian Graph: Fleury’s Algorithm
• Try with these: Seven Bridges of Königsberg
NOT SOLVABLE
Eulerian Graph(Section 7.3 of textbook)
![Page 72: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/72.jpg)
Exercises
Eulerian Graph(Section 7.3 of textbook)
![Page 73: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/73.jpg)
Exercises
Eulerian Graph(Section 7.3 of textbook)
![Page 74: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/74.jpg)
Exercises
Eulerian Graph(Section 7.3 of textbook)
![Page 75: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/75.jpg)
• Hamiltonian Cycle: A cycle in a graph 𝐺 such that each NODE is visited ONLY ONCE.
Eulerian Walk and Hamiltonian Cycles(Section 7.3 of textbook)
![Page 76: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/76.jpg)
Hamiltonian Graph
• Hamiltonian Cycle: In a graph G, there is a closed path which traverse each vertex ONLY ONCE and returns back to the starting point. ➔ such graph is called Hamiltonian Graph.
![Page 77: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/77.jpg)
Hamiltonian Graph
• Hamiltonian Cycle: In a graph G, there is a closed path which traverse each vertex ONLY ONCE and returns back to the starting point. ➔ such graph is called Hamiltonian Graph.
Hamiltonian GraphSemi-Hamiltonian Graph
Non-Hamiltonian Graph
![Page 78: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/78.jpg)
Hamiltonian Graph
• Which graphs are Hamiltonian?.
![Page 79: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/79.jpg)
Hamiltonian Graph
• Which graphs are Hamiltonian?.
• Theorem (Dirac 1952):If G is a simple graph with n ≥3, and if deg(v) ≥ n/2 for each vertex v, then G is Hamiltonian.
![Page 80: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/80.jpg)
Hamiltonian Graph
• Which graphs are Hamiltonian?.
• Theorem (Dirac 1952):If G is a simple graph with n ≥3, and if deg(v) ≥ n/2 for each vertex v, then G is Hamiltonian.
• Theorem (Ore 1960):If G is a simple graph with n ≥3, and if deg(v) + deg(w) ≥ n, for each pair of non-adjacent vertices v and w, then G is Hamiltonian.
![Page 81: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/81.jpg)
Exercises
![Page 82: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/82.jpg)
Exercises
Dodecahedron is Hamiltonian.
![Page 83: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/83.jpg)
Exercises
![Page 84: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/84.jpg)
Exercises
In a complete graph on 𝑛 nodes, 𝐾𝑛, how many Hamiltonian Cycles should be there?
e.g. 𝐾5Hamiltonian Cycles:
A-B-C-D-E-A
A-B-D-C-E-A
A-C-E-D-B-A
How many Hamiltonian Cycles: 4!
2𝑛− 1 !
2
![Page 85: Graph Theory Basics · Let’s Re-draw it: … and the Eulerian Trail •Cross each of seven bridges once and return back to starting point. •Eulerian Trail/Path: In a graph G,](https://reader033.fdocuments.in/reader033/viewer/2022060307/5f09dc847e708231d428d96d/html5/thumbnails/85.jpg)
Practice ProblemsTry to solve at your own