Providing initial solution and reoptimizing

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?)

Hi Nikou

You could do this as follows:

MODEL MyModel /ALL/;
SOLVE MyModel USING MILP MAXIMIZING Z ;

model MyModel2 /... all equations without eq2/;
SOLVE MyModel2 USING MILP MAXIMIZING Z ;

Gams will automatically use the solution from your first solve for the next solve.

Cheers
Renger

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;

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_CPLEX.html#CPLEXmipstart

I hope this helps!

Fred