Simple facility location model: given a set of plants and a set of warehouses, with transportation costs between them, this example finds the least expensive set of plants to open in order to satisfy product demand. This example demonstrates the use of MIP starts — the example computes an initial, heuristic solution and passes that solution to the MIP solver.
Aim to minimize the combined fixed and transportation costs by deciding which of five plants to keep open while satisfying four warehouses’ demands.
By considering data Gather input data: plant capacities, fixed opening costs, warehouse demands, and per-unit transport costs.
-
Binary “open” variables for each plant
-
Continuous “transport” variables for shipments from plants to warehouses
-
Objective: minimize fixed costs + transport costs
-
Each warehouse’s demand must be exactly met
-
Shipments from a plant cannot exceed its capacity if it’s open
-
Provide a warm start by closing the highest-cost plant initially.
-
Solve the model with an MIP solver (e.g., Gurobi) and inspect the solution.
Total minimum cost: $210,500
Closed plant: 2
Open plants and shipping plan:
Plant 0 → Warehouse 2 (14k), Warehouse 3 (6k)
Plant 1 → Warehouse 0 (14k), Warehouse 3 (8k)
Plant 3 → Warehouse 0 (1k), Warehouse 1 (18k)
Plant 4 → Warehouse 3 (6k)