coin-or / pulp

A python Linear Programming API
http://coin-or.github.io/pulp/
Other
2.05k stars 381 forks source link

My lpAffineExpression has a value named as "constant" but when I use the function ".value()" returns a different value than "constant" #628

Open Magrijv opened 1 year ago

Magrijv commented 1 year ago

Details for the issue

What did you do?

A simple problem of optimization with linear functions that has the form below:

C * VP + lpVariable >= restriction

where:

C = constant for the problem VP = AnotherConstant - lpVariable restriction = another constant for the problem

Then, VP comes to be a lpAffineExpression. Usually I use VP in the operation described above and the operation extract the constant value from the lpAffineExpression.

But in a specific case, the value used from the lpAffineExpression diverge from the constant value.

In which case can it be possible?

What did you expect to see?

The value used in the operation be the same as the constant value

What did you see instead?

A value that I can't see in any attribution in the lpAffineExpression.

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

I installed PuLP via:

Did you also