for(int i = 0; i < dimensions.size(); i++) {
Pair<V, Set<Integer>> pair_i = dimensions.get(i);
V c_i = pair_i.first;
Set<Integer> dimensions_i = pair_i.second;
DoubleDistance currentDist = manhattanSegmentalDistance(p, c_i, dimensions_i);
if(minDist == null || currentDist.compareTo(minDist.first) < 0) {
minDist = new Pair<DoubleDistance, Integer>(currentDist, i);
}
}
// add p to cluster with mindist
assert minDist != null;