Algorithm 1 . The algorithm below updates all affected nodes, and edges, whenever there is a change in any node.
| stack |
| while stack do |
| for all neighbor_edge graph.edges(edge[1]) do |
| if neighbor_edge visited then |
| visited.append(neighbor_edge) |
| if edge parent[neighbor_edge] then |
| parent[neighbor_edge].append(edge) |
| cost weight_cost[edge] + graph[neighbor_edge][‘weight’] |
| weight_cost[neighbor_edge] + = cost |
| end if |
| end if |
| end for |
| end while |