How to turn all integer variables into reals? #4578
-
Hi, I have a code that creates a MILP model using linear_solver API. Sometimes I need to solve this model, and sometimes I need to solve its LP relaxation with integer variables turned into real variables. How to do this with as little additional code as possible? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 4 replies
-
Disclaimer:
That being said:
Howewer:
I'm in strong favor of A, then C. |
Beta Was this translation helpful? Give feedback.
-
there is a MPVariable::unrounded_solution_value() |
Beta Was this translation helpful? Give feedback.
-
no, solve with glop or clp
Laurent Perron | Operations Research | ***@***.*** | (33) 1 42 68 53
00
Le mar. 4 mars 2025 à 17:47, Yury Semenov ***@***.***> a
écrit :
… Thank you, but as far as I understand, in this case I'll still have to
solve MILP model even if I need relaxation. The overhead seems too large
for me :(
—
Reply to this email directly, view it on GitHub
<#4578 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3PLH73ULQCIOIW767D2SXKL5AVCNFSM6AAAAABYGXCJXOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZZGEYDQMI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I checked, it does not. I will add it.
Laurent Perron | Operations Research | ***@***.*** | (33) 1 42 68 53
00
Le mar. 4 mars 2025 à 18:06, Yury Semenov ***@***.***> a
écrit :
… Thank you, I'll try it. I didn't know LP solvers could accept integer
variables.
Btw, is unrounded_solution_value available in Python wrapper? Reference
only mentions solution_value.
—
Reply to this email directly, view it on GitHub
<#4578 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACUPL3PRJDAWSNQLX2MZOZL2SXMR3AVCNFSM6AAAAABYGXCJXOVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMZZGEZDSOA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Disclaimer:
That being said:
is_model_relaxed
boolean-flag to your model-building codeHowewer: