# [closed] CPLEX Concert: Variable gets negative value even though it is bounded!

 1 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 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, Konstantin asked 05 Jul '12, 09:12 SurfsUp 31●1●1●3 accept rate: 0% fbahr ♦ 4.6k●7●16 1 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 1 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

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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

Tags:

×191
×30
×21