private static Triple<List<Set<Integer>>, int[], int[]> searchTree(Graph g, List<Set<Integer>> partition,
			Triple<List<Set<Integer>>, int[], int[]> soFar) {
		if (discrete(partition)) {
			int[] label = partitionToMatrix(partition, g.domainSize(), g);
			// int[] label = partitionToLabel(partition, g.domainSize());
			if (soFar == null) {
				return new Triple<List<Set<Integer>>, int[], int[]>(partition, label, label);
			} else {
				// int[] value = partitionToValue(partition, g, label);
				if (greaterThan(label, soFar.second)) {
					return new Triple<List<Set<Integer>>, int[], int[]>(partition, label, label);
				}
				return soFar;
			}
		}
		// Find the first smallest non trivial cell of partition since there
		// must be one
		int min = -1;
		int size = Integer.MAX_VALUE;
		for (int i = 0; i < partition.size(); i++) {
			int s = partition.get(i).size();
			if (s > 1 && s < size) {
				min = i;
				size = s;
			}
		}
		Set<Integer> Wk = partition.get(min);

		Triple<List<Set<Integer>>, int[], int[]> current = soFar;
		for (int i : Wk) {
			// DO THE splitting
			List<Set<Integer>> newPartition = new ArrayList<Set<Integer>>();

			for (int j = 0; j < min; j++) {
				newPartition.add(partition.get(j));
			}

			Set<Integer> u = new TreeSet<Integer>();
			u.add(i);
			newPartition.add(u);
			Set<Integer> Wk1 = new TreeSet<Integer>(Wk);
			Wk1.remove(i);
			newPartition.add(Wk1);

			for (int j = min + 1; j < partition.size(); j++) {
				newPartition.add(partition.get(j));
			}

			// Now you need to do the equitable refinement again
			List<Set<Integer>> alpha = new ArrayList<Set<Integer>>();
			alpha.add(u);
			newPartition = equitableRefinement(g, newPartition, alpha);

			// if (discrete(newPartition)) {
			// int[] value = partitionToMatrix(newPartition, g.domainSize(), g);
			// print(newPartition, value);
			// } else {
			// print(newPartition, null);
			// }

			current = searchTree(g, newPartition, current);

		}
		return current;

	}