code: private static MultiMap<Integer,Integer> convertMergesToAssignments(
              List<Merge> merges, int numOriginalClusters) {
  
          MultiMap<Integer,Integer> clusterToElements = 
              new HashMultiMap<Integer,Integer>();
          for (int i = 0; i < numOriginalClusters; ++i)
              clusterToElements.put(i, i);
  
          for (Merge m : merges) {
              clusterToElements.putMany(m.remainingCluster(), 
                  clusterToElements.remove(m.mergedCluster()));
          }           
  
          return clusterToElements;
      }
docs: Converts a series of merges to cluster assignments.  Cluster assignments
  are assumed to start at 0.
  
  @param merges the merge steps, in order
  @param numOriginalClusters how many clusters are present prior to
  merging.  This is typically the number of rows in the matrix being
  clustered
  
  @returns a mapping from a cluster to all the elements contained within it.