private void balanceClusters() {
		findAllClusters();

		step = 0;
		boolean somethingMoved = false;

		for (int i = 0; i < allClusters.size();) {

			NodeCluster c = (NodeCluster) allClusters.get(i);
			int delta = c.getPull();
			if (delta < 0) {
				if (c.leftFreedom > 0) {
					c.adjustRank(Math.max(delta, -c.leftFreedom), dirtyClusters);
					refreshDirtyClusters();
					moveClusterForward(i, c);
					somethingMoved = true;
					step++;
				} else if (clusterset.build(c)) {
					step++;
					moveClusterForward(i, c);
					somethingMoved = true;
				}
			} else if (delta > 0) {
				if (c.rightFreedom > 0) {
					c.adjustRank(Math.min(delta, c.rightFreedom), dirtyClusters);
					refreshDirtyClusters();
					moveClusterForward(i, c);
					somethingMoved = true;
					step++;
				} else if (clusterset.build(c)) {
					step++;
					moveClusterForward(i, c);
					somethingMoved = true;
				}
			}
			i++;
			if (i == allClusters.size() && somethingMoved) {
				i = 0;
				somethingMoved = false;
			}
		}
	}