mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-06 01:18:52 -06:00
Upgrade to Gurobi 9.5
This commit is contained in:
2
Makefile
2
Makefile
@@ -27,7 +27,7 @@ docs:
|
||||
|
||||
install-deps:
|
||||
$(PIP) install --upgrade pip
|
||||
$(PIP) install --upgrade -i https://pypi.gurobi.com 'gurobipy>=9.1,<9.2'
|
||||
$(PIP) install --upgrade -i https://pypi.gurobi.com 'gurobipy>=9.5,<9.6'
|
||||
$(PIP) install --upgrade xpress
|
||||
$(PIP) install --upgrade -r requirements.txt
|
||||
|
||||
|
||||
@@ -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