Description of the Prop-Fwd-Prop-Bkwd Incremental Algorithm INPUTS: S, an STN with a fully computed distance matrix D. (X,delta,Y) a new edge to be inserted into S. OUTPUT: D*, the distance matrix for the network S*, where S* contains all time-points and edges in S, together with (X,delta,Y). Or FALSE if S* is inconsistent. If delta < -D(Y,X) return FALSE otherwise... First, PropFwd along SHORTEST paths emanating from Y. Encountered := {Y} // Nodes encountered on shortest paths from Y Changed := {Y} // Nodes whose distance from X has changed ToDo: {Y} // Nodes awaiting processing // order of elts in ToDo and Changed doesn't matter while (ToDo non-empty) Let V := pop first element from ToDo For each successor (V,d,W) of V: if W not in Encountered and D(Y,W) == D(Y,V) + d (i.e., (V,d,W) is part of a shortest path from Y to W) then add W to Encountered if delta + D(Y,W) < D(X,W) (i.e., the new edge (X,delta,Y) is part of a *shorter* path from X to W) then set D(X,W) := delta + D(Y,W) add W to Changed add W to ToDo Next, for each node W in Changed, propagate back from X. Encountered = {X} ToDo = {X} while (ToDo not empty) Let F = pop first element off ToDo For each predecessor edge (E,a,F) of F: if E not in Encountered and D(E,X) == a + D(F,X) (i.e., (E,a,F) is part of a shortest path from E to X) then add E to Encountered if D(E,X) + D(X,W) < D(E,W) (i.e., the new edge (X,delta,Y) is part of a *shorter* path from E to W) then set D(E,W) := D(E,X) + D(X,W) add W to ToDo Return D (modified distance matrix)