Download presentation
Presentation is loading. Please wait.
Published byShon Goodman Modified over 9 years ago
1
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali : www.2july-maths.co.uk
2
Set up 1 : Decide on a Start Node and End Node. Set up 2 : Add a recording box to each node in the network – use the following format to help keep track of each choice : Box 1 : Route length to this node Box 2 : Shortest Route Box 3 : Node order Step 1 : For first node label Box 1, 2 and 3 all 0. Step 2 : Each node has Box 1 labeled as the shortest distance to this node from the start so far. Step 3 : Go from each node labeled so far, and replace Box 1 value if a new shortest path from the start is found. Step 4 : Repeat 3, for all nodes in the network. Label Box 2 when you have checked the shortest path has been found. Label Box 3 with the node order number through the path. Box 3Box 2 Box 1 Dijkstra’s algorithm used to find the shortest path through a network.
3
Step 4 : Repeat 3, for all nodes in the network. Label Box 2 when you have checked the shortest path has been found. Label Box 3 with the node order number through the path. 0 0 1 3 2 5 4 9 3 6 5 14 6 17 12 35 15 19 8 18 76 914 17 0 Find the shortest path from A to G Step 1 : For first node label Box 1, 2 and 3 all 0. Step 2 : Each node has Box 1 labeled as the shortest distance to this node from the start so far. Step 3 : Go from each node labeled so far, and replace Box 1 value if a new shortest path from the start is found. Shortest route from A to G = 17
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.