Skip to main content
. 2018 Aug 23;18(9):2771. doi: 10.3390/s18092771
Algorithm 3 Algorithm for the routing allocation subproblem.

Input: a set Vs of sensors, a set V of to-be-charged sensors, the residual energy ei of each sensor vi in Vs at some time t0, the charging tour CK.

Output: routing fijK.

  •   1:

    Calculate the start charging time ti of each sensor vi in V by Constraint (7);

  •   2:

    Let Dl=0 and Du=T; /* Dl and Du are the lower and upper bounds on the optimal value DoptK, respectively */

  •   3:

    while Dl<Du do

  •   4:

     Let DgK=Dl+Du2; /* a guess of DoptK */

  •   5:

    if there are no feasible solutions fijK to LP P4 then

  •   6:

      /* the guess DgK is smaller than DoptK, i.e., DgK<DoptK*/

  •   7:

      Let Dl=DgK+1;

  •   8:

    else

  •   9:

      /* the guess DgK is no less than DoptK, i.e., DgKDoptK */

  • 10:

      Let Du=DgK;

  • 11:

    end if

  • 12:

    end while

  • 13:

    Let DoptK=Du(=Dl);

  • 14:

    Find a feasible solution fijK to LP P4 with DoptK;

  • 15:

    return routing fijK.