Skip to main content
. 2021 Aug 27;23(9):1116. doi: 10.3390/e23091116
Algorithm 2 relax
In: edge e, const vertex v1, const trait p1, other trait p2,
   previous search-tree node nx
Here, we concentrate on tentative solutions nx.
  • v=target(e)

  • c=cost(pathofp2witheappended)

  • for each CU C in CU(p2)AU(e) do

  •     x=(v1,v)

  •     p=(c,C)

  •      if decide(p) then

  •         lx=(p1,p)

  •          if v<v1 then

  •            swap(x)

  •            swap(lx)

  •          else if v1==v and not p1p then

  •            swap(lx)

  •           // Make sure we should be interested in lx.

  •           if nPx:label(n)lx then

  •                if nTx:label(n)lx then

  •                     // Make sure we are not reusing e.

  •                     if e not used by ancestors then

  •                         // Discard worse tentative solutions.

  •                      Tx=Tx{nTx:lxlabel(n)}

  •                      nx=(x,lx,e,nx)

  •                         // Add nx to the tentative solutions for x.

  •                      Tx=Tx{nx}

  •                      push(Q,(COST(lx),nx))