3

The question I am trying to answer is: (k-medoids clustering) What are the resulting clusters when the k-medoids algorithm is used with $k = 2$ and initial random medoids $\{(1, 2), (2, 1)\}$ on the above dataset $S$?

The dataset $S$: \begin{array} {|c|c|}\hline 1 & 2 \\ \hline 2 & 1 \\ \hline 1 & 3 \\ \hline 5 & 4 \\ \hline 6 & 3 \\ \hline 7 & 2 \\ \hline 6 & 1 \\ \hline \end{array}

Where each row is $x_1,x_2,x_3,x_4,x_5,x_6,x_7$ respectively. I believe I am doing the steps correctly but I do not think my answer is correct:

First I calculate the distance from each medoid point to each non-medoid point:

$distance(1,2)=0,1.41,1,4.47,5.10,6,5.10$

$distance(2,1)=1.41,0,2.24,4.24,4.47,5.10,4$

Therefore the resulting cluster is: $\{(x_1,x_3),(x_2,x_4,x_5,x_6,x_7)\}$

Now is where I could be going wrong. I believe I am supposed to pick a new medoid with the smallest distance. Therefore I choose $x_3 = (1,3)$. Then I calculate the distances again:

$distance(1,3)=1,2.23,0,4.12,5,6.10,5.40 $

$distance(2,1)=1.41,0,2.24,4.24,4.47,5.10,4$

However I believe I am doing something wrong because I get new clusters: $\{(x_1,x_3,x_4),(x_2,x_5,x_6,x_7)\}$. If I were to repeat the steps, I would change the point back to $x_1$ which was the medoid point originally, causing a loop. I have to be doing something wrong, any help is appreciated. I am also fairly certain the final answer should be clusters: $\{(x_1,x_3),(x_2,x_4,x_5,x_6,x_7)\}$ which was the original cluster I got.

ClareB
  • 31
  • 2
    Would you be willing to edit your question with Mathjax? A guide to Mathjax can be found here: https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference – JJMae May 09 '23 at 22:35
  • 1
    @MissMae I updated it to the best of my ability, thank you for your link – ClareB May 09 '23 at 22:54

0 Answers0