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

asked 19 Dec '11, 12:29

chaima's gravatar image

accept rate: 0%

retagged 19 Dec '11, 13:33

fbahr's gravatar image

fbahr ♦

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).



answered 19 Dec '11, 16:54

Marco%20Luebbecke's gravatar image

Marco Luebbecke ♦
accept rate: 16%

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%20Serra's gravatar image

Thiago Serra
accept rate: 1%

Cplex default gap is something like 1e-4, 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%20Rubin's gravatar image

Paul Rubin ♦♦
accept rate: 19%

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's gravatar image

accept rate: 0%


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
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 19 Dec '11, 12:29

Seen: 6,672 times

Last updated: 20 Dec '11, 09:51

OR-Exchange! Your site for questions, answers, and announcements about operations research.