Region fourSquare = new Region (vars, edges);
// Create 1-clique region
for (int i = 0; i < 4; i++) {
Variable var = vars[i];
Factor ptl = mdl.factorOf (var);
if (ptl != null) {
fourSquare.factors.add (ptl);
}
}
// Finally create edge regions, and connect to everyone else
for (int i = 0; i < 4; i++) {
Factor edgePtl = edges[i];
Region edgeRgn = rg.findRegion (edgePtl, true);
rg.add (fourSquare, edgeRgn);
Variable v1 = (Variable) edgeRgn.vars.get (0);
Region nodeRgn = createVarRegion (rg, mdl, v1);