Discrete Mathematics with Graph Theory (3rd Edition) 286

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

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

284 Solutions to Exercises (d) 15. (a) [BB] Assign each edge a weight of 1. (b) The shortest path requires 6 edges. Most labels are shown. CI---"'eIo:::--~5 4~--=&~--~4 2~~----~~ 1 ~--Jl"'-----'iijY' 3 A~--&----~2 16. [BB] As explained in the text, the complexity function for determining the shortest distance from a given vertex to each of the others is O(n 2 ); that is, for sufficiently large n and some constant c, the algorithm requires at most cn 2 comparisons. Applying the algorithm to each of the n vertices (after which all shortest distances are known) requires at most n(cn 2 ) = cn 3 comparisons. This process is O(n 3 ). 17. (a) [BB] The final values are the shortest distances from A to itself and to the other vertices. From Fig. 10.23, we deduce these to be 0, 7, 15, 20, 21, 15, 8, 5, 10 and 17. (b) [BB] After k = 4, the value of d(l, 5) is the length of a shortest path from A to E via the vertices A, B, C,
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: D. The only such path is ABCDE of length 27: d(l, 5) = 27. The value of d(l, 6) is the length of a shortest path from A to F via A, B, C, D. There is no such path, so d(l, 6) is still 00. The value of d(3, 4) is 8. The value of d(8, 5) is the length of a shortest path from H to E via A, B, C, D. The shortest such path is HBCDE: d(8, 5) = 24. (c) [BB] The initial value of d(2, 5) is 00 since BE is not an edge. After k = 1,2, ... , 10, the values of d(2, 5) are 00, 00, 00, 20, 20, 20, 20, 20, 18, 17. 18. (a) These are the shortest distances from V7 to each of VI, ... ,Vs; namely, 4, 3, 1,2, 3, 3, 0, 4 (b) d(1,2) = 1; d(3, 4) = 1; d(2, 5) = 4; d(8, 6) = 10. (c) 00,00,00,12,10,5,5,5,5 19. It certainly does! In the graph at the right, with i = 1 and j = 2, the algorithm finds that the smallest value of d(l, k) + d(k, 2) is 4 (because at this stage, d(1,3) = d(4, 2) = 00) and this value never changes....
View Full Document

## This note was uploaded on 11/08/2010 for the course MATH discrete m taught by Professor Any during the Summer '10 term at FSU.

Ask a homework question - tutors are online