Facility

Problem Statement

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.

Full example scenario

A company currently ships its product from 5 plants to 4 warehouses, and is considering closing one or more plants to reduce cost. Which plant(s) should the company close, in order to minimize transportation and fixed costs?

  • The demand for the warehouses 1-4 is 15, 18, 14 and 20 products respectively (per thousand).

  • The capacity for the plants 1-5 is 20, 22, 17, 19 and 18 products respectively (per thousand).

  • The fixed costs for the plants 1-5 is 12000, 15000, 17000, 13000 and 16000 respectively.

  • The transportation costs (per 1000 products) can be found in facility.csv, with the columns Warehouse,Plant 1,Plant 2,Plant 3,Plant 4,Plant 5.

What an optimal solution looks like

Which plant ships to which warehouse.

Plant 1 Plant 2 Plant 4 Plant 5

Plant 1

20 of 20 used

Plant 2

22 of 22 used

Plant 3

closed

Plant 4

19 of 19 used

Plant 5

6 of 18 used

14 6 14 8 1 18 6

Warehouse 1

demand 15

Warehouse 2

demand 18

Warehouse 3

demand 14

Warehouse 4

demand 20

Closed: Plant 3 · 17k capacity · $17,000 fixed cost avoided

Built with Modeler

The problem above is stated as a single shot: you hand over the whole problem and get a model back. Modeler takes the other route — you start with the business question you actually have, and it works with you until the problem is pinned down, the data is in, the code runs, and the answer holds up when the problem changes.

The tabs below walk the same facility problem through that route, one Modeler capability at a time.

Instead of writing the whole prompt up front, you start with the business question you actually have. Modeler searches the knowledge base, asks one clarifying question at a time — always the most important one first — and tells you which parts of the model are still missing. The options it offers come from examples in the knowledge base and from how similar problems are usually modeled in your industry, so you can answer with a number instead of prose.

A company currently ships its product from 5 plants to 4 warehouses. It is considering closing one or more plants to reduce cost.

The user is describing a facility location / plant closing optimization problem. Let me start by searching the knowledge base for relevant examples and ask clarifying questions one at a time. First, let me search the knowledge base for relevant information, and then ask the first clarifying question.

Querying the knowledge base.

Good, I found some relevant information about facility location problems. Now let me ask the first clarifying question to understand the business objective better.

Great, this is a classic facility location / plant closing optimization problem. I have found relevant examples in the knowledge base to guide the modelling. Let me ask you a few questions to build a complete specification.

Question 1: What is the primary business objective? For example:

  1. Minimize total cost (shipping costs + fixed operating costs of open plants)

  2. Minimize shipping costs only

  3. Minimize fixed costs only

  4. Another objective

Learn More:
• Facility Examples ★★☆
• facility_cs.cs ★★☆

Objective: Which plant(s) should the company close, in order to minimize transportation and fixed costs?

Constraints:

• The demand for the warehouses 1–4 is 15, 18, 14, 20 products respectively (per thousand)
• The capacity for the plants 1–5 is 20, 22, 17, 19, 18 products respectively (per thousand)
• The fixed costs for the plants 1–5 is 12000, 15000, 17000, 13000, 16000 respectively

That is option 1, plus the demand, capacity and fixed cost data. Recording the objective and the input entities in the specification. Still open: the transportation cost per lane, whether demand must be met exactly, and the output structure. Asking about demand satisfaction next, since it changes the constraint rather than just the data.

Recorded. The specification now has the objective and three input entities. Three things are still missing before I can implement anything:

• Data — transportation cost for each plant–warehouse lane (20 values). A file works best here.
• Constraint — whether each warehouse must receive exactly its demand, or at least its demand.
• Output — what you want back: the open/closed decision only, or the full shipment plan as well.

Question 2: Should each warehouse receive exactly its demand, or at least its demand?

  1. Exactly the demand — no excess inventory held at the warehouse

  2. At least the demand — overshipping is allowed

  3. Within a tolerance band around the demand

Learn More:
• Modeling Demand Satisfaction ★★★
• Facility Examples ★★☆

And I want the shipment plan too, not just which plants to close.

Thinking…

Modeler updates the specification after every answer, even while it is still incomplete — so you can always see what it has understood and what it is still waiting on.