Return all ShortestPath explored nodes

3 次查看(过去 30 天)
Is there a way for me to get a list of all explored nodes in the function
shortestpath(G,s,t)
Or if there is a different way that I can get a list of all explored nodes in BFS and Dijkstra

回答(2 个)

Aparajith Raghuvir
I understand you need to get a list of all explored nodes in BFS and Djikstra's shortest path algorithms
You may run the following code
edit shortestpath
This would give you the source code of the shortestpath function that you may modify to extract the list of all explored nodes
  4 个评论
Bruno Luong
Bruno Luong 2021-7-7
Aparajith Raghuvir have you tried it? The shortestpath file is a wrapper, the algorithm (such as bfsShortestPaths) seems to run on non-m file.
Aparajith Raghuvir
Oh, if that is the case then unfortunately you may need to code the algorithms yourself to get all nodes that were explored as part of it.

请先登录,再进行评论。


Bruno Luong
Bruno Luong 2021-7-7
编辑:Bruno Luong 2021-7-7

类别

Help CenterFile Exchange 中查找有关 Dijkstra algorithm 的更多信息

产品


版本

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by