Skip to main content
. 2023 Aug 16;9:e1542. doi: 10.7717/peerj-cs.1542

Algorithm 1 . The algorithm below updates all affected nodes, and edges, whenever there is a change in any node.

 stack [startEdge]
visited[]
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