Capstone - 03 - Shortest Path Computation

# Byshowingthatanypathotherthantheonewediscoveredwillbeo

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

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: rtices). So, now, we ask the question, if we traverse exactly one of these edges where would we end up and at what cost? In our example, we can get to B with cost 5 and to C with cost 3. This gives us two candidate paths that we can now record in our table. 11 Among all remaining blue vertices, C is a destination we can reach with a minimum cost (according to the costs in our table). 12 Well, could it be that the path we have for C is the shortest path? Can we prove that it is? The answer is yes! So, let’s try to prove the conjecture (claim) that there is no path to C shorter than the one we already found. We will prove our conjecture by contradiction. Assume that there is path shorter than what we already discovered that goes from A to C. What would such a path look like? It would be either 1. A B … C, or 2. A C … C But both of the above paths must have a cost higher than the one we have (which is A C). Why? Because going through B will cost more (at least 5 as opposed to our current cost of 3) and going through C twice is bound to be more costly as well since the cost of the cycle (from C back to itself) must have a positive cost since edge costs are positive (we established this last lecture). By showing that any path other than the one we discovered will be of higher cost, we proved our conjecture! 13 So, now we know that we have a PROVEN...
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