# Persistent cluster IDs over similar inputs with k-means

I have multiple kmeans plots that I have generated in R. Specifically I have $5$ weeks and I generate $1$ kmeans plot per week. I am clustering on vectors. Most vectors in the $5$ kmeans plots will occur in each plot. What I am interested in determining is which vectors have changed cluster membership. To make this clear suppose I have a vector identified by the word "soccer" then I would like to see which cluster it belongs to in week1, week2, and so forth.

Testing for membership change should be a simple task, for each kmeans clustering, each point is given an ID as to which cluster it belongs. I have 4 clusters so each week our example vector with name "soccer" could be tagged $1$, $2$, $3$, or $4$. The naive solution would be to just check the tag for a particular vector each week. However, this is not the case because R randomly selects the tags for each cluster. I know this is the case because each cluster represents some class of curves. You can visibly see that the kmeans algorithm has partitioned the vectors into 4 classes of curves.

Are there ways to make the tag IDs for each cluster stay constant? That is if the cluster tagged in week1 with ID $2$ is the linear curve, then the clusters tagged $2$ in all remaining weeks will always be the linear cluster.

Are there any initial conditions I can pass to kmeans to make this happen? I posted this question here instead of stackoverflow because I believe this questions requires more understanding of the kmeans algorithm.

• Or could you at least dput the list of kmeans objects? Maybe with a reduced number of observations, in order to not let the output become too large. May 4 '13 at 11:11