40 likes | 53 Views
time matrix (minutes). B St Li C La. Launceston. B St Li C La. 22. 14. 32. Bodmin. Callington. 16. 10. Liskeard. 15. 21. St Austell. Quickest Route. What is the quickest route from St Austell to Launceston?. Dijkstra’s Algorithm.
E N D
time matrix (minutes) B St Li C La Launceston BStLi CLa 22 14 32 Bodmin Callington 16 10 Liskeard 15 21 St Austell Quickest Route What is the quickest route from St Austell to Launceston?
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.
Launceston Bodmin Callington Liskeard St Austell Using Dijkstra’s Algorithm to find the quickest route from St Austell to Launceston 5 37 37 53 45 22 14 2 15 32 15 16 10 4 31 15 31 3 21 21 31 21 The quickest route is:St Austell to Bodmin then Launceston 1 0 0
distance matrix (miles) B St Li C La Launceston BStLi CLa 22 11 Bodmin 16 Callington Liskeard 13 8 12 17 St Austell Shortest Path What is the shortest route from St Austell to Launceston?