Algorithm to find a linear path of minimum weight in a graph that connects all the vertices exactly once?

This problem is known to be NP-hard by a reduction from the Hamiltonian path problem since if you give all the edges weight 1 and ask "is there a linear path of weight at most n?" then the answer is "yes" precisely if the graph contains a Hamiltonian path. As a result, you are unlikely to find an algorithm that works better than pure brute force, since unless P = NP there are no polynomial-time solutions.

While I think @templatetypedef is correct and this is really an instance of the Hamiltonian Path problem, you'll probably get better results by Googling for traveling salesman problem -- it's close enough that most (all?) TSP heuristics will work for you as well (the sole difference is that TSP is at least normally described as adding a path from the end back to the beginning, so it forms a "ring" instead of just a line). TSP also typically assumes a complete graph (i.e. , every node connects to every other); if your graph isn't complete, you can still use the normal algorithms by adding a connection of infinite weight between any unconnected nodes.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions