- IB
- Question Type 5: Using Floyd-Warshall for all pairs shortest path
Apply the Floyd–Warshall algorithm to the following adjacency matrix of a directed graph with vertices 1, 2, 3:
Compute the all-pairs shortest-path distance matrix .
[6]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:
Apply the Floyd–Warshall algorithm to find the shortest-path distance matrix for the following matrix, and then reconstruct the shortest path from vertex 1 to vertex 5:
[6]Given the weighted directed graph with vertices A, B, C, D and adjacency matrix
use the Floyd–Warshall algorithm to find the matrix of shortest distances.
[5]The Floyd–Warshall algorithm for finding shortest paths in a weighted graph.
A graph has adjacency matrix
After running the Floyd–Warshall algorithm, what is the shortest distance from node 3 to node 2? Show the key update steps.
[5]A graph on vertices has negative edge weights but no negative cycles. Its initial distance matrix is given by
Use the Floyd–Warshall algorithm to compute the final matrix of all-pairs shortest path distances. Show the intermediate matrices and to demonstrate your process.
[6]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]
Construct the transitive closure matrix of the graph represented by the following weight matrix:
Compare this transitive closure to the reachability matrix derived from the Floyd–Warshall algorithm.
[5]A graph has 4 vertices and its edge weights are given by the following initial distance matrix , where denotes no direct edge between vertices:
Perform the Floyd–Warshall algorithm and state the final distance matrix .
[4]