chap25-solutions - Selected Solutions for Chapter 25:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Selected Solutions for Chapter 25: All-Pairs Shortest Paths Solution to Exercise 25.1-3 The matrix L .0/ corresponds to the identity matrix I D N 1 0 0 ±±± 0 0 1 0 ±±± 0 0 0 1 ±±± 0 : : : : : : : : : : : : : : : 0 0 0 ±±± 1 ± of regular matrix multiplication. Substitute 0 (the identity for C ) for 1 (the iden- tity for min), and 1 (the identity for ± ) for 0 (the identity for C ). Solution to Exercise 25.1-5 The all-pairs shortest-paths algorithm in Section 25.1 computes L .n N 1/ D W n N 1 D L .0/ ± W n N 1 ; where l .n N 1/ ij D ı.i; j/ and L .0/ is the identity matrix. That is, the entry in the i th row and j th column of the matrix “product” is the shortest-path distance from vertex i to vertex j , and row i of the product is the solution to the single-source shortest-paths problem for vertex i . Notice that in a matrix “product” C D A ± B , the i th row of C is the i th row of A “multiplied” by B . Since all we want is the i th row of C , we never need more than the i th row of A .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/20/2010 for the course IE ie200 taught by Professor . during the Spring '10 term at 카이스트, 한국과학기술원.

Page1 / 2

chap25-solutions - Selected Solutions for Chapter 25:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online