private void verticalAlignment(Digraph<BrandesKoepfNode,Boolean> graph, List<List<BrandesKoepfNode>> layers, int mode) {
		for (BrandesKoepfNode v : graph.vertices()) {
			v.root = v;
			v.align = v;
		}
		switch (mode) {
		case LEFTMOST_UPPER:
			for (int i = 1; i < layers.size(); i++) {
				verticalAlignmentLeft(graph.reverse(), layers.get(i));
			}
			break;
		case RIGHTMOST_UPPER:
			for (int i = 1; i < layers.size(); i++) {
				verticalAlignmentRight(graph.reverse(), layers.get(i));
			}
			break;
		case LEFTMOST_LOWER:
			for (int i = layers.size() - 2; i >= 0; i--) {
				verticalAlignmentLeft(graph, layers.get(i));
			}
			break;
		case RIGHTMOST_LOWER:
			for (int i = layers.size() - 2; i >= 0; i--) {
				verticalAlignmentRight(graph, layers.get(i));
			}
			break;
		}
	}