private boolean dfs(Color[] color, int i) {
		if(color[i] == Color.BLACK) return true;
		color[i] = Color.GREY;
		for(Node n : list[i]) {
			int id = n.getId();
			if(color[id] == Color.GREY) return false;
			if(!dfs(color, id)) return false;
		}
		color[i] = Color.BLACK;
		return true;
	}