Can some one tell me the difference between Hamiltonian path and euler path. Both seems similar!
Thanks & Regards,
Mousey
Can some one tell me the difference between Hamiltonian path and euler path. Both seems similar!
Thanks & Regards,
Mousey
Eulerian path must visit each edge exactly once, while Hamiltonian path must visit each vertex exactly once.
A Hamiltonian path visits every node (or vertex) exactly once, and a Eulerian path traverses every edge exactly once.
A Euler path is a path that crosses every edge exactly once without repeating, if it ends at the initial vertex then it is a Euler cycle.
A Hamiltonian path passes through each vertex (note not each edge), exactly once, if it ends at the initial vertex then it is a Hamiltonian cycle.
In a Euler path you might pass through a vertex more than once.
In a Hamiltonian path you may not pass though all edges.
They are related but are neither dependent nor mutually exclusive. If a graph has an Eurler cycle, it may or may not also have a Hamiltonian cyle and vice versa.
Euler cycles visit every edge in the graph exactly once. If there are vertices in the graph with more than two edges, then by definition, the cycle will pass through those vertices more than once. As a result, vertices can be repeated but edges cannot.
Hamiltonian cycles visit every vertex in the graph exactly once (similar to the travelling salesman problem). As a result, neither edges nor vertices can be repeated.