Skip to main content
. 2021 Apr 13;21(8):2744. doi: 10.3390/s21082744
Algorithm 1Qlf Computation.
  • 1:

    Qlf

  • 2:

    G(N,L)

  • 3:

    for fF do

  • 4:

        Vfdst,fsrc               ▹V keeps track of the visited nodes.

  • 5:

        P                     ▹P is the path traced so far.

  • 6:

        DFS(f,G,V,P,Qlf)

  • 7:

    end for

  • 8:

    return Qlf

  •  

  • 9:

    function DFS(f,G,V,P,Qlf)

  • 10:

        iV(end)  ▹V(end) is the last visited node, while V(1) is the destination of f.

  • 11:

        for lLiout do

  • 12:

            if ldst==V(1) then

  • 13:

               Qlf1

  • 14:

               ret1

  • 15:

            else

  • 16:

               if ldstV && |P|<h then       ▹h is the maximum number of hops.

  • 17:

                   VV+ldst

  • 18:

                   PP+l

  • 19:

                   (rettmp,Qlf)DFS(f,G,V,P,Qlf)

  • 20:

                   Qlfrettmp

  • 21:

                   retrettmp||ret

  • 22:

                   VVldst

  • 23:

                   PPl

  • 24:

               end if

  • 25:

            end if

  • 26:

        end for

  • 27:

        return ret, Qlf

  • 28:

    end function