[algorithm] Difference between hamiltonian path and euler path

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.

Examples related to algorithm

How can I tell if an algorithm is efficient? Find the smallest positive integer that does not occur in a given sequence Efficiently getting all divisors of a given number Peak signal detection in realtime timeseries data What is the optimal algorithm for the game 2048? How can I sort a std::map first by value, then by key? Finding square root without using sqrt function? Fastest way to flatten / un-flatten nested JSON objects Mergesort with Python Find common substring between two strings

Examples related to graph

How to plot multiple functions on the same figure, in Matplotlib? Python equivalent to 'hold on' in Matlab How to combine 2 plots (ggplot) into one plot? how to draw directed graphs using networkx in python? What is the difference between dynamic programming and greedy approach? Plotting using a CSV file Python equivalent of D3.js Count number of times a date occurs and make a graph out of it How do I create a chart with multiple series using different X values for each series? Rotating x axis labels in R for barplot

Examples related to graph-theory

Why is the time complexity of both DFS and BFS O( V + E ) Find all paths between two graph nodes When is it practical to use Depth-First Search (DFS) vs Breadth-First Search (BFS)? Difference between hamiltonian path and euler path How to draw a graph in LaTeX? When should I use Kruskal as opposed to Prim (and vice versa)? Find the paths between two given nodes? Finding all cycles in a directed graph Cycles in an Undirected Graph Best algorithm for detecting cycles in a directed graph

Examples related to hamiltonian-path

Difference between hamiltonian path and euler path

Examples related to euler-path

Difference between hamiltonian path and euler path