@andrestaltz in anycase, because follows interacts with blocks, it's not as simple as just adding together the weights along the shortest path, anyway, so checking for -1 as a special meaning isn't too big a deal.
@Erik that is true, but it doesn't matter because the graph is not very big. If you are replacating the 2nd hop out, it's only gonna be a few thousand nodes, if you replicate 1 hop, then a few hundred. Also, when edges are added (or paths getting shorter), it's possible to update the hops table without retraversing the entire graph. The graph only needs to be fully recalculated when edges are removed (or paths getting longer).