I know a better solution

Frequently asked questions about GAMS

Moderator: aileen

Forum rules
Please ask questions in the other sub-forums
Locked
aileen
User
User
Posts: 136
Joined: 4 years ago

I know a better solution

Post by aileen »

Is it possible that I found a better solution for my model than the optimal solution provided by the solver?
aileen
User
User
Posts: 136
Joined: 4 years ago

Re: I know a better solution

Post by aileen »

Sometimes the solver found an optimal solution x with objective value z, but one believes that there is a better solution y which has objective value z*. There are different ways to look at such a situation:

1. For models with discrete variables or global solvers in general, make sure you have set option optCR=0; so the solver looks indeed for the global solution.

2. If you solve with a local solver this situation is a possibility for non-convex models. Select a global solver or use a better starting point to overcome this.

3. Your better solution is not a solution. You can have the solver or GAMS check your conjecture by either fixing the variables to the proposed solution (e.g. x.FX(i,j) = …;) or set the variable level (e.g. x.L(i,j) = …;). In the former case the solver either accepts your solution or reports infeasible. In the latter case, the equation listing has some INFES markers. Make sure to use set limRow to see all equations and tolInfRep to filter the small infeasibilities.

Code: Select all

* enter data for proposed solution
PARAMETER P(I) proposed solution /
    i1 1.0
    i2 2.0
    i3 3.0 
/;

* fix variables
X.FX(I) = P(I);

* and let solver check if this is a feasible solution
SOLVE M USING MIP MINIMIZING Z;
Locked