Skip to content

Instantly share code, notes, and snippets.

"""
floyd_warshall_fastest() is a fast Python+NumPy implementation of the Floyd-Warshall algorithm
for finding the shortest path distances between all nodes of a weighted Graph. For more details see
http://en.wikipedia.org/wiki/Floyd-Warshall_algorithm
Tests and time comparisons to slower versions are provided.
Result of test_floyd_warshall_compatibility_on_large_matrix():
Matrix size: 100
Slow algorithm (with allocations): 0.726 seconds elapsed