private boolean graphColoring(HashMap<Integer, Set<Integer>> copyGraph,
			Stack<Integer> colorStack) {

		while (true) {
			Iterator<Entry<Integer, Set<Integer>>> iter = copyGraph.entrySet().iterator();
			boolean changed = false;
			while (iter.hasNext()) {
				Entry<Integer, Set<Integer>> node = iter.next();
				if (node.getValue().size() < REGNUM_LIMIT) {
					colorStack.push(node.getKey());
					// remove edge
					for (Integer to : node.getValue()) {
						if (copyGraph.containsKey(to)) {
							copyGraph.get(to).remove(node.getKey());
						}
					}
					// remove node
					iter.remove();
					changed = true;
				}
			}
			if (!changed) {
				break;
			}
		}
		return !copyGraph.isEmpty();
	}