GATEverse
← GATE CSE 2002

Q12

MCQMarks unknown

Fill in the blanks in the following template of an algorithm to compute all pairs shortest path lengths in a directed graph GG with n∗nn*n adjacency matrix AA. A[i,j]A[i,j] equals 11 if there is an edge in GG from ii to jj, and 00 otherwise. Your aim in filling in the blanks is to ensure that the algorithm is correct. INITIALIZATION: For i = 1 ... n {For j = 1 ... n { if a[i,j] = 0 then P[i,j] =_______ else P[i,j] =_______;} } ALGORITHM: For i = 1 ... n {For j = 1 ... n {For k = 1 ... n {P[__,__] = min{_______,______}; } } }

Sign in to save attempts.

Loading…