Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Floyd-Warshall visualisation suggestions?

I'm after some ideas for demonstrating the usefulness of Floyd-Warshall visually. So far all I can think of is generating a random graph, allowing the user to select a start/finish and highlight the shortest path. What are some more fun yet simple demonstrations of the usefulness of path-finding?

like image 920
Timothy Pratley Avatar asked Sep 23 '09 11:09

Timothy Pratley


People also ask

Is Floyd-Warshall better than Dijkstra?

Unlike Dijkstra's algorithm, Floyd Warshall can be implemented in a distributed system, making it suitable for data structures such as Graph of Graphs (Used in Maps). Lastly Floyd Warshall works for negative edge but no negative cycle, whereas Dijkstra's algorithm don't work for negative edges.

What are the limitations of Floyd-Warshall?

The credit of Floyd-Warshall Algorithm goes to Robert Floyd, Bernard Roy and Stephen Warshall. Limitations: The graph should not contain negative cycles. The graph can have positive and negative weight edges.

What is the method commonly followed in Floyd-Warshall's algorithm?

4. What approach is being followed in Floyd Warshall Algorithm? Explanation: Floyd Warshall Algorithm follows dynamic programming approach because the all pair shortest paths are computed in bottom up manner.


2 Answers

Since you will want to show all pairs shortest path (Floyd Warshal) rather than single pair shortes path (Dijkstra) a minimum distances table between all pairs of large cities in a country might be nice. This is not a graphical visualisation, but still a useful one. There used to be such a table in a book with roadmaps that I used, before the days of electronic route planning.

like image 135
Jacques de Hooge Avatar answered Sep 27 '22 17:09

Jacques de Hooge


Animate a sprite that moves through obstacles.

like image 24
Nick Dandoulakis Avatar answered Sep 27 '22 17:09

Nick Dandoulakis