I am still trying to solve a problem based on Minimum Cost Flow Problem.
In short, there are four suppliers (L1,L2,L3 and L4), supplier L1 has 2 products (PN1 and PN2), the other one has only one product PN3. For each supplier the product can either go through packaging plant and then to production plant or be directly transported to plant from supplier. The decision which way the product goes is based on transportation (TrCosts) and packaging costs (CrossDock or Repack) as well as on capacity restriction for direct supply arc. It means that direct supply is only allowed when product volume from supplier is big enough. It means that model in the first step model checks whether direct supply costs are lower than transportation costs through packaging plant. If the answer is "yes" then model checks whether supplier sends enough volume to satisfy minimum capacity restriction.
Problem looks the foolowing way:
PartNumber: set of string
Node: set of string
Arc: set of integer
Origin: array (Arc) of string
Destination: array (Arc) of string
Demand: array (Node,PartNumber) of real
CrossDockCosts: array (Arc,PartNumber) of real
TrCosts: array (Arc,PartNumber) of real
Repack: array (Arc,PartNumber) of real
MinCap: array (Arc) of real !minimum capasity restiction on each arc
flow: array (Arc,PartNumber) of mpvar !flow on each arc
forall(a in Arc, p in PartNumber) create(flow(a,p))
assert(sum(j in Node, p in PartNumber) Demand(j,p)=0) !check whether supply equals demand
!Flow conservation constraint
forall(j in Node, p in PartNumber)
ctrFlow(j,p):=sum(a in Arc | Origin(a)=j)flow(a,p)-sum(a in Arc | Destination(a)=j)flow(a,p)=Demand(j,p)
!Minimum capacity constraint
forall(a in Arc)
sum(p in PartNumber)flow(a,p)>=MinCap(a)
There are two problems with capacity constraint:
1. When transportation costs through packaging plant are lower than direct supply costs, everything (for example 80 cbm) should be sent through packaging plant. However model decides to sent 50 through direct arc and 30 through packaging plant. So I guess capacity constraint here is binding.
2. When direct supply costs are smaller than transportation through packaging plant, however supplier has less volume than allowed for direct supply, everything should be sent through packagiing plant. However, instead model is infeasible.
Could you please tell me what am I doing wrong? I amnew by Xpress.