scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
366 stars 63 forks source link

Adding constraint improves objective. #90

Closed karlsb1871 closed 2 months ago

karlsb1871 commented 2 months ago

Hi there,

I have been using russcip to solve an MILP and I have encountered an issue, which I raised with the link below and was directed to this repo.

https://github.com/scipopt/russcip/issues/142

The issue is that I have an MILP, which I am maximising and when I remove a set of constraints, the objective value decreases, from 4 to 0.

Attached are the logs for both with and without the constraints, as well as the lp file with the constraints.

Let me know if you require any more information

Thanks in advance Karl

without_constraint.txt with_constraints.txt path.txt

DominikKamp commented 2 months ago

Your formulation contains linear coefficients of magnitude 1.79769313486232e+308 larger than the infinity bound, which is not supported and results in a reader error from SCIP 9.0.0 on meaning that you are using some SCIP <= 8.1.0. I could not reproduce the violating primal solution but instead the model results in infeasibility with SCIP 8.1.0 and also with SCIP 9.0.0 if infinite coefficients are reduced.

So this rather seems to be a formulation issue. To resolve this you should try to systematically tighten the infinite coefficients to the smallest correct values. Usually, there are known variable bounds, which imply suitable big-Ms.

Good luck!

karlsb1871 commented 2 months ago

Hi @DominikKamp ,

Thanks for your response. Thanks for finding this issue. This was because I was had a variable which only required a lower bound, so I had done x <= f64::MAX (in rust). I shall amend this and update if the issue persists

DominikKamp commented 2 months ago

This could be the cause if at some point those infinite bounds are translated into coefficients. Providing some redundant finite bounds could help. This can also improve performance since those bounds do not have to be inferred during runtime.

karlsb1871 commented 2 months ago

they were indeed. I had some big M constraints where y <= Mx and i was setting M to y's upper bound, which was fine for 90% of the variables, but as you have pointed out for a few instances this meant that M was too large. ive changed the upper bound to something more reasonable so hopefully that shall this problem. once again many thanks 👍🏻