It is necessary to find from the given vertex of the graph the shortest path through all the vertices of the given graph (without returning to the starting point, i.e. chain / path). It is assumed that the graph will be full oriented.

Such a task is the search for the Hamiltonian path, only taking into account that at each vertex you can return as many times as you like.

Maybe there are some modifications or ready-made solutions?

It will suit me as a fully disclosed answer, as well as a link to a source with material on the above topic or even a small hint: "which way to dig."

    1 answer 1

    Alternatively, use the Ford algorithm in any implementation (stack, queue, priority queue).

    • Not quite understand how it fits? He is also looking for the shortest path from the selected vertex to all the vertices of the graph. And it is necessary to find a path passing through all the peaks but with the possibility of returning to the peaks (a kind of modification of the traveling salesman's task) - Sergey whats
    • path and chain - 2 different things .. - UserLevel0
    • Ford's algorithm builds the shortest PATH of a weighted oriented graph. - UserLevel0
    • Well, thanks for the clarifications in terminology, then the CHAIN ​​is interested. - Sergey whats
    • It's my pleasure. Contact us. - UserLevel0