Johnson's algorithm solves all-pairs shortest paths in time using Bellman-Ford once and Dijkstra times. For sparse graphs (), Johnson's is faster than Floyd-Warshall's .
For dense graphs or when simplicity matters, Floyd-Warshall is preferred. It also has better constants and is easier to implement. In a contest, I reach for Floyd-Warshall first if .
Space complexity is for the data structures used.