/** * Returns the weight of the clique that would be added to a graph if a given vertex would be * removed in the triangulation procedure. The return value is the number of edges in the * elimination clique of V that are not already present. */ private int weightRequired(UndirectedGraph mdl, Variable v) { int rating = 1; for (Iterator it1 = neighborsIterator(mdl, v); it1.hasNext(); ) { Variable neighbor = (Variable) it1.next(); rating *= neighbor.getNumOutcomes(); } // System.out.println(v+" = "+rating); return rating; }