- IB
- Question Type 4: Finding the shortest path in weighted graphs using Dijkstra's Algorithm
Apply the Floyd–Warshall algorithm to detect whether there is a negative-weight cycle in the graph represented by the matrix
and state your conclusion.
[4]Consider the directed graph with vertices and weighted edges , , , , . Use Dijkstra’s algorithm to determine the shortest path from to .
[5]Given a weighted directed graph with vertices 1–5 and weight matrix :
Use the Floyd–Warshall algorithm to determine the shortest distances between all pairs of vertices. Show the updates for each iteration .
[5]Consider the weighted directed graph with vertices and edges: with weight , with weight , with weight , and with weight .
Use the Floyd–Warshall algorithm to determine whether this graph contains a negative cycle and compute the shortest-path distances if possible.
[5]Floyd-Warshall algorithm for finding shortest paths in a weighted graph.
Apply the Floyd–Warshall algorithm to the following weight matrix for vertices :
State the final distance matrix.
[3]Apply Dijkstra's algorithm to find shortest paths in a weighted graph.
Apply Dijkstra’s algorithm to a weighted undirected graph with vertices and the following edges:
Determine the order in which vertices are selected and the final shortest distances from vertex 1 to all other vertices.
[6]Given the adjacency matrix of a directed graph with vertices , using for no direct edge:
Apply the Floyd–Warshall algorithm to compute the final distance matrix.
[6]Using Dijkstra’s algorithm, find the shortest path from node to node in the weighted graph with the following edges:
State the shortest distance and the actual path.
[5]Use Dijkstra’s algorithm, starting at node , to find the shortest path to node in the graph shown below.

The edges and their respective weights are: , , , , , , , .
Determine the shortest path and its total weight.
[5]Use the Floyd–Warshall algorithm on the directed graph with weight matrix
to find the length of the shortest path from vertex 1 to vertex 5. Show all iterations that change the shortest path estimate from vertex 1 to vertex 5.
[4]A weighted graph has vertices . The weight matrix for the graph is given by:
Use the Floyd–Warshall algorithm to find the shortest distance between vertex and vertex . Show your working for each iteration of the intermediate vertices.
[6]The following weighted undirected graph has vertices and edge weights: .

Apply Dijkstra’s algorithm to the graph to find the shortest path distances from vertex to all other vertices. Show your working clearly.
[6]