Turning this into Dijkstra's based on assignment change