This preview shows page 1. Sign up to view the full content.
Unformatted text preview: n miles out of Newark. Suppose station j is the furthest from Newark less than n miles away, and that an optimal solution has him stopping at stations i 1 , i 2 , . . . , i k , where i 1 < j . Then replacing i 1 with j is still feasible, and results in the same number of stops, so is also optimal. 24.22. Let A = ( a ( u, v )) be the “adjacency matrix”, where a ( u, v ) = w ( u, v ). Prim(A,w,r) S ← { r } , T ← ∅ for each v ∈ V { r } do nearest [ v ] ← r while S 6 = V do min ← + ∞ for each v ∈ VS do if a ( v, nearest [ v ]) < min then do min ← a ( v, nearest [ v ]) next ← v S ← S ∪ { next } T ← T ∪ { ( next, nearest [ next ]) } for each v ∈ VS do if a ( v, nearest [ v ]) > a ( v, next ) then nearest [ v ] ← next 24.26. Find the minimum spanning tree; it has the least maximum edge weight. 1...
View
Full
Document
This note was uploaded on 09/29/2010 for the course CS CS 435 taught by Professor Alex during the Spring '09 term at NJIT.
 Spring '09
 ALEX
 Algorithms

Click to edit the document details