Capstone - 03 - Shortest Path Computation


Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: shortest path to C. Thus, C turns from being a blue vertex to a red vertex. 14 And, now we repeat the same type of reasoning, asking ourselves what new paths can we evaluate going from red vertices to blue vertices by traversing exactly one edge… We update our table… 15 And, as before we identify the blue vertex that we can reach with the minimum cost (according to our current table) – namely B in our example. 16 Now we make the claim that the path we have to that vertex (B) is the shortest path from A to B ‐‐ a claim we can prove by noting that any other path to that vertex will necessarily be more costly. 17 Which leads us to turn one more node (B) from blue to red. 18 And the process continues, by identifying new paths that we evaluate by traversing exactly one of the edges from the red vertices to the blue vertices, updating the table accordingly… 19 … identifying a candidate vertex to turn red (a blue vertex with the minimum cost in the table) ‐‐ namely E. 20 The path we have to E is the shortest path, so … 21 … we color E red. 22 Now we know the drill… 23 Now we know the drill… 24 Now we know the drill… 25 And we are done! 26 As summarized above, our process consisted of an initialization and then a bunch of iterations, each of which resulted in turning one of the blue vertices into red. 27 We can be more detailed in writing the proc...
View Full Document

This note was uploaded on 02/10/2014 for the course CS 109 taught by Professor Azerbestavros during the Spring '13 term at BU.

Ask a homework question - tutors are online