This question assesses the student's understanding of the Floyd–Warshall algorithm, its implementation via nested loops, its computational efficiency (time and space complexity), and its limitations regarding graph properties.
Consider a network with 6 nodes. Describe the general process of the Floyd–Warshall algorithm as the iteration index increases from 1 to 6. In your response:
The graph's initial distance matrix is provided for vertices . The Floyd–Warshall algorithm is used to find the shortest paths between all pairs of vertices. The predecessor matrix is defined such that is the predecessor of vertex on the shortest path from vertex .
Given the following initial distance matrix for a weighted directed graph on vertices , compute the final distance matrix and the corresponding predecessor matrix by tracing the Floyd–Warshall algorithm.
[6]
The question asks for the application of the Floyd–Warshall algorithm to an adjacency matrix of a weighted directed graph to detect the presence of negative-weight cycles.
Apply the Floyd–Warshall algorithm to detect whether the following graph has a negative-weight cycle. The adjacency matrix is
[5]
The following matrix represents the initial distances between five vertices, , and , in a weighted directed graph.
Using the Floyd–Warshall algorithm, find the shortest‐path distance from vertex to vertex in the graph represented by the initial distance matrix . Specify the shortest path.
[4]