I'm trying to write a custom separator (aka, MIP cutter) to my SCIP model (in Python). To do this I need to detect which constraints are tight/binding at the given MIP node. I thought that I could do this by comparing LHS to RHS on the rows (aka, the constraints). However, one of the two always reports +/- 1e20. Why is that? How do I iterate on the binding constraints?
class Cutter(scip.Sepa):
def sepaexeclp(self):
m: scip.Model = self.model
if not m.getLPSolstat() or not m.isLPSolBasic():
return {"result": scip.PY_SCIP_RESULT.DIDNOTRUN}
cols = m.getLPColsData()
rows = m.getLPRowsData()
values = [col.getPrimsol() for col in cols]
constraints = [row for row in rows if row.getLhs() == row.getRhs()] # always empty
...