Skip to main content
. 2019 Jan 11;19(2):273. doi: 10.3390/s19020273
Algorithm 4 A fast algorithm for LBTC.
Input: A set of sensors Γ={1,,n} with original positions {(xi,yi)|i[n]+} and an identical
       sensing radii r, a set of POIs P={1,,m} with positions p1p2pm on the line
       segment, where pj is the position for jP;
Output: A minimum movement D under which the sensors can be relocated to covered all POIs in P.
 1: Set Ψ:= and compute Φ:={c1,,ct} the collection of combinations by Algorithm 3;
 2: For each sensor i do
 3:    For each combination cjΦ do
 4:       Compute dij, the minimum movement needed when using sensor i to cover cj;
 5:       Set Ψ:=Ψ{dij};
 6:    EndFor
 7: EndFor
 8: Sort Ψ in a non-decreasing order and set lb:=1 and ub:=|Ψ|, to prepare for binary search.
 9: Use Ψ[1] as the movement bound (i.e., D) and call Algorithm 1;
      /*Note that Ψ[1] is the smallest element in Ψ. */
10: If there exists a feasible coverage under movement bound Ψ[1] then
11:    Return Ψ[1] as the optimum movement bound;
12: End if
13: While ublb>1 do
14:    Set idx:=lb+ub2;
15:    Use Ψ[idx] as the movement bound (i.e., D) and call Algorithm 1;
       /*Ψ[idx] is the idxth smallest element in Ψ. */
16:    If there exists a feasible coverage under movement bound Ψ[idx] then
17:       Set ub:=idx;
18:    Else
19:       Set lb:=idx;
20:    End if
21: Endwhile
22: Return Ψ[idx] as the optimum movement bound.