Question

6. [20 pts.] Below is the final P matrix after applying Floyds all pairs shortest path algorith on a graph with nodes (A, B,
0 0
Add a comment Improve this question Transcribed image text
Answer #1

he Floyd-Warshall algorithm is a shortest path algorithm for graphs. Like the Bellman-Ford algorithm or the Dijkstra's algorithm, it computes the shortest path in a graph. However, Bellman-Ford and Dijkstra are both single-source, shortest-path algorithms. This means they only compute the shortest path from a single source. Floyd-Warshall, on the other hand, computes the shortest distances between every pair of vertices in the input graph.

a)

Here the shortest distance matrix P has already been calculated,

A B C D E F G H
A 0 0 5 0 2 0 5 5
B 0 0 5 5 0 1 5 5
C 5 5 0 5 0 5 5 0
D 0 5 5 0 0 7 0 7
E 2 0 0 0 0 2 0 3
F 0 1 5 7 2 0 0 7
G 5 5 5 0 0 0 0 0
H 5 5 0 7 3 7 0 0

We can see from the given matrix that the shortest distance between the nodes D and F is 7 (underlined in the matrix)

Add a comment
Know the answer?
Add Answer to:
6. [20 pts.] Below is the final P matrix after applying Floyd's all pairs shortest path algorith on a graph with nodes (A, B, C, D, E, F, G, H). In the matrix below 1 corresponds o 0 5 0 2 0...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT