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 f∈F do

  • 4:

        V←fdst,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:

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

  • 11:

        for l∈Liout do

  • 12:

            if ldst==V(1) then

  • 13:

               Qlf←1

  • 14:

               ret←1

  • 15:

            else

  • 16:

               if ldst∉V && |P|<h then       ▹h is the maximum number of hops.

  • 17:

                   V←V+ldst

  • 18:

                   P←P+l

  • 19:

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

  • 20:

                   Qlf←rettmp

  • 21:

                   ret←rettmp||ret

  • 22:

                   V←V−ldst

  • 23:

                   P←P−l

  • 24:

               end if

  • 25:

            end if

  • 26:

        end for

  • 27:

        return ret, Qlf

  • 28:

    end function