Smith
Smith

Reputation: 45

Gurobi constraint violations

How to get rid of constraint violations in Gurobi? This decimal places is causing lot of problems in my MILP program.

The solution quality shows following error. Solution quality statistics for M model : Maximum violation: Bound : 0.00000000e+00 Constraint : 8.88178420e-16 (constraint_6) Integrality : 0.00000000e+00

Upvotes: 0

Views: 431

Answers (1)

mattmilten
mattmilten

Reputation: 6726

There is no constraint violation in the computed solution. What you are seeing here is merely an effect of using floating-point arithmetic. Numbers with an absolute value below 1e-15 are in most cases ignored and treated like 0.

If you are really looking for an "exact" solution, you need to use a solver that implements exact arithmetic. QsoptEx and SoPlex are two such solvers, but only for linear programming problems.

Upvotes: 1

Related Questions