Model model = solution.getModel();
if (model.nrUnassignedVariables()==0) return null;
Variable variable = null;
for (Enumeration e=model.unassignedVariables().elements();e.hasMoreElements();) {
Variable v = (Variable)e.nextElement();
if (variable==null || v.compareTo(variable)<0) variable = v;
}
return variable;
}
}