public static boolean isEulerianCycle(IAIGraph graph, List<Long> edges) {
		
		// check that each edge appears exactly once in the eulercycle
		if (new HashSet<Long>(edges).size() != graph.getEdges().size())
			return false;
		
		// now check, that all the edges are actually consecutive.
		int size = edges.size();
		for (int i = 0; i < size - 1; i++) {
			Long currE = edges.get(i) % size;
			Long nextE = edges.get(i + 1) % size;

			// check, that there is a vertice between two consecutive edges
			if (commonVerticesOf(currE, nextE, graph).size() > 3) {
				return false;
			}
		}
		return true;
	}