How to write this pseudocode in matlab?

Dijkstra algorithm's - pseudo code
  1. For each node n in the graph - 0 n.distance = Infinity
  2. Create an empty list.
  3. start.distance = 0,add start to list.
  4. 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
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개)

Chanya Selvan
Chanya Selvan 2020년 7월 3일

0 개 추천

From the source node (green coloured box) require to reach the target node (yellow coloured box) using the shortest route.The Dijkstra algorithm using the pseudocode is shown above which requires to be interpreted to MATLAB program. Kindly assist to solve this problem.Thanks.

카테고리

질문:

2020년 7월 2일

댓글:

2020년 7월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by