I am currently working on a cost minimisation model for multi-product, multi-period supplier selection with Pyomo. It is a linear model described below.
I have no idea how to formulate a restriction that defines the binary decision variables with the values 0 and 1 respectively. Currently, only the calculation of unit level costs works. The binary variables always remain at 0, so no order level costs or supplier level costs are included.
I would be very grateful if someone had an idea to formulate the restrictions for the binary variables.
The model consists of three sets:
- products: P
- time periods: T
- suppliers: S
For simplicity, the model has five parameters:
- Supplier level costs: slc[s]
- Order level costs: olc[s,t]
- Unit level costs: ulc[p,s,t]
- Production capacity: c[p,s,t]
- Demand: d[p,t]
There are three decision variables:
- Delivery quantity: x[p,s,t]: units of product p ordered in period t from supplier s
- Binary assignment variable: y_1[s] value: "1" if supplier s delivers (independent of product and period), else "0"
- Binary assignment variable: y_2[s,t] value: "1" if supplier s delivers in period t (independent of product), else "0"
minimize Total Costs = Sum_slc + Sum_olc + sum_ulc
- Sum_slc=sum((model.y_1[s]) * model.slc[s] for s in model.S)
- Sum_olc=sum(model.y_2[s,t] * model.olc[s,t] for s in model.S for t in model.T)
- Sum_ulc=sum(model.x[p,s,t] * model.ulc[p,s,t] for p in model.P for s in model.S for t in model.T)
Demand constraint: sum(model.x[p,s,t] for s in model.S) == model.d[p,t] Capacity constraint: model.xME[p,s,t] <= model.c[p,s,t]