# how to decompose a problem

Question asked by robnijland@hotmail.nl on Dec 23, 2015
Latest reply on Jan 5, 2016 by Susanne.Heip

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