pgr_johnson

pgr_johnson - Returns the sum of the costs of the shortest path for each
pair of nodes in the graph using Floyd-Warshall algorithm.

Boost Graph Inside

The Johnson algorithm, is a good choice to calculate the sum of the costs
of the shortest path for each pair of nodes in the graph, for sparse graphs.
It usees the Boost’s implementation which runs in \(O(V E \log V)\) time,