|
|
Algorithm 2.
K-medoids algorithm. |
|
| Let Δ(x, y) denote the distance between two elements x, y ∈ Σ. |
| 1. |
Choose an arbitrary partition
k = {Σk : k = 1,…, K} of Σ and an arbitrary set of medoids Λ = {m(Σk) ∈ Σk : k = 1,…, K}. |
| 2. |
For every Σk ∈
K, compute the elements that are wrongly classified, i.e., x ∈ Σk satisfying Δ(x, m(Σj)) < Δ(x, m(Σk)) for Σj ≠ Σk. For these elements, update the partition as follows: |
|
and
. The resultant partition is
. |
| 3. |
Obtain the medoids set
for the new partition
by solving the following K optimization programs: |
|
|
| 4. |
If the medoids set does not change, i.e., if Λ′ = Λ, then the clustering process is completed. Otherwise, do Λ = Λ′, and go to Step 2. |
|