Where Does a Cluster End?
A cluster's edge is the set of points whose nearest centroid switches, and the centroid itself is the mean of its assigned points.
A complete interactive classroom, not just a preview.
Start when you are ready to enter this Stage's 7 scenes and explore, respond, and learn as you go.
How does k-means decide where one cluster ends and another begins?
A scatter plot of unlabeled dots suddenly snaps into three clean groups — but how did the algorithm know where one group stopped and the next began?
Our intuition says 'closest point wins,' but a cluster's edge isn't drawn by a single closest neighbor — it is drawn by a center that keeps moving.
Step-by-step animation of points reassigning to the nearest centroid and centroids migrating to their new mean, plus a side-by-side of two clusterings that look plausible but disagree on boundaries.
A cluster's boundary is exactly the perpendicular bisector region between competing centroids — and it changes shape every iteration until nothing moves.
Each cluster is whatever group of points happens to be packed tightest together, and k-means probably finds those dense regions automatically.
- Choosing the value of k
- k-means++ initialization tricks
- Comparison with hierarchical or DBSCAN clustering
- Soft / fuzzy assignments and the EM algorithm
- 01Where Does a Cluster End?slideQuestion
Pose the driving question with a scatter plot that has already been colored into three clusters. The coloring looks obvious, but the boundary lines are missing — the learner is invited to ask where those lines should go.
- Show a 2D scatter plot pre-colored into three clusters
- Hide the cluster boundaries and ask the learner to predict them
- State the driving question explicitly
- 02Commit to Your First GuessquizPrediction
Before any animation or rule is shown, the learner commits to one rule they think k-means uses to draw a cluster edge.
- One independent choice
- Forces a commitment before the rule is revealed
- 03Watch the Boundaries RedrawinteractiveEvidence
An interactive simulation of k-means on a small 2D point set. The learner steps through iterations and watches points reassign to the nearest centroid and centroids migrate to their new mean, with Voronoi-style boundary lines drawn between clusters.
- Click 'Next iteration' to advance k-means step by step
- Observe points changing cluster color when a centroid moves closer
- See Voronoi-style boundary lines snap into place after each step
- Stop when nothing changes
- 04The Rule Behind the BoundaryslideExplanation
Explain the two-step loop of k-means: assign each point to the nearest centroid, then move each centroid to the mean of its assigned points. Show that the boundary between two clusters is the perpendicular bisector of the line between their two centroids.
- Step 1: assign by shortest straight-line distance to a centroid
- Step 2: centroid becomes the mean of its assigned points
- Boundary = set of points equidistant from two centroids
- Two centroids → a straight perpendicular bisector; three+ → a Voronoi diagram
- Loop ends when assignments no longer change
- 05When the Rule FailsslideBoundary
Show a case where nearest-centroid reasoning still produces a clean-looking but wrong clustering — two ring-shaped groups force a straight-line boundary that cuts straight through one ring.
- K-means always produces straight-line (Voronoi) boundaries
- Non-spherical shapes can be sliced incorrectly
- Boundary choice is correct for the rule, wrong for the data shape
- 06Move a Centroid, Move the BoundaryinteractiveTransfer
A transfer test: the learner drags one centroid on a fixed point cloud and watches the Voronoi boundary lines and point assignments update instantly. They must predict whether moving a centroid can ever change a faraway point's assignment.
- Drag any centroid to a new location
- Watch the boundary lines and point colors update live
- Predict which points will switch cluster when you release
- 07Answering the Driving QuestionslideResolution
Directly answer: a cluster ends exactly where another cluster's centroid becomes closer. The boundary is the perpendicular bisector (or, with three or more clusters, a Voronoi edge), and it keeps redrawing until assignments stabilize.
- Cluster edge = switching point between two nearest centroids
- Two centroids → perpendicular bisector
- Three or more → Voronoi cells
- Final boundary = the converged Voronoi diagram
Discussion threads for a Stage aren't available yet.