There is an undirected weighted graph in the general case. How to find the shortest paths in it is well known. But I want to find the longest path between two peaks in the graph.

Of course, if there are cycles in the graph, then the problem has no solution. And if you ask a question like "the longest acyclic path between peaks"? It seems that this path should be? Do not indicate which algorithm you can see?

0