code: func (s *state) ResetDistances(into, from int) {
  	// since the center of into changed, need to update the distance to anything linked to this one.
  	for k := range s.Distances[into].Distances {
  		if k == into {
  			continue
  		}
  
  		dist := s.DistanceFunc(into, k)
  
  		s.Distances[into].Set(k, dist)
  		s.Distances[k].Set(into, dist)
  	}
  
  	// we are merging from into into.
  	// so any links with from need to be links with into.
  	// any links into from need to be deleted
  	// we no longer need the distance info of from
  	for k := range s.Distances[from].Distances {
  		if k == from || k == into {
  			continue
  		}
  
  		dist := s.DistanceFunc(into, k)
  
  		s.Distances[into].Set(k, dist)
  		s.Distances[k].Set(into, dist)
  
  		s.Distances[k].Delete(from)
  	}
  
  	s.Distances[from] = nil
  	s.Distances[into].Delete(from)
  }
docs: // ResetDistances makes sure the distance map is up to date given the recent merge of clusters.