liveBook · Manning

Iterative MapReduce

As explained in Advanced Algorithms and Data Structures

Iterative MapReduce is a MapReduce execution model that reuses workers and data partitions across repeated computation cycles.

Iterative MapReduce reuses workers and data partitions across repeated MapReduce cycles. In k-means, mappers are configured with fixed point shards once, while each iteration passes only the current centroids. This avoids repeatedly distributing the full dataset. section 13.3

A typical iterative cycle proceeds as follows:

  • Initialize point shards, mappers, reducers, and centroids. section 13.3
  • Have each mapper classify its assigned points against the current centroids. section 13.3
  • Have reducers collect points by cluster and compute new centers of mass. section 13.3
  • Repeat until centroids stop changing or the maximum iteration count is reached. section 13.3
Listing 13.2 MapReduce k-means
function MRkmeans(points, numShards, numClusters, maxIter, T1, T2)   #1
  shards ← randomShard(points, numShards)                            #2
  centroids ← MRcanopyCentroids(points, numClusters, T1, T2)         #3
  mappers ← initMappers(numShards, classifyPoints, shards)           #4
  reducers ← initReducers(numClusters, centerOfMass)                 #5
  for i in {0, .., maxIter-1} do                                     #6
    newCentroids ← mapReduce(centroids, mappers, reducers)           #7
    if centroids == newCentroids then                                #8
      break 
    else 
      centroids ← newCentroids                                      #9
  return combine(mappers, centroids)                                 #10

Pseudocode shows initialization, centroid passing, repeated map-reduce execution, convergence testing, and final combination. section 13.3

How Advanced Algorithms and Data Structures covers it

How deep it goes
Defines shard reuse, centroid passing, mapper classification, reducer aggregation, and convergence stopping, but not lower-level runtime internals.
Examples
Uses k-means, centroid lists, point shards, and a maximum-iteration convergence loop as concrete examples.
What it assumes
Assumes familiarity with MapReduce, clustering, centroids, and sharded data while making the repeated execution arrangement explicit.
What you can do after
Build it from scratch by initializing shards, mappers, reducers, and centroids, then iterating until convergence or a limit.
How it connects
Connects MapReduce, k-means, data sharding, mappers, reducers, centroids, and canopy clustering.

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.