MATLAB Answers

Return all ShortestPath explored nodes

조회 수: 4(최근 30일)
Saharsh Bansal
Saharsh Bansal 2021년 7월 3일
댓글: Aparajith Raghuvir 2021년 7월 8일
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
Aparajith Raghuvir 2021년 7월 7일
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
Aparajith Raghuvir
Aparajith Raghuvir 2021년 7월 8일
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.

댓글을 달려면 로그인하십시오.


제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by