When I set constraints in CPLEX I would like (not surprisingly) the solution of my Mixed Integer Linear Program (MILP) to actually fulfill these constraints. How do I make sure that CPLEX outputs a solution that actually fulfills all the given constraints. (We know that there are many feasible points that fulfill all of the constraints.)
Unfortunately CPLEX outputs a "solution" after 15 seconds (while having a time budget of 600 seconds) with status='integer optimal, tolerance'. But when we check Sol.find_unsatisfied_constraints(self.Mip) it tells us that there is an unsatisfied constraint.
One very hacky solution we found is to loop through all the alternative solutions (solution_pool = self.Mip.populate_solution_pool()) and check for each solution if it actually satisfies the constraints (with Sol.find_unsatisfied_constraints) and take the best solution that does actually fulfill all the constraints.
Is there a better solution? I think I am not the first the person who actually wants the solution to satisfy the given constraints.
Edit: All the variables involved in the unsatisfied inequality caonstraint are binary variables, so I don't think it can be the same problem as described here: https://community.ibm.com/community/user/legacy?id=ed9c22c9-9055-4032-a3c7-610fda705554&ps=25
Edit2: The inequality constraint we have given to our MILP is -sum(x)<=-0.5, but CPLEX outputs x=[0,0,0,...,0] as a solution. This is not even close to a solution. The zero-vector violates the inequality by a margin of 0.5, while we have use the default feasibility tolerance of 10-6. Why does this happen?