Skip to main content
. 2019 Jan 11;19(2):273. doi: 10.3390/s19020273
Algorithm 3 A fast algorithm for constructing combinations.
Input: A set of POIs P={1,,m} on the line segment with positions p1p2pm,
       where (pj,0) is the position for jP, and a real number r that is the radii of the sensors;
Output: The set of combinations Φ:={c1,,ct}.
 1: Set Φ:=, p0:=2r and pm+1=pm+2r;
 2: For POI j=1 to |P| do
 3:    For i:=j to |P| do
 4:        If pipj2r and pi+1pj12r then
 5:            Φ:=Φ{{j,,i}};
 6:       EndIf
 7:    EndFor
 8: EndFor
 9: Return Φ and terminate.