title: When using the K-Means Clustering Algorithm, is it possible to have a set of data which results in an Infinite Loop?
body: <p><em>This Question is more Theoretical, and not specifically trying to problem-solve.</em></p>
  
  <p>I recently was introduced to the K-Means Clustering algorithm, and unsupervised machine learning algorithm, and I was intrigued by the though that one some sets of data, even if completely random, the average centroids drawn could keep changing through each iteration.</p>
  
  <p><strong>Example:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ibYKU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ibYKU.png" alt="k-means table"></a></p>
  
  <p>What I am trying to show here, is, imagine if the program flipped between iteration 6, to iteration 9, and kept doing this forever. </p>
  
  <p>I have had my code randomly hang before using K-Means, so I don't believe this is impossible, but please let me know if this is a known occurrence, or if it is impossible due to the nature of the algorithm.</p>
  
  <p><em>If you need more information just ask me in a comment. Using Python 3.7</em></p>