I am working on a problem where the model has to find optimal locations and optimal capacity for this locations in multi time period problem.

So if a facility is chosen to be built at a location then the model has to assign a capacity to it and shouldn't be allowed to change it in a next time period.

Building facility and capacity does come with cost, as well ass operating a facility and capacity.

I chose to use a binary variable y(a,t) to set a facility at location a open in time period t (=1) or not (=0).

Then I first used a quadratic formulation with c(a) the capacity at location a. In this way the capacity cost only occur if y(a,t)=1 (so when the facility is open in time period t) but this results in to much solution time.

Then I tried to use condition in the constraint and let capacity be denoted by c(a,t). so something like: if y(a,t)=0 then c(a,t) =0; elif (y(a,t-1)=0 and y(a,t)=1) then c(a,t) >0; else c(a,t)=c(a,t-1), but Xpress apparently can't use logical operators in the constraints.

Then to solve it I chose to decompose it, first solve the uncapacitated facility location problem and then fix the location and solve the capacity problem.

I read the white paper "Multiple models and parallel solving with Mosel" but couldn't really find out how to tackle such a problem. I was planning to use mpproblem, because the problem can be solved in sequence and it seems to be more easier then to use mmjobs.

Can somebody help me with this problem and thereby give me a wonderful Christmas present?

Kind Regards and a healthy 2016,

Rob Nijland

A typical formulation for such capacitated facility location problems is the following:

forall(a in A, t in T) c(a,t) <= C(a)*y(a,t)

where C(a) is some maximum limit value for each facility. Please take a look at this example that shows several cases: FICO Xpress Examples Repository: Coco - The Coco productional planning problem

You can replace these so-called bigM constraints by the following indicator constraints:

forall(a in A, t in T) indicator(-1, y(a,t), c(a,t)<=0)

Now, your logic expression " if y(a,t)=0 then c(a,t) =0; elif (y(a,t-1)=0 and y(a,t)=1) then c(a,t) >0; else c(a,t)=c(a,t-1)" seems to express the relation "once open, then always open with constant (but not predetermined) capacity|cost", which could be stated as follows:

forall(a in A, t in T | t>1) c(a,t-1)<=c(a,t)

forall(a in A, t in T | t>1) y(a,t-1)<=y(a,t)

forall(a in A, t in T | t>1) indicator(1,y(a,t-1), c(a,t-1)>=c(a,t))

Or alternatively, you could switch to using logic constraints by replacing the statement ' uses "mmxprs" ' by ' uses "advmod" ' at the start of your model':

forall(a in A, t in T | t>1) do

implies(y(a,t-1)=0 and y(a,t)=1, c(a,t) >= EPS)

implies(y(a,t-1)=1 or y(a,t)=0, c(a,t)=c(a,t-1))

end-do

Please note that all the formulation options above (including when using logic constraints) result in linear mixed-integer models.