Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
955 views
in Technique[技术] by (71.8m points)

networkx - 在Dijkstra算法中确定访问了多少个节点(Determining how many nodes where visited in Dijkstra's algorithm)

I am trying to find the shortest path in a graph from a source to a target as well as to find out the number of nodes visited.

(我试图找到图中从源到目标的最短路径,并找出访问的节点数。)

I can find the path using the networkx algorithms method.

(我可以使用networkx算法方法找到路径。)

But it seems that I just get the path from source to target not the number of nodes visited in order to perform the search of the path.

(但是似乎我只是获得从源到目标的路径,而不是为了执行路径搜索而访问的节点数。)

Any idea on how to do it?

(有什么想法吗?)

nx.dijkstra_path(G, 0, 28)
  ask by Zara translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...