Hello everybody
I m getting a weird problem with Cplex.
Actually I m working on a minimization problem on Cplex C++.
I solved my problem and I got an optimal solution
Later I added to my model a constraint but the problem that the solution went down !
I resolved the problem without the last constraint with Cplex interactive and I got the same optimal solution. Later when I added the same constraint it decreased too.
Has anyone got the same problem before ?
PS : my variables are boolean 
concerning your question "how can I be sure that the optimality gap ist null" you can set mip tolerances mipgap 0.0 (the default is 0.0001). marco answered 19 Dec '11, 16:54 Marco Luebbecke ♦ 
How much did it decrease? Mind that CPLEX retrieves an optimal solution within an optimality gap. I saw something similar happening, but it was caused by that gap: it was an maximization problem for which a slightly better solution appeared by adding a constraint. answered 19 Dec '11, 12:51 Thiago Serra Cplex default gap is something like 1e4, which is usually enough. Based on your objective function, you would probably deduce a gap that is tighter to ensure optimality. It is a little hard to guess what is going on without further information. I think that you should consider coming up with a small example of what seems to be going wrong with your model and reproduce it here. Yet another possibility is to use the Cplex official forums (http://www.ibm.com/developerworks/forums/forum.jspa?forumID=2059).
(19 Dec '11, 14:41)
Thiago Serra
I found a solution to my problem. I have in my model an upper bound that I was taking around 10^6 while my variables were 10^2. I don t get why it didn't work so, but now it s ok Thanks !
(20 Dec '11, 09:51)
chaima

The first thing I would do its have the C++ code write the basic model (without extra constraints or variable fixings) to a SAV file, so that you can play with it in the interactive optimizer. If tweaking parameter settings doesn't resolve the anomalies, and assuming your model is not proprietary (and not too large), you can post the SAV file somewhere and provide a link here, along with details on how to create the anomalies. answered 19 Dec '11, 17:02 Paul Rubin ♦♦ 
Thanks for answering ! How can I be sure that the optimality gap is null ? I solved the problem manually and couldn't find the result that Cplex got in anyway. Actually, during programming I m trying to fix some boolean variables by adding a constraint that affects 1 to the variables I want Cplex to consider all the time. But I started to notice that when fixing some variables the optimal solution decreased. So, I added a constraint in which I affect 1 to all the variables that were found in the optimality by solving the initial problem. And I got a new optimal solution that is inferior to the initial solution. Really couldn't find out what's wrong ? answered 19 Dec '11, 14:27 chaima 1
Notice that this website works as a Q&A environment and not like a forum. It is preferable that any additional information be sent as a comment to another answer or else included in your question.
(19 Dec '11, 14:44)
Thiago Serra
