liveBook · Manning

Convergence

As explained in Advanced Algorithms and Data Structures

Convergence is the condition in an iterative computation where successive updates no longer change the solution or assignment.

Convergence occurs when repeated updates stop changing an assignment or solution. In an iterative algorithm, it supplies a practical stopping condition: halt when the latest classification matches the previous one, or when a maximum iteration limit is reached. section 12.2

Use convergence as an operational check rather than as proof of a globally optimal answer:

  • Compare successive assignments or solution states; k-means stops when no point switches clusters. section 12.2
  • Bound the work with a maximum iteration count, since a poor initialization can slow convergence and force an early stop. section 12.2
  • Treat convergence as convergence to a local or near-optimal result, not a guarantee of the best possible solution. section 12.2 section 18.2
  • Control update size when approximating a smallest enclosing sphere; shortening each move after an iteration ensures convergence. section 10.5.2

K-means assignment and recentering

Initialize centroids, assign every point to its nearest centroid, recompute each centroid as its cluster’s center of mass, and repeat. If the new cluster indices equal the previous indices, return the centroids and assignments; otherwise continue until the iteration limit. section 12.2

Figure 12.3 An example of the k-means algorithm with k==3. Dataset points are initially lightly shaded. Step 1: k centroids (shaped as pentagons) are randomly created. Each centroid is assigned a different color: RGB. Step 2: For each point, measure the distance to all centroids, and assign the point to the closest one. At the end, each centroid C will define a cluster, a sphere centered at C and whose radius is the distance to the furthest point assigned to C. The clusters are highlighted in the same color as their centroids. Step 3: Update the centroids: for each cluster, compute its center of mass. Step 4: Repeat steps 2 and 3 j times. Some points will switch to a different cluster.

Trace convergence visually as points move between clusters while centroids are repeatedly reassigned to cluster centers. section 12.2

How Advanced Algorithms and Data Structures covers it

How deep it goes
Explains assignment-based stopping, iteration limits, initialization effects, and shrinking update steps, but defers the sphere algorithm’s details.
Examples
Uses changing k-means cluster assignments, genetic optimization of a ten-city tour, and iterative smallest-enclosing-sphere approximation.
What it assumes
Assumes iterative updates, assignments, distances, centroids, and objective quality; frames convergence through concrete algorithmic procedures.
What you can do after
Diagnose/debug iterative algorithms by selecting state-change checks, iteration bounds, initialization strategies, and controlled update sizes.
How it connects
Connects convergence with k-means, clustering, genetic algorithms, simulated annealing, and approximate nearest neighbor search.

Also explained in

Compare how 4 books explain convergence →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Advanced Algorithms and Data Structures. The section links point to the parts of the book it draws on.