Refactoring Brandes to get more of its Dijkstra algorithm into Dijkstra