Update Dijkstra's algorithm
Update bfs