How to perform K-medoids when having the distance matrix I've been trying for a long time to figure out how to perform (on paper)the K-medoids algorithm, however I'm not able to understand how to begin and iterate. for example:

I have the distance matrix between 6 points, the k,C1 and C2.
I'll be very happy if someone can show me please how to perform the K-medoids algorithm on this example? how to start and iterate? 
Thanks
 A: From the wikipedia page on k-medoids:

The most common realisation of k-medoid clustering is the Partitioning
  Around Medoids (PAM) algorithm and is as follows:
  
  
*
  
*Initialize: randomly select k of the n data points as the medoids
  
*Associate each data point to the closest medoid. ("closest" here is defined using any valid distance metric, most commonly Euclidean
  distance, Manhattan distance or Minkowski distance)
  
*For each medoid $m$:
  
*
  
*For each non-medoid data point $o$:
  
*
  
*Swap $m$ and $o$ and compute the total cost of the configuration
  
  
  
*Select the configuration with the lowest cost.
  
*Repeat steps 2 to 4 until there is no change in the medoid.
  

There are also worked-out examples there.
A: Steps:
1) Assume one point from each cluster as a representative object of that cluster.
2) Find distance(Manhattan or Euclidean) of each object from these 2. You have been given these distances so skip this step.
3) select the points with minimum distance for each cluster wrt to selected objects, i.e. create 2 new clusters with objects having least distance to the above 2 points.
4) take the average of the minimum distances for each point wrt to its cluster representative object.
5) Select 2 new objects as representative objects and repeat steps 2-4.
6) calculate swapping cost. subtract old avg from new avg. New-old.
7) If swapping cost is negative then then new mediods are the new objects and go to step 5.
8) if cost is more than 0, discard points and select new points in step 5 keeping original points.
9) repeat until convergence. 
