| Input: a set of solvents, X = {x1, ..., xn} |
| Output: a set of clusters, Y = {y1, ..., yn} |
| Begin |
| Initialize Y = {y1, ..., yn} randomly |
| Repeat select x ∈ X randomly |
| Find y* such that d(x,y*) = min{d(x,y)| y ∈ Y} |
| For all y ∈ N(y*) do |
| y = y + γ (x− y) |
| Reduce learning rate γ |
| Until termination condition is true |
| End |