GATEverse
← GATE CSE 2003

Q70

MCQ2 marks, −0.5

Let G=(V,E)G= (V,E) be a directed graph with nn vertices. A path from viv_i to vjv_j in GG is a sequence of vertices (vi,vi+1,…,vjv_{i},v_{i+1}, \dots , v_j) such that (vk,vk+1)∈E(v_k, v_{k+1}) \in E for all kk in ii through j−1j-1. A simple path is a path in which no vertex appears more than once. Let AA be an n×nn \times n array initialized as follows:

A[j,k]={1, if (j,k)∈E0, otherwiseA[j,k] = \begin{cases} 1 \text {, if } (j,k) \in E \\ 0 \text{, otherwise} \end{cases}

Consider the following algorithm: for i=1 to n for j=1 to n for k=1 to n A[j,k] = max(A[j,k], A[j,i] + A[i,k]); Which of the following statements is necessarily true for all jj and kk after termination of the above algorithm?

Sign in to save attempts.

Loading…