Discrete Mathematics with Graph Theory (3rd Edition) 349

Discrete Mathematics with Graph Theory (3rd Edition) 349 -...

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

View Full Document Right Arrow Icon
Section 12.4 347 9. (a) [BB] Here are the distances dt and the t 0 1 2 3 4 5 6 7 corresponding values of Pt. dt 0 5 7 4 5 7 6 6 Pt -1 0 0 0 0 4 4 3 (b) Here are the distances dt and the t 0 1 2 3 4 5 6 7 8 corresponding values of Pt. dt 0 1 2 3 4 4 5 5 5 Pt -1 0 0 0 1 3 0 2 1 10. We use induction on t. If t = 1, there is a path to VI if and only if VOVI is an arc. At the first iteration of the loop in Step 2, with t = 1, the algorithm checks the value of do + w(vo, VI) = w(vo, VI) and, if this is finite, assigns this number to d l and sets PI = 0, as we claimed. Now assume t > 1 and the algorithm has worked as claimed for each j < t. Consider a path from Vo to to Vt. The last arc on this is of the form VjVt with j < t (since the vertices are labeled canonically). Moreover, since Vj lies on a path from Vo, the induction hypothesis implies that the algorithm has identified the length dj of a shortest path to Vj. A shortest path to Vt has length the least value of dj + w(Vj,Vt) for all j =
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online