Skip to main content
. 2015 Oct 19;10(10):e0140530. doi: 10.1371/journal.pone.0140530

Fig 6. Visualization of the proposed algorithm.

Fig 6

Search for alternative paths to edge (1, 6) (dotted arrow), i.e., v s = 1 and v t = 6. Solutions Lvsn(wi;vj) to subproblems are managed in a two dimensional solution array indexed by path weight w i and vertex number v j. Solutions are calculated iteratively over w i (rows) and v j (columns). (A) Solution matrix after first iterative step (subproblem Lvs1(1;v2)): There are two edges leading to vertex 2 of which only edge (1, 2) yields a valid solution by pointing to an earlier solved subproblem (green box), whereas edge (5, 2) has a weight of 7 leading to a negative difference in weights iw (5,2) (red box) for which no earlier solution exists; (B) Solution matrix after third iterative step Lvs3(1;v3): Here, no valid solution exists (none of the arrows leading to vertex 2 are part of a path with summed weight 1); (C) Solution array after iteration over all vertices v j for w i = 1 (all vertices have been checked for a path of weight 1, originating from the start vertex 1); (D) Solution to subproblem Lvsn(6;v6): edge (4, 6) together with the solution Lvs(5;v4) form a valid path, whereas edge (5, 6) is not part of a valid solution as Lvs(3;v5) is empty; (E) The algorithm terminates after iteration over all vertices v j and path weights up to w (vs, vt) + θ, where θ is a user defined threshold of 1. Backtracking is conducted for all entries in the reconstruction interval w (vs, vt) ± θ (entries marked blue); (F) Reconstructed alternative path by backtracking of subproblems.