You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The two expressions y.sum() - x.sum() * 3 <= -1 and y.sum() - 3 * x.sum() <= -1 should represent the same constraint and give the same results but only the second gives the correct model.
The text was updated successfully, but these errors were encountered:
I believe this is a documented limitation.
On Friday, January 28, 2022, 05:08:03 AM PST, sdementen ***@***.***> wrote:
When multiplying by a constant before or after a variable.sum() I get a wrong / good answer
from cylp.cy.CyClpSimplex import CyClpSimplex
s = CyClpSimplex()
x = s.addVariable("x", 2)
y = s.addVariable("y", 2)
s += y >= 0
s += y.sum() - x.sum() * 3 <= -1 # ==> gives wrong solution x=[0,1]
# s += y.sum() - 3 * x.sum() <= -1 # ==> gives correct solution x=[0,0.3333]
s.objective = x.sum()
s.primal()
The two expressions y.sum() - x.sum() * 3 <= -1 and y.sum() - 3 * x.sum() <= -1 should represent the same constraint and give the same results but only the second gives the correct model.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
When multiplying by a constant before or after a variable.sum() I get a wrong / good answer
The two expressions
y.sum() - x.sum() * 3 <= -1
andy.sum() - 3 * x.sum() <= -1
should represent the same constraint and give the same results but only the second gives the correct model.The text was updated successfully, but these errors were encountered: