Page 1 of 1

Re-solve model Fixing Variables

Posted: Wed Jul 27, 2022 9:17 pm
by serch199
Hola que tal? En si, mi duda es que tengo modelo MIP, el cual encuentra solución y necesito volver resolver ese mismo modelo pero ahora fijando las variables binarias para poder utilizar un solucionado LP.
Por lo cual mi pregunta es ¿Es posible volver a resolver un modelo pero fijando ciertas variables (binarias) de una solución anterior?. :(
Gracias por su tiempo :D

Hello
Actually, my question is that I have MIP model, which finds solution and I need to re-solve that same model but now fixing the binary variables to be able to use a LP solver.
So my question is: Is it possible to re-solve a model but fixing certain variables (binary) of a previous solution?
Thank you for your time :D

Re: Re-solve model Fixing Variables

Posted: Thu Jul 28, 2022 1:18 pm
by Manassaldi
Hi, this was discussed here: viewtopic.php?f=9&t=12390

After solving I recommend you to fix (with .fx) the binary variables in this way:

solve yourmodel using mip min z
x.fx(i)$(x.l(i) ge 0.99) = 1;
x.fx(i)$(x.l(i) le 0.01) = 0;
solve yourmodel using mip min z

x is your binary variable and i its set

Best

Re: Re-solve model Fixing Variables

Posted: Fri Oct 21, 2022 9:22 pm
by serch199
Thank you Manassaldi
Your information helped me a lot.

Re: Re-solve model Fixing Variables

Posted: Mon Oct 24, 2022 10:02 am
by Fred
Hi,

Why do you want to solve the fixed MIP as an LP? If this is about the duals you would like to get for that fixed MIP, many solver links (e.g. GAMS/CPLEX) have a built-in option to solve the LP which you would get when fixing all discrete variables. For GAMS Cplex, this can be controlled via solver option solvefinal and is enabled by default.

I hope this helps!

Fred