1 / 3

Decision Maths 1

Decision Maths 1. Shortest path algorithm Dijkstra’s Algorithm. A V Ali : www.2july-maths.co.uk. Dijkstra’s algorithm used to find the shortest path through a network. Set up 1 : Decide on a Start Node and End Node.

shadow
Télécharger la présentation

Decision Maths 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali : www.2july-maths.co.uk

  2. Dijkstra’s algorithm used to find the shortest path through a network. • 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 3 Box 2 Box 1

  3. Find the shortest path from A to G 2 1 5 3 3 5 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. 3 6 6 8 7 6 17 0 0 19 17 18 0 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. 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 4 5 9 14 12 9 15 14

More Related