private boolean isAdjacent(UndirectedGraph g, Variable v1, Variable v2) { return g.getEdge(v1, v2) != null; }