MATLAB Answers

Return all ShortestPath explored nodes

4 views (last 30 days)
Saharsh Bansal
Saharsh Bansal on 3 Jul 2021
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

Answers (2)

Aparajith Raghuvir
Aparajith Raghuvir on 7 Jul 2021
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 Comments
Aparajith Raghuvir
Aparajith Raghuvir on 8 Jul 2021
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.

Sign in to comment.


Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by