This example introduces a small business question: limited capacity and demand to meet at minimum cost.Documentation Index
Fetch the complete documentation index at: https://feasible-1447f9c5.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The problem
A small bakery plans production over the next four weeks. They make three products: bread, croissants, and cakes. Each product takes a known number of oven-hours per batch and faces a forecasted weekly demand. Anything baked but not sold this week can be carried into next week, but storage costs money.| Product | Oven-hours per batch |
|---|---|
| Bread | 1.0 |
| Croissants | 1.5 |
| Cakes | 2.0 |
| Week | Bread | Croissants | Cakes |
|---|---|---|---|
| 1 | 20 | 12 | 8 |
| 2 | 18 | 15 | 10 |
| 3 | 22 | 23 | 9 |
| 4 | 25 | 18 | 20 |
What you do
Paste the problem into Feasible. You don’t need to give any modeling hints — try it cold, then read what the agent built. For convenience, here’s the problem as dm formatted textBakery problem
Shared workflow: open in Feasible.
What happens
The agent’s standard form will look roughly like this:- Decision variables.
produce[p, t]— integer batches of productpin weekt.inventory[p, t]— batches of productpcarried at end of weekt.
- Constraints.
- Inventory balance, per product per week:
inventory[p, t-1] + produce[p, t] = demand[p, t] + inventory[p, t]. Starting inventory is zero. - Oven capacity, per week:
sum over p of hours[p] * produce[p, t] <= 80. - Non-negativity and integrality on production and inventory.
- Inventory balance, per product per week:
- Objective. Minimize
sum of 2 * inventory[p,t]over allp, t.- Note that the
2here is unneccessary for finding the optimal solution: minimizingxis the same as minimizing2x. However, the choosing the factor 2 means that the objective value corresponts to the inventory cost.
- Note that the
HiGHS as solver.
And for a tiny problem like this, it will solve the problem in a few milliseconds.
The most important information from the solver result are:
- The status (
OPTIMALif the problem was formulated correctly) - The objective value, which is the numeric value of the Objective at the found solution. In this case, the value tells you the expected inventory cost.
- The variable values, which tell you how much to produce in each period.
- Produce 13 cakes in week 2
- Produce 12 cakes in week 3
- Produce 14 cakes in week 4
- Produce 19 bread in week 2
- Produce 21 bread in week 3
- Produce exactly the demand in all other weeks
There are several optimal solutions to this problem that result in the same holding cost.
Common is that in total, 10 batches will have to be carried from one week to the next.
Things to notice
- The structure is multi-period: The agent links weeks together via the inventory-balance equation. Watch how the Constraints panel groups these.
- Self-evaluation: Because there’s a quantitative objective, Feasible can sanity-check things like “is the total equal to the sum of holding cost?” and “does inventory + production cover demand each week?” You see this in the Evaluation panel.
- Solver logs: The raw output from the solver is displayed in a special card on the right.
Using the result
You can download the results asjson, which contain the values of all optimization variables in machine-readable format.
This is the loop that makes Feasible useful for non-trivial problems: you and the agent converge on a model together. The Using Feasible section covers this loop in more depth.
