Sub topic 8
Writing Constraints and Bounds That Reflect the Business
Assume you can write Excel formulas, use absolute and relative cell references, and read basic income statements and cash-flow models. This chapter focuses on translating business rules into Solver constraints.
A Solver model has three parts:
- The objective cell measures what you want to maximize, minimize, or set to a target.
- The variable cells are the decisions Solver may change.
- The constraints limit those decisions to feasible business choices.
A constraint is a rule that must remain true. A bound is a simple upper or lower limit on one variable.
Turn business rules into equations
Suppose a factory makes products X and Y. Each unit uses machine hours, and each product has a profit contribution.
| Item | Product X | Product Y | Limit |
|---|---|---|---|
| Profit per unit | 20 | 30 | Maximize |
| Machine hours per unit | 2 | 4 | 100 hours |
| Demand limit | 30 | 25 | Product-specific |
Let x represent units of Product X and y represent units of Product Y. The business rules become:
- Profit objective:
20x + 30y - Machine capacity:
2x + 4y <= 100 - Demand for X:
x <= 30 - Demand for Y:
y <= 25 - Production cannot be negative:
x >= 0,y >= 0
In Excel, the objective formula could be:
=20*B2+30*B2In a real model, keep the decision cells separate. For example, put units of X in B2, units of Y in C2, and use:
=20*B2+30*C2Put resource usage in another formula cell:
=2*B2+4*C2Solver can then compare this formula with the 100-hour capacity.
Separate limits from relationships
Some constraints limit a value directly:
- Debt balance
<=borrowing capacity - Marketing spend
<=approved budget - Production
<=available demand - Cash withdrawal
>=minimum liquidity reserve
Other constraints link two or more variables. For example, a funding plan might require debt to remain 40% or less of total funding:
Debt <= 0.40 × (Debt + Equity)
A capital allocation rule might require investment in Project A to be at least twice investment in Project B:
A >= 2 × B
These relationships should be written as formulas in the worksheet. Solver should constrain the formula cells, rather than relying on a rule that exists only in a note or on a separate worksheet.
Choose the correct constraint type
Use <= when the result must not exceed a limit, such as capacity or budget. Use >= when the result must meet a minimum, such as a cash reserve or service level. Use = for an exact balance, such as a funding plan that must total 10 million dollars.
Use integer constraints when fractional decisions are impossible. A machine count, employee count, or loan count may need to be a whole number. Use binary constraints when a decision is yes-or-no, such as whether to open a facility.
Bounds also prevent unrealistic mathematical solutions. If Solver is allowed to choose negative production, it may increase the reported profit by using negative units to reduce costs elsewhere. Add nonnegative bounds unless negative values have a real business meaning.
Test constraints before solving
Review each constraint with a plain-language question:
- What business rule does this represent?
- Which cell calculates the quantity being limited?
- Are both sides expressed in the same units?
- Should the rule use
<=,>=, or=? - Can the rule be violated slightly, or must it be exact?
- Does the rule apply to every period or only to the total?
After Solver returns a result, calculate the remaining capacity or slack, which is the unused amount. For a 100-hour limit and 92 hours used, slack is 8 hours. A negative slack indicates a modeling or constraint error.
Exercise
A portfolio must invest at least 30% in bonds, no more than 50% in equities, and exactly 100% overall. What Solver constraints should you use if bond allocation is in B2 and equity allocation is in C2?
Show answer
Use B2>=30%, C2<=50%, and B2+C2=100%. Add B2>=0% and C2>=0% unless the model already enforces these bounds.