joaopedroso / scipbook

67 stars 26 forks source link

The use of relax in **Column generation method for the cutting stock problem ** #3

Open virsto opened 4 years ago

virsto commented 4 years ago

Here is some python code that illustrates the problem:

from pyscipopt import Model master = Model("master LP") relax = master.relax()

This generates the error: builtins.AttributeError: 'pyscipopt.scip.Model' object has no attribute 'relax'

Note, I am using Python 3.6.5 and pyscipopt 3.0.2. Could you please show me how I can use "relax" as shown in your documentation? Thank you.

joaopedroso commented 4 years ago

Dear Virsto,

I think there is no easy way for assessing the LP relaxation in pyscipopt (as opposed to, say, gurobipy). However, you could do something like:

relax integer variables

for i in Is: model.chgVarType(y[i], "C")

Hope this helps,

jpp