Here is a quick Floyd’s algorithm implementation in Javascript. Currently the scripts only works with Firefox because I focused more on the functionalities but not compability.
If you’d like to use the code immediately in your applications, just rewrite the floyd() method to accept a 2D array containing the weighed edges, then remove those code for HTML. The algorithm should take care of the rest and give you back a nicely shortest-path graph (in 2D array representation).
Lastly, the source code is free for public uses (no copyright but again, no guarantee of any sorts from me!). Any comments/ suggestion please send to me at nworld3d@yahoo.com.
- Floyd-Warshall’s Shortest Path in Javascript (Firefox Only)