switch allpairs shortestpaths algs to use graph-weighted