Hello everyone,

I have a problem that I can just not solve by myself.

I am using CPLEX Concert in C++. The problem is, that I have some Variables which are bounded between 0 and 1, but the result still gives me negative values!

The program is way too long to show you, but this is how the variables are initialized:

lemon::ListDigraph::NodeMap<IloNumVar> m_map(graph_pixel);
m_map[node] = IloNumVar(env,0,1,IloNumVar::Float);
for(  node in graph  ){
    float varVal = cplex.getValue(m_map[node]);

The variable varVal will then sometimes get negative values! (minimum is -0.25). How is this even possible? Does anyone have an idea where the error could lie? I don't know if it matters, but CPLEX solved the problem using the dual.

Please let me know if you have an idea, or if I should give some more detail about the problem. I'd greatly appreciate your help, I am clueless...

Best regards,


asked 05 Jul '12, 09:12

SurfsUp's gravatar image

accept rate: 0%

closed 07 Jul '12, 14:39

fbahr's gravatar image

fbahr ♦


After solving the model, what does IloCplex::getCplexStatus() return?

(05 Jul '12, 17:09) Paul Rubin ♦♦

Good call, Paul!

It was indeed infeasible. Just super weird that it says "Dual Simplex solved the Model" instead of saying it is infeasible. I thought it might have given me the values of the variables of the dual problem or so. Well, the hunt for the bugs goes on, haha!

Thank you, have a nice weekend!

(06 Jul '12, 15:53) SurfsUp

I think Cplex does the right thing, your model is solved, the problem happens to be infeasible, but the the model is solved hence the information "Dual Simplex solved the Model" is fair enough IMO.

(06 Jul '12, 15:56) Bo Jensen ♦

Since my answer wasn't an answer, perhaps you could accept your own answer to close the question?

Oh, and I agree with Bo that discovering the model is infeasible counts as solving it. I'm guilty of not checking solver status as often as I should (which is +always+), so I sympathize.

(06 Jul '12, 17:42) Paul Rubin ♦♦

The question has been closed for the following reason "The question is answered, right answer was accepted" by fbahr 07 Jul '12, 14:39

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: 05 Jul '12, 09:12

Seen: 2,485 times

Last updated: 07 Jul '12, 14:39

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