Hello All
I have a MILP model consisting of say 2 constraints, Eq1(X,Y), Eq2(X,Y) and the objective function Z (X,Y)
I use the Statement
MODEL MyModel /ALL/;
SOLVE MyModel USING MILP MAXIMIZING Z ;
and get the results X*, Y*
Now I would like to drop Eq2 from the model and resolve using X*,Y* as a starting solution to the reduced Model .
Is there a way to pass the values X*,Y* directly to the new model ( e.g. without having to save first them on new variables?)
Providing initial solution and reoptimizing
Re: Providing initial solution and reoptimizing
Hi Nikou
You could do this as follows:
Gams will automatically use the solution from your first solve for the next solve.
Cheers
Renger
You could do this as follows:
Code: Select all
MODEL MyModel /ALL/;
SOLVE MyModel USING MILP MAXIMIZING Z ;
model MyModel2 /... all equations without eq2/;
SOLVE MyModel2 USING MILP MAXIMIZING Z ;
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: Providing initial solution and reoptimizing
Thank you very much!
I suppose it will work the same way, if I drop some prefixed values.
I mean,
Eq1..
Eq2..
X.FX = a ;
Model MyModel1 /All/ ;
Solve MyModel1 using milp maximizing z;
X.LO = lb ;
X.UP = ub;
Model MyModel2 /All/
Solve MyModel2 using milp maximizing z;
I suppose it will work the same way, if I drop some prefixed values.
I mean,
Eq1..
Eq2..
X.FX = a ;
Model MyModel1 /All/ ;
Solve MyModel1 using milp maximizing z;
X.LO = lb ;
X.UP = ub;
Model MyModel2 /All/
Solve MyModel2 using milp maximizing z;
Re: Providing initial solution and reoptimizing
Nikou,
Dropping fixed values for variables works as you describe it (reste lower/uooer bound).
For MIP solvers, to use a starting point, usually you have to set a corresponding solver option, see e.g. https://www.gams.com/latest/docs/S_CPLE ... EXmipstart
I hope this helps!
Fred
Dropping fixed values for variables works as you describe it (reste lower/uooer bound).
For MIP solvers, to use a starting point, usually you have to set a corresponding solver option, see e.g. https://www.gams.com/latest/docs/S_CPLE ... EXmipstart
I hope this helps!
Fred