Floyd-Warshall computes all-pairs shortest paths with three nested loops:
for k from 1 to n
for i from 1 to n
for j from 1 to n
dist[i][j] := min(dist[i][j], dist[i][k] + dist[k][j])
Before the loops, initialize dist[i][j] to edge weights (or infinity if no edge). Set dist[i][i] = 0.
Time: . Space: . Works with negative weights (but not negative cycles). Simple to code.