Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Problem with the dual variables fixing the value of a variable

47 views
Skip to first unread message

giuseppes...@gmail.com

unread,
Jul 19, 2024, 4:45:56 PM7/19/24
to Pyomo Forum
Hi,
I am pretty new to Pyomo. I am sorry if the question is trivial, but I do not understand.
I have the following LP:

S = pyo.ConcreteModel()
S.dual = pyo.Suffix(direction=Suffix.IMPORT_EXPORT)
S.x = pyo.Var(within=NonNegativeReals)
S.y = pyo.Var(within=Integers)
S.obj = pyo.Objective(expr= S.x, sense=minimize)
S.cc = pyo.ConstraintList()
S.cc.add(2*S.x >= 3-S.y)

Now we fix the variable S.y = -5:
S.y.fix(-5.0)
We solve the model and we got x = 4, y=-5 and the dual variable u = -0.5.

Now we solve the equivalent model where we do the sum (3-(-5)):

S = pyo.ConcreteModel()
S.dual = pyo.Suffix(direction=Suffix.IMPORT_EXPORT)
S.x = pyo.Var(within=NonNegativeReals)
S.y = pyo.Var(within=Integers)
S.obj = pyo.Objective(expr= S.x, sense=minimize)
S.cc = pyo.ConstraintList()
S.cc.add(2*S.x >= 8)

We got x = 4, y=-5 and the dual variable u = 0.5.
Why? I expect to see the same value for u. I need to fix the value for the Bender Decomposition.

Reply all
Reply to author
Forward
0 new messages