AnsweredAssumed Answered

Trying to identify the source of problem in Xpress

Question asked by Nadine.E on Aug 10, 2016
Latest reply on Aug 16, 2016 by Nadine.E

I am currently trying to solve a problem based on Minimum Cost Flow Problem.


In short, there are two suppliers (L1 and L2), supplier L1 has 2 products (A and B), the other has only one product C. For each supplier the product can either go through packaging and then to plant or be directly transported to plant. The decision which way the product goes is based on transportation and packaging costs. Problem looks the foolowing way:


PartNumber: set of string  
nArc: integer
Node: set of string
Arc: set of integer

Origin: array (Arc) of string
Destination: array (Arc) of string
Demand: array (Node,PartNumber) of real      
PackCosts: array (Arc,PartNumber) of real 
TrCosts: array (Arc,PartNumber) of real
MinCap: array (Arc) of real   

Decision variables
flow: array (Arc,PartNumber) of mpvar 

TotalCosts: linctr




Flow conservation constraint
forall(j in Node, p in PartNumber)
ctrFlow(j):=sum(a in Arc | Destination(a)=j)flow(a,p)-sum(a in Arc | Origin(a)=j)flow(a,p)=Demand(j,p)


TranspCosts:= sum(a in Arc, p in PartNumber)TrCosts(a,p)*flow(a,p)
PackagingCosts:= sum(a in Arc, p in PartNumber)PackCosts(a,p)*flow(a,p)


minimize (TotalCosts)


Everything seems ok, however the solution is infeasible (all flow are zero) and I cannot find the error. It may be either the data structure (screenshot is attached) or the flow conservation constraint. Can somebody please help me to identify the sourse of error? I am kind of new with Xpress.