Reputation: 1
I am working on an order allocation problem with variable and fixed costs. The initial formulation of this problem was a linear optimization, but when fixed and variable costs were introduced, it required the formulation to be non-linear due to the decision variable (Xij being multiplied with the switching variable Sj). Now that the formulation has changed, I have the following questions:
Order No. | Product | Process Time (hours) | Site 1 | Site 2 | Site 3 |
---|---|---|---|---|---|
1 | P1 | MH1 | X11 | X12 | X13 |
2 | P2 | MH2 | X21 | X22 | X23 |
3 | P3 | MH3 | X31 | X32 | X33 |
4 | P4 | MH4 | X41 | X42 | X43 |
5 | P5 | MH5 | X51 | X52 | X53 |
6 | P6 | MH6 | X61 | X62 | X63 |
Site 1 | Site 2 | Site 3 |
---|---|---|
Fixed Capacity (hours) | FCa1 | FCa2 |
Fixed Cost | FCo1 | FCo2 |
Variable Cost | VCo1 | VCo2 |
A company has 3 manufacturing sites, and it must decide on how to allocate various products to all three sites to reduce manufacturing cost meeting all the constraints. The constraints are that all products must be built and only in one site. The man hours required to build the product in the manufacturing site is mentioned in the above table as MH.
In every site there is a fixed manufacturing capacity (FCa) in terms of man hours it can process, and this fixed capacity has an associated fixed cost (FCo). If the allocation of orders to the site is less than the fixed capacity for a site, it will have total cost equal to fixed cost and if the allocation is greater than the fixed capacity a Variable Cost (VCo) would kick-in.
Example: If site has a fixed capacity say 2000 hours with an associated fixed cost of $100,000 and variable cost of $100 per hour after that.
Case 1: Allocation to the site is less than the fixed capacity of the site Suppose the allocation of orders is equal to 1800 MH ⟹ Total Cost would be $100,000.
If order allocation < FCa
Total Cost = FCo
Case 2: Allocation to the site is greater than the fixed capacity of the site Suppose the allocation of orders is equal to 2100 MH ⟹ Total cost would be $110,000.
If order allocation > FCa
Total Cost = FCo + (order allocation - FCa) × VCo
i = Orders: (1,2,3,4,5,6)
j = Sites: (1,2,3)
Xij: binary integer decision of order i being built in site j
MHi = Man hours required to build product i
FCaj = Fixed capacity at site j
FCoj = Fixed cost at site j
VCoj = Variable cost at site j
Switching Variable Constraint #1
When Fixed Capacity > Order Allocation:
⟹ sj = 0 and the objective function will consider fixed cost only
Switching Variable Constraint #2
When Fixed Capacity > Order Allocation:
⟹ sj = 1 and the objective function will consider fixed cost and variable cost
Make sure all the products are allocated and being built at one site: Order Allocation Constraint
Upvotes: 0
Views: 1060
Reputation: 16714
PuLP only does linear models. For non-linear models, you need to use different tools.
A product like X[i,j]*s[j]
where X
is a continuous variable and s
binary variable can be linearized as follows.
Let XS[i,j]=X[i,j]*s[j]
with XS
a non-negative continuous variable. Further let 0 <= X[i,j] <= U[i,j]
. I.e. we know an upperbound on X
(capacity). So we have:
X[i,j] ∈ [0,U[i,j]]
XS[i,j] ∈ [0,U[i,j]]
Then we can write:
XS[i,j] <= U[i,j]*s[j];
XS[i,j] <= X[i,j]
XS[i,j] >= X[i,j]-(1-s[j])*U[i,j]
To verify:
case 1: s[j]=0
. Then we have
XS[i,j] <= 0;
XS[i,j] <= X[i,j]
XS[i,j] >= X[i,j]-U[i,j]
==> XS[i,j] = 0
case 2: s[j]=1
. Then we have
XS[i,j] <= U[i,j];
XS[i,j] <= X[i,j]
XS[i,j] >= X[i,j]
==> XS[i,j] = X[i,j]
Upvotes: 3