Skip to main content
. 2018 Nov 25;18(12):4129. doi: 10.3390/s18124129
Algorithm 4. Pseudo-code of the Build Phase for Parallel PAM
1. repeat
2.  for p := 1 → P do in parallel
3.   for each data point Xa ϵ p do       /* All PEs do in parallel*/
4.    Select Xa as temporary Medoid
5.    for i := 1 → N do
6.     for each Medoid selected yet (including Xa)do
7.      Find the minimum Euclidean distance b/w Xi and Medoid
8.     endfor
9.     Find sum of minimum distances
10.    endfor
11.    Find minimum sum
12.   endfor
13.  endfor
14.  for p := 1 → P do        /* Only master PE will do this */
15.   Select Xa as actual Medoid for which the sum is minimum from all PEs
16.  endfor
17. until ‘K’ initial Medoids are selected