Skip to main content
. 2021 Aug 27;23(9):1116. doi: 10.3390/e23091116
Algorithm 1 Dedicated Path Protection Algorithm
In: graph G, source vertex s, target vertex t
Out: a cheapest pair of paths, and their CUs
Here, we concentrate on permanent solutions nx.
  • xs=(s,s)

  • xt=(t,t)

  • lxs=((0,Ω),(0,Ω))

  • nxs=(xs,lxs,e,null)

  • Txs={nxs}

  • push(Q,(0,nxs))

  • whileQ is not empty do

  •     nx=pop(Q)

  •      if nx==null then

  •           continue the main loop

  •     x=(vx,1,vx,2)=vertex(nx)

  •      // Remove nx from the set of tentative solutions for x.

  •     Tx=Tx{nx}

  •      // Add nx to the set of permanent solutions for x.

  •     Px=Px{nx}

  •      if x==xt then

  •           break the main loop

  •     lx=(px,1,px,2)=label(nx)

  •      for each out edge e of vertex vx,1 in G do

  •          relax(e,vx,2,px,2,px,1,nx)

  •      for each out edge e of vertex vx,2 in G do

  •          relax(e,vx,1,px,1,px,2,nx)

  • returntrace(P,xt,xs)