Re-solve model Fixing Variables

Problems with syntax of GAMS
Post Reply
serch199
User
User
Posts: 10
Joined: 1 year ago

Re-solve model Fixing Variables

Post 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
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Re-solve model Fixing Variables

Post 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
serch199
User
User
Posts: 10
Joined: 1 year ago

Re: Re-solve model Fixing Variables

Post by serch199 »

Thank you Manassaldi
Your information helped me a lot.
Fred
Posts: 372
Joined: 7 years ago

Re: Re-solve model Fixing Variables

Post 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
Post Reply