Hi,
if you rewrite your constraint into
forall (n in Node_List) {
EOH_Constraint1:
EOH[n] <= BOHQty[n] +
sum (out in Output_Node_List: out == n)loadingOutput[out]
- sum (p1 in Non_Alternative_Production: p1.Input == n)loadingInput[p1.Output][n]
- sum (p2 in Alternative_Production: p2.Input == n)loadingInput[p2.Output][n];
EOH_Constraint2:
BOHQty[n] +
sum (out in Output_Node_List: out == n)loadingOutput[out]
- sum (p1 in Non_Alternative_Production: p1.Input == n)loadingInput[p1.Output][n]
- sum (p2 in Alternative_Production: p2.Input == n)loadingInput[p2.Output][n] <=EOH[n];
}
Then you ll get
the shadow price value of AO = 0
the shadow price value of AO = -15
the shadow price value of BO = 0
the shadow price value of BO = 0
the shadow price value of DEMAND = 0
the shadow price value of DEMAND = -20
the shadow price value of MAT = 0
the shadow price value of MAT = -5
the shadow price value of AI = 0
the shadow price value of AI = -10
the shadow price value of BI = -5
the shadow price value of BI = 0
An equality is a set of <= and >=
regards
------------------------------
[Alex] [Fleischer]
[EMEA CPLEX Optimization Technical Sales]
[IBM]
------------------------------
Original Message:
Sent: Tue November 17, 2020 03:51 AM
From: Hui Zhao
Subject: Incorrect shadow price values in CPLEX
Hi everyone,
I am trying to retrieve the shadow price values of some constraints in a CPLEX based optimization problem, but it seems the values are incorrect.
Problem statement:
(Please also see the model formulation in the attached .mod file.)
Constraints:
(1) A demand product can be fulfilled by either of 2 alternative inputs AO and BO.
(2) To produce AO (BO), we need both AI (BI) and MAT at the same time.
(3) AO and BO are flow parts, which should always have 0 end on hand inventory (EOH).
(4) All parts have inventory costs.
Objectives: minimize backorder cost + inventory cost.
Data:
(1) Inventory cost: Demand = 20, AO = BO = 10000, AI = BI = 10, MAT = 5.
(2) Demand quantity = 100, priority = 30.
(3) Beginning on hand inventory (BOH): AI = 200, MAT = 150.
Solving results:
(1) backorder quantity = 0. Inventory cost = 3250.
(2) Shadow price:
the shadow price value of AI = 10
the shadow price value of BI = -5
Question:
Why the shadow price values of AI and BI are different? Because of the constraint (1) and (2) and equal inventory cost, we think AI and BI are alternative. It is difficult for me to explain why AI and BI have different shadow price values. Can anyone help?
Thank you very much.
------------------------------
Best Regards,
Hui Zhao
------------------------------
#DecisionOptimization