Quickest Route What is the quickest route from

  • Slides: 4
Download presentation
Quickest Route What is the quickest route from St Austell to Launceston? Launceston time

Quickest Route What is the quickest route from St Austell to Launceston? Launceston time matrix (minutes) B St Li C La 22 B St Li C 14 32 Bodmin 16 15 La 21 St Austell 10 Liskeard Callington

Dijkstra’s Algorithm Step 1 Give the permanent label 0 to the starting vertex. Step

Dijkstra’s Algorithm Step 1 Give the permanent label 0 to the starting vertex. Step 2 Give temporary labels to each vertex that is connected directly to the starting vertex. Step 3 Find the vertex with the smallest temporary label, number it and make it permanent. Step 4 Give temporary labels to each vertex that is connected directly to the previous vertex. Then find the vertex with the smallest temporary label, number it and make it permanent. Step 5 Repeat Step 4 until you have given a permanent label to the finishing vertex. Step 6 Use the permanent labels to trace back through the network to find the shortest path.

Using Dijkstra’s Algorithm Launceston to find the quickest route from St Austell to Launceston

Using Dijkstra’s Algorithm Launceston to find the quickest route from St Austell to Launceston 5 37 37 53 45 22 2 15 14 15 32 Bodmin 16 Liskeard 15 21 St Austell 1 0 0 3 21 21 31 10 Callington 4 31 31 The quickest route is: St Austell to Bodmin then Launceston

Shortest Path What is the shortest route from St Austell to Launceston? Launceston distance

Shortest Path What is the shortest route from St Austell to Launceston? Launceston distance matrix (miles) B St Li C La 22 B St Li C La 11 16 Bodmin 13 12 17 St Austell 8 Liskeard Callington