Find the shortest path in a graph visiting all nodes

前端 未结 2 651
囚心锁ツ
囚心锁ツ 2021-01-13 09:45

I have a weighted and undirected graph G with n vertices. Two of these vertices are X and Y.
I need to find the short

2条回答
  •  耶瑟儿~
    2021-01-13 10:05

    Try to look at Dijkstra's algorithm

    The basic idea is to filter the routes that traverse all the nodes and get the route with the shortest path.

    Bu actually this may be not an optimal way.

提交回复
热议问题