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:

**Sets**

PartNumber: set of string

nArc: integer

Node: set of string

Arc: set of integer

**Parameters **

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

Arc:=1..nArc

**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)

TotalCosts:=TranspCosts+PackagingCosts

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.

Thanks!

The error message E-1013 usually appears if you have a constraint that only contains constant terms, typically if you have an empty sum over decision variables that is treated as 0, and some non-zero RHS value. You should check whether your decision variables have been created correctly, you could for example display the size of the array:

writeln(flow.size)

See for example http://examples.xpress.fico.com/example.pl?id=mosel_book_7_1 on the topic of decision variable creation.