solver solution differs from the best solution - PART 2 Topic is solved

Problems with modeling
Post Reply
vbravim
User
User
Posts: 7
Joined: 3 years ago

solver solution differs from the best solution - PART 2

Post by vbravim »

Hello everyone,
I'm modelling a MIP. The solver is oriented to minimise the objective function. I know that the best solution of the MIP is 43,8 (I've solved it by hands). When I ran GAMS, the solver (CPLEX) did not reach the best value, as you guys can see:

Solution satisfies tolerances.

MIP Solution: 47.400000 (277 iterations, 24 nodes)
Final Solve: 47.400000 (18 iterations)

Best possible: 43.800000
Absolute gap: 3.600000
Relative gap: 0.075949

Then, based on a tip I've gotten here (thank you Fred), I set optcr = 0 (I also set other values). As a result, the solution changed, but it wasn't the best one (43,8) yet, as shown below:

Proven optimal solution.

MIP Solution: 44.200000 (289 iterations, 27 nodes)
Final Solve: 44.200000 (15 iterations)

Best possible: 44.200000
Absolute gap: 0.000000
Relative gap: 0.000000

I've tried all the MIP solvers that a demo license provide. None of them have reached the best solution. Besides that, I've tried starting points, which didn't change the result at all.

Could anyone here suggest a way to fix it?

thank you guys in advance

cheers!
Fred
Posts: 372
Joined: 7 years ago

Re: solver solution differs from the best solution - PART 2

Post by Fred »

Hi,

If all solvers return an optimal solution with objective value 44.2, my guess is that your own "solution" with objective value 43.8 is wrong.
One way to go about analyzing this could be to provide your solution to the problem by manually setting the variable level values (x.l(i,j) = ...) and then generating the model with a full equation listing (option limrow=1e9;) This will flag the constraints that are infeasible with your "feasible" solution (INFES =...).

I hope this helps!

Fred
vbravim
User
User
Posts: 7
Joined: 3 years ago

Re: solver solution differs from the best solution - PART 2

Post by vbravim »

You helped me a lot.

I provided the solution by hand and the result was infeasible. The log showed what specifically was infeasible and then I could find out the mistake I had made during the code development.

I wish you the very best, thank you so much.
Post Reply