Modelling a Capacitated Facility Location Problem in such a way that a few candidate locations are always selected

I am trying to model a MIP for a Capacitated Facility Location problem in a way that a number of selected candidate locations will always be there. How can I model it?

My approach:

Add a cost parameter which will be 0 for the selected candidate locations and it will take some values (depending on the problem) for all the other candidate locations. This will gravitate the model towards having the desired candidate locations in the solutions but it might not scale properly.

• Why not add constraints $x_i = 1, \forall i \in \{candidates~that~should~be~opened\}$. Commented Nov 4, 2022 at 12:19
• Yes, I think the other solutions are overthinking it... As long as there are big M constraints and no other constraints that would make the problem infeasible Commented Nov 5, 2022 at 3:21
• @PenghuiGuo the solution provided by Sutanu is the same as yours, no? Commented Nov 7, 2022 at 4:37
• @Shibaprasadb If you want certain number of facility to be opened, use Shibaprasadb's; If you want certain set of facilities to be opened, use mine. Commented Nov 7, 2022 at 9:30
• @PenghuiGuo Thanks. I used your solution but in some instances, it is not giving me the proper answer. Like one or more desired facilities are not getting selected. Any idea why that may happen? I am coding in R with the ompr package. Commented Nov 14, 2022 at 9:04

I assume that you have some sort of "solver" for solving a capacitated facility location problem, which you want to utilize.

If you need a specific facility, say facility $$\tilde{i}$$, to be open, it may not be enough to set the opening cost for that facility to zero, as you may still have $$x_{\tilde{i}}=0$$ in an optimal solution. What you can do is to add a dummy customer $$j'$$ with an assignment cost of $$c_{\tilde{i}j'}=0$$ and a demand of $$d_{j'}=0$$. The remaining assignment costs should be $$c_{ij'}=\infty$$ for all other facilities. Given assignment constraints requiring to assign all customers, this will force the facility $$\tilde{i}$$ to be open in any optimal solution.

• Thanks. Yes, I am using symphony in R. One doubt about this approach: The infinity and the 0 conditions, wouldn't that force the model to have only those set of facility locations? Commented Nov 14, 2022 at 10:29
• @Shibaprasadb No, it might still be cheaper to open another facility and and service all customers from that, than from the set of facilities you want to open. But if you want to solve a "facility location" problem, where you have decided on the facilities beforehand, you are not really solving a facility location problem. Then you are solving some kind of allocation/assignment/transportation problem instead
– Sune
Commented Nov 14, 2022 at 12:39

$$\sum{x_i} = N$$
where N is desired number of locations and x is binary, i is index of candidates

• I suspect $\sum_i x_i \ge N$ would be more appropriate.
– prubin
Commented Nov 4, 2022 at 15:45
• @prubin depends on the context of the problem, i guess Commented Nov 5, 2022 at 3:23
• A bit confused here, how will the >= and = differ? @overboxed Commented Nov 8, 2022 at 6:02