Reworked Brandes' algorithm to better match the changes I made to Dijkstra's