Skip to main content
. 2019 Jan 11;19(2):273. doi: 10.3390/s19020273
Algorithm 1 A greedy algorithm for decision LBTC
Input: A bound DZ+ on maximum movement, a set of sensors Γ={1,,n} with original
      positions {(xi,yi)|i[n]+} and r being the sensing radii, a set of POIs P={1,,m} with
      positions p1p2pm, where pj is the position for jP;
Output: New positions {xi|i[n]+} for the sensors or return “infeasible”.
 1: Set I:=Γ and s:=p1, where s is the leftmost point of the uncovered part of the barrier.
 2: For each sensor i do
 3:    Compute the leftmost position li and the rightmost position gi that sensor i can monitor;
 4: EndFor
 5: While I do
 6:    If there exists iI, such that lisgi then
 7:       Select the sensor with minimum gi among all the sensors {i|lisgi}, which is to find
            sensor iI that gi=mini:lisgi{gi};
 8:       Set t:=min{s+2r,gi} and xi:=tr;
 9:       Set s:=min{pj|pj>t} and I:=I{i};
10:    Else
11:       Return “infeasible”;
12:    End if
13:    If tpm then /*All POIs have been covered. */
14:       Return “feasible” together with the new positions {xi|iΓ};
15:    Endif
16: Endwhile