How to write this pseudocode in matlab?
24 次查看(过去 30 天)
显示 更早的评论
Dijkstra algorithm's - pseudo code
- For each node n in the graph - 0 n.distance = Infinity
- Create an empty list.
- start.distance = 0,add start to list.
- While list not empty
- Let current = node in the list with the smallest distance, remove current from list
- For each node, n that is adjacent to current
If n.distance > current.distance + length of edge from n to current
n.distance = current.distance + length of edge from n to current
n.parent = current
add n to list if isn't there already
2 个评论
Walter Roberson
2020-7-3
Chanya Selvan:
If you feel that the question is not clear, then as you are the person who posted the question, it is up to you to clarify it.
回答(2 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dijkstra algorithm 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!