add costs to all_pairs_shortest_paths

Changes all_pairs_shortest_paths to also return the distance between each pair of nodes. Pairwise distances are needed for implementation of the FRT algorithm in merlin.