for (Iterator it = goodEdges.iterator (); it.hasNext ();) {
Factor factor = (Factor) it.next ();
touchFactor (factor);
}
UndirectedGraph g = new SimpleGraph ();
for (Iterator it = fullGraph.variablesIterator (); it.hasNext ();) {
Variable var = (Variable) it.next ();
g.addVertex (var);
}
for (Iterator it = goodEdges.iterator (); it.hasNext ();) {
Factor factor = (Factor) it.next ();
g.addVertex (factor);
for (Iterator vit = factor.varSet ().iterator (); vit.hasNext ();) {
Variable var = (Variable) vit.next ();
g.addEdge (factor, var);
}
}
Tree tree = graphToTree (g);
if (reportSpanningTrees) {