Originally posted by: SystemAdmin
>
>
> I am trying to create a cplex object. Add the objective function. Then add the linear equations using the cplex.addGe() and cplex.addLe() methods. When I add the equations, the value of the ub is as assigned in the addLe or addGe methods but the value of the lower bound, is something like -1.7976931348623157E308 for all the equations.
This is essentially negative infinity. If it occurs as the lower bound in a <= constraint, that's perfectly fine -- it is the equivalent of having no lower bound. If it occurs as the lower bound of a >= constraint, that is a serious problem.
>
> While when I use the cplec.addRange(lb, expr, ub) method, it gives me an "ilog.cplex.CpxException IloRange has incompatible bounds" exception with lb = 0.0 and ub equal to the value of the r.h.s of the equation.
Check your value of ub when this happens. If lb really is zero, then ub must be negative, which would make the problem infeasible.
>
> Now my problem is that when I create a cplex object and solve it, it does not give me the desired result. While, if I export and import the same object, I get the correct results.
This usually suggests numerical instability, although the .lp file you attached produced a basis with a very mild condition number. If you save the problem in SAV rather than LP format, does the SAV file produce the correct answer?
>
Paul
Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
#CPLEXOptimizers#DecisionOptimization