Skip to main content
. 2018 Aug 23;18(9):2771. doi: 10.3390/s18092771
Algorithm 1 Joint charging scheduling and routing allocation algorithm (CSRA).

Input: a set Vs, a set V of to-be-charged sensors, the residual energy ei of each sensor vi in Vs at some time t0, a small threshold ϵ with ϵ>0.

Output: routing fij, charging tour C.

  •   1:

    Obtain a routing fij0 by assuming that each sensor uploads its data along its minimum energy path to the base station;

  •   2:

    forK 1 to Kmax do

  •   3:

     Find a charging tour CK with the routing fijK1, by invoking Algorithm 2 for the charging scheduling subproblem;

  •   4:

     Obtain a routing fijK with the charging tour CK, by invoking Algorithm 3 for the routing allocation subproblem;

  •   5:

     Let DK1 and DK be the longest sensor dead durations of solutions (fijK1,CK1) and (fijK,CK), respectively;

  •   6:

    if DK>DK1 then

  •   7:

      CCK1,fijfijK1; /*(fijK,CK) is no better than (fijK1,CK1) */

  •   8:

      break;

  •   9:

    else

  • 10:

      CCK,fijfijK; /*(fijK,CK) is better than (fijK1,CK1)*/

  • 11:

    end if

  • 12:

    if DK1DKϵ then

  • 13:

      /* the difference of the longest sensor dead durations DK and DK1 of solutions (fijK,CK) and (fijK1,CK1) is smaller than ϵ*/

  • 14:

      break;

  • 15:

    end if

  • 16:

    end for

  • 17:

    return charging tour C, and routing fij.