- Either will have eularian cycle
- Start and end at different vertices
- if a graph is connected, and the degree of every vertex is even then it must have eularian cycle
- Check if eulerian path exist
- Find a valid starting and ending node
- Starting node: Node with exactly one extra outgoing edge
out[1] - in[1] = 2 - 1 = 1
- Ending node: Node with exactly one extra incoming edge
Note: If all in and out degree are equal (Eulerian cycle case) then any node with non zero degree will servce as suitable starting node.in[6] - out[6] = 2 - 1 = 1
- Can we apply
DFS
?
https://www.youtube.com/watch?v=8MpoO2zA2l4&ab_channel=WilliamFiset