Facility location problems are often solved as
integer programs. In this context, facility location problems are often posed as follows: suppose there are n facilities and m customers. We wish to choose (1) which of the n facilities to open, and (2) which (open) facilities to use to supply the m customers, in order to satisfy some fixed demand at minimum cost. We introduce the following notation: let f_i denote the (fixed) cost of opening facility i, for i=1,\dots,n. Let c_{ij}denote the cost to ship a product from facility i to customer j for i=1,\dots,n and j=1,\dots,m. Let d_j denote the demand of customer j for j=1,\dots,m. Further suppose that each facility has a maximum output. Let u_i denote the maximum amount of product that can be produced by facility i, that is, let u_i denote the
capacity of facility i. The remainder of this section follows.
Capacitated facility location In our initial formulation, introduce a binary variable x_i for i=1,\dots,n, where x_i=1 if facility i is open, and x_i=0 otherwise. Further introduce the variable y_{ij} for i=1,\dots,n and j=1,\dots,m which represents the fraction of the demand d_j filled by facility i. The so-called
capacitated facility location problem is then given by\begin{array}{rl} \min & \displaystyle\sum_{i=1}^n\sum_{j=1}^mc_{ij} d_j y_{ij}+\sum_{i=1}^nf_ix_i \\ \text{s.t.} & \displaystyle\sum_{i=1}^ny_{ij}=1 \text{ for all }j=1,\dots,m \\ & \displaystyle \sum_{j=1}^md_jy_{ij}\leqslant u_ix_i\text{ for all }i=1\dots,n \\ &y_{ij}\geqslant0\text{ for all }i=1,\dots,n \text{ and }j=1,\dots,m\\ &x_i\in\{0,1\}\text{ for all } i=1,\dots,n \end{array} Note that the second set of constraints ensures that if x_i=0, that is, facility i isn't open, then y_{ij}=0 for all j, that is, no demand for any customer can be filled from facility i.
Uncapacitated facility location A common case of the capacitated facility location problem above is the case when u_i=+\infty for all i=1,\dots,n. In this case, it is always optimal to satisfy all of the demand from customer j from the nearest open facility. Because of this, we may replace the continuous variables y_{ij} from above with the
binary variables z_{ij}, where z_{ij}=1 if customer j is supplied by facility i, and z_{ij}=0 otherwise. The
uncapacitated facility location problem is then given by\begin{array}{rl} \min & \displaystyle\sum_{i=1}^n\sum_{j=1}^mc_{ij} d_j z_{ij}+\sum_{i=1}^nf_ix_i \\ \text{s.t.} & \displaystyle\sum_{i=1}^nz_{ij}=1 \text{ for all }j=1,\dots,m \\ & \displaystyle \sum_{j=1}^mz_{ij}\leqslant Mx_i\text{ for all }i=1\dots,n \\ &z_{ij}\in\{0,1\}\text{ for all }i=1,\dots,n \text{ and }j=1,\dots,m\\ &x_i\in\{0,1\}\text{ for all } i=1,\dots,n \end{array} where M is a constant chosen to be suitably large. The choice of M can affect computation results—the best choice in this instance is obvious: take M=m. Then, if x_i=1, any choice of the z_{ij} will satisfy the second set of constraints. Another formulation possibility for the uncapacitated facility location problem is to
disaggregate the capacity constraints (the big-M constraints). That is, replace the constraints\sum_{j=1}^{m}z_{ij}\leqslant Mx_i\text{ for all }i=1,\dots,nwith the constraintsz_{ij}\leqslant x_i\text{ for all }i=1,\dots,n \text{ and }j=1,\dots,mIn practice, this new formulation performs significantly better, in the sense that it has a tighter
linear programming relaxation than the first formulation. ==Applications==