Skip to main content
. 2022 Aug 31;22(17):6584. doi: 10.3390/s22176584
Algorithm 1 Distributed Tree Based WET Schedule Algorithm
  • Require:
    • List of Neighbour Nodes
    • Current node
    • Distance
  • Ensure:
    • Broadcasting of all Nodes
    • StatusNode<Notvisited
    • Nodedist<0
    • CurrentNode<B1
    • Begin
      • 1:
        Neighbour-Node List of Current-Node(N1,N1dist,N1ener), (N2,N2dist,N2ener), ⋯, (Nn,Nndist, ⋯, Nnener)
      • 2:
        Current-node-distance = 1
      • 3:
        if List-count-Neighbour-Node ≥ 1 then
      • 4:
            NLMinimalDistanceNode(NeighbourNodeListB1)
      • 5:
            NL-Status = Visited
      • 6:
            NL-Distance = Distance-1
      • 7:
            NL-Root = Left
      • 8:
        end if
      • 9:
        if List-count-Neighbour-Node ≥ 2 then
      • 10:
            NRSecondMinimalDistanceNode(NeighbourNodeListB1)
      • 11:
            NR-Status = Visited
      • 12:
            NR-Distance = Distance-1
      • 13:
            NR-Root = Right
      • 14:
        end if
      • 15:
        while Distance is greater than zero do
      • 16:
            CurrentNode<MinimalDistance(MD)
      • 17:
            Update Neighbour-Node-List of Currnet-Node
      • 18:
            Current-Node-Distance = 1
      • 19:
            temp = MD
      • 20:
            while temp ≠ 0 do
      • 21:
                if First-Node in Neighbour-Node-List = Visited then
      • 22:
                   Pop First Neighbour from the List
      • 23:
                   MD = MD -1
      • 24:
                else
      • 25:
                   MD = MD-1
      • 26:
                end if
      • 27:
            end while
      • 28:
        end while