A retailer is planning its distribution network. There are a handful of candidate sites for warehouses, each with an annual fixed cost if it is opened, and a set of stores that must each be supplied from some open warehouse. Opening more warehouses brings them closer to the stores and lowers transport cost, but every extra site adds a fixed cost. Which sites should be opened, and which store should each one serve?
This is the facility location problem. It is the natural next step after the transportation problem: once the network itself is a decision, we need binary variables for the open-or-closed choices, and the model becomes a mixed-integer program. It is also the standard textbook example of a lesson that applies to all of integer programming — two formulations with exactly the same integer solutions can have very different LP relaxations, and the difference decides whether the model solves in a second or not at all.
The decision
We have candidate sites indexed by and customers indexed by .
- Opening site costs , regardless of how much it handles.
- Serving the whole demand of customer from site costs . Typically , the customer's demand times a unit transport cost, but any non-negative cost will do.
In the uncapacitated version an open site can serve any number of customers. The decision has two layers: which sites to open, and an assignment of customers to open sites. Once the set of open sites is fixed, the second layer is trivial — each customer goes to its cheapest open site — so all the difficulty lies in choosing the set.
Formulation
Let equal if site is opened, and let be the fraction of customer 's demand served from site .
The objective adds the fixed costs of the open sites to the cost of serving the customers. The assignment constraints say that each customer's demand is met in full. The linking constraints say that a customer can be served from site only if that site is open: when they force , and when they are slack. There is no need to declare binary — for fixed , an optimal solution puts each customer entirely on its cheapest open site anyway.
Weak and strong formulations
The linking constraints can be replaced by just constraints, one per site:
This aggregated (or weak) form is obtained by adding up the disaggregated constraints over . It is still a correct model: if the left-hand side must be zero, and if the constraint is slack because at most customers exist. The two formulations have exactly the same set of integer solutions.
Their LP relaxations, obtained by replacing with , are very different. In the weak relaxation it is enough to open site to the extent , the fraction of customers it serves. A site serving one customer out of five need only be "one-fifth open" and pays one-fifth of its fixed cost. In the strong relaxation, serving even one customer fully forces .
Every point feasible for the strong LP relaxation is feasible for the weak one, but not conversely. Hence the strong LP bound is always at least as large as the weak one, and it is usually much larger. In practice the strong relaxation of the uncapacitated problem is often integral, or very nearly so.
The bound matters because branch and bound prunes a node only when its LP bound is no better than the best known solution. A weak bound means a large gap, little pruning, and an exponentially large search tree. Having more constraints is not a drawback here: modern LP solvers handle the linking constraints easily, and the tighter polyhedron more than pays for them.
The capacitated variant
If site can handle at most units and customer demands units, we add
This constraint also links and , but it does not replace the disaggregated constraints: keeping alongside it still tightens the relaxation. With capacities, a customer may be split between sites (if is continuous), or single sourcing can be required by declaring , which makes the problem considerably harder.
The p-median problem
Sometimes the number of facilities is fixed by policy or budget rather than priced through fixed costs. The p-median problem drops the fixed-cost term and adds a cardinality constraint:
Here is usually demand-weighted distance, so the objective is total (equivalently, average) distance travelled. It is the classical model for siting public services such as clinics or fire stations.
Solution methods
The uncapacitated problem is NP-hard, but instances with hundreds of sites and thousands of customers are routinely solved to optimality.
Branch and bound. Solve the strong LP relaxation; if some is fractional, branch on it ( in one child, in the other) and continue. Because the strong bound is so tight, the tree is typically small. Commercial and open-source MIP solvers add cutting planes and presolve on top.
Lagrangian relaxation. Move the assignment constraints into the objective with multipliers :
The problem now separates by site. For each , if site is open it serves exactly the customers with negative, so it is worth opening when
Each evaluation of is therefore trivial, and is a lower bound for every . Maximizing it over (by subgradient optimization, say) gives the Lagrangian dual bound, which for this relaxation equals the strong LP bound. The subproblem solutions also suggest which sites to open, and are easily repaired into feasible solutions — a useful source of good upper bounds.
Heuristics. For very large instances, or inside other algorithms, simple heuristics are effective:
- Greedy (add): start with no sites open; repeatedly open the site that reduces total cost the most; stop when no addition helps.
- Drop: start with all sites open and repeatedly close the site whose closure saves the most.
- Interchange (local search): from any solution, try opening one site, closing one site, or swapping an open site for a closed one; accept any improving move and repeat until none exists.
The heuristics give no guarantee of optimality on their own, but combined with a Lagrangian or LP lower bound they come with a certificate of how far from optimal they can be.
Worked example
Fixed costs and service costs are:
| Fixed cost | ||||||
|---|---|---|---|---|---|---|
| Site | 4 | 9 | 14 | 18 | 22 | 8 |
| Site | 12 | 5 | 6 | 11 | 15 | 10 |
| Site | 20 | 15 | 9 | 4 | 6 | 12 |
With three sites there are only seven non-empty sets to open, so we can enumerate them. For each set, every customer is assigned to its cheapest open site:
| Open sites | Fixed cost | Service cost | Total |
|---|---|---|---|
| 8 | 67 | 75 | |
| 10 | 49 | 59 | |
| 12 | 54 | 66 | |
| 18 | 41 | 59 | |
| 20 | 32 | 52 | |
| 22 | 33 | 55 | |
| 30 | 25 | 55 |
The optimum opens and , with serving and serving , at total cost .
The two LP relaxations. The strong LP relaxation has optimal value and its optimal solution is exactly the integer optimum : the relaxation alone solves the problem, with no branching.
The weak LP relaxation has optimal value . In it each site is opened only fractionally, in proportion to the customers it serves, so serving customer from site effectively costs . With , each customer picks its cheapest site, giving and cost
The weak bound leaves a gap of , which branch and bound would have to close by branching.
The greedy heuristic. Greedy first opens the best single site, (cost ). Adding lowers the cost to , and adding to that does not help ( again), so greedy stops at with cost . One interchange move — swap for — reaches the optimum . Greedy was misled by its first choice: is the best site on its own, but not part of the best pair.
p-median. Dropping fixed costs and requiring open sites, the best pair is again , with service cost ; for it is , with service cost .
The example is small, but the pattern is typical. The weak relaxation rewards "spreading thin" across many partly open sites; the strong one does not. When writing any MIP with big- or aggregated linking constraints, it is worth asking whether a disaggregated version is available.
Extensions
Real network design models build on this core in several directions:
- Multi-echelon networks. Plants supply warehouses, which supply stores; both layers may be located, and flows between them are transportation problems.
- Multiple products and modes. Different products share sites but have different demand patterns and transport costs.
- Dynamic location. Sites are opened and closed over a planning horizon as demand evolves, with costs for changing the network.
- Uncertainty. Demand and costs are uncertain when sites are chosen, but assignments can adapt once they are known — a natural two-stage stochastic program.
- Covering models. Instead of minimizing cost, require every customer to be within a given distance or time of an open site (set covering), or cover as much demand as possible with sites (maximal covering). These are common for emergency services.
Further reading: Daskin, Network and Discrete Location; Wolsey, Integer Programming, for the role of formulation strength; and Laporte, Nickel and Saldanha da Gama (eds.), Location Science.