- given a graph with N nodes, and two specific nodes A and B
- the graph is undirected and no edge has a negative cost
- there exists at least one Hamiltonian path with A and B as an end points
Is there a way to find the shortest path from A to B that passes through all the other points?
Note: I'm only concerned with the specific given nodes A and B as endpoints, thus there's no need to compute for other Hamiltonian paths with different endpoints.
I'm thinking if it's possible to modify Dijkstra's shortest path algorithm to find Hamiltonian paths. Is it possible? If so, how? If not, is there any other algorithm that can be used? (in polynomial time)