What is the best algorithm for finding the all pairs shortest path lengths for undirected weighted sparse graph? Specifically, the weights are the distances between the nodes (and therefore positive). Note that I only need the path lengths (i.e. not the path itself). My graph is sparse, so it is stored as an adjacency list.
I found Dijkstra, Floyd-Warshall, Johnson, etc. but none of them seem to be optimal for my purpose. In the case of Dijkstra you run the single source version over all vertices, Floyd-Warshall is meant for dense graphs, and Johnson is for directed.
I am specifically looking for an implementation in C++.