mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 09:28:51 -06:00
Upgrade to Gurobi 9.5
This commit is contained in:
@@ -53,13 +53,17 @@ class GurobiStableSetProblem(Instance):
|
||||
@overrides
|
||||
def enforce_user_cut(
|
||||
self,
|
||||
solver: InternalSolver,
|
||||
solver: GurobiSolver,
|
||||
model: Any,
|
||||
cid: ConstraintName,
|
||||
) -> Any:
|
||||
clique = [int(i) for i in cid.decode().split(",")]
|
||||
x = model.getVars()
|
||||
model.addConstr(gp.quicksum([x[i] for i in clique]) <= 1)
|
||||
constr = gp.quicksum([x[i] for i in clique]) <= 1
|
||||
if solver.cb_where:
|
||||
model.cbCut(constr)
|
||||
else:
|
||||
model.addConstr(constr)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
Reference in New Issue
Block a user