Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Eulerian path can be implemented in linear time, but not Hamiltonian path?

Tags:

graph-theory

I learned that even though seemingly similar, Eulerian path can be solved in linear time while Hamiltonian path problem is NP-complete. I wonder what is the reason that underlies this difference? I don't know too much graph theory so probably won't understand well a rigorous proof, but some jargons should be fine.

like image 533
Jingping Avatar asked Dec 28 '22 14:12

Jingping


1 Answers

Basically, the Euler problem can be solved with dynamic programming, and the Hamilton problem can't.

This means that if you have a subset of your graph and find a valid circular path through it, you can combined this partial solution with other partial solutions and find a globally valid path. That isn't so for the optimal path: even after you have found the optimal path through a small part of a graph, this may very well not be a part of the globally optimal path (and in fact, it usually isn't). Informally, the optimal path through a large graph depends on the exact values in all other parts of the graph, and therefore no one has ever found a way to use "divide and conquer" correctly on the problem.

like image 87
Kilian Foth Avatar answered Jan 14 '23 15:01

Kilian Foth