Skip to main content
. 2017 Oct 10;17(10):2304. doi: 10.3390/s17102304
Algorithm 3 Approximation Algorithm for STP-MSPCL
Input: L, L0, rc
Output: A set C of Steiner points, C⊆L−L0
  • 1:

    for all li,lj∈L, i≠j do

  • 2:

     if distance(li,lj) ≤rc then

  • 3:

      if li∈L0 and lj∈L0 then

  • 4:

       w(li,lj)=0;

  • 5:

      else

  • 6:

       w(li,lj)=1;

  • 7:

    for all li,lj∈L0, i≠j do

  • 8:

     Compute the shortest path P between li and lj;

  • 9:

     w(li,lj)=length(P);

  • 10:

    Compute a minimum spanning tree MST(L0) on L0;

  • 11:

    Let C be the set of locations l∈L−L0 on the shortest path between any two locations in MST(L0);

  • 12:

    return C.