This model is based on the models showed in the Chapter 19 of the AMPL book, related to complementarity problems.
Complementarity model
Consider the new variables Price[i]
for each product, and solve the problem to find an equilibrium instead of an optimum solution. The equilibrium is subject to two conditions:
First, for each product, total output must meet demand and price must be nonnegative, and in addition there must be a complementarity between these relationships, where production exceeds demand the price must be zero, or equivalently, if the price is positive, the production must equal the demand.
subject to Pri_Compl {i in PROD}:
Price[i] >= 0 complements
sum {j in ACT} io[i,j] * Level[j] >= demand[i];
Second, for each activity j
, the value of resulting product i
is Price[i]*io[i,j]
, so activity j
would produce a total value of
$$\sum \limits_{i \in PROD} Price[i] \cdot io[i,j]$$
When equilibrium happens, the previous value must not exceed the activity’s cost per unit cost[j]
. Moreover, there is a complementarity between this relationship and the level of activity j
, where cost exceeds total value the activity must be zero, or, where the activity cost is positive then the total value must be equal to the cost. This can be expressed as:
subject to Lev_Compl {j in ACT}:
Level[j] >= 0 complements
sum {i in PROD} Price[i] * io[i,j] <= cost[j];
Remark: the model is square, as there are $n+m$ variables and $n+m$ constraints ($n$ number of products and $m$ number of activities). Some solvers can take advantage of this to use different solving techniques.
Finally, let’s see that the equilibrium model gives also the optimal solution for the first classic formulation.
Gurobi 10.0.0:Gurobi 10.0.0: optimal solution
0 simplex iterations
Objective = find a feasible point.
sum{j in ACT} cost[j]*Level[j] = 6808640
Level [*] :=
P1 0
P1a 1555.3
P2 0
P2a 0
P2b 0
P3 147.465
P3c 1889.4
P4 0
;