Given a pyscipopt.Model
, how to solve its linear relaxation in the shortest code possible?
The documentation is hard to navigate. There was a similar question before, but the answer does not apply here.
You need to iterate through all variables and change their types to CONTINUOUS
:
for v in model.getVars():
m.chgVarType(v, 'CONTINUOUS')
Then you can solve the LP relaxation of the problem. Please note that your model should be a standard MIP and not contain any nonlinear or general constraints.