| Algorithm 1. Pseudo-code of PAM |
| Procedure: Partitioning Around Medoids (PAM) |
| Input:K (No. of clusters), X (Data Set) |
| Output:C (Vector containing cluster tags against each data object), M (Medoids) |
| 1. Initialize M /* Build Phase */ |
| 2. repeat /* Swap Phase */ |
| 3. Find clusters |
| 4. Perform swapping and update Medoids |
| 5. until no update in any of K Medoids |