Dijkstra and Bellman Ford with new SSSPState abstraction