Text this: Floyd–Warshall Algorithm for Sparse Graphs.