Gnumeric · Workbook workflows · Intermediate
Solve an integer-constrained planning model
Solve a small mixed-integer-capable planning model and prove why rounding the continuous relaxation is not an acceptable substitute.
Documentation-qualified exercise; native application verification pending · Editorial standards
Select an integer-capable Solver algorithm, constrain the decision cells to nonnegative integers, and verify the returned plan against every resource limit. Solving a continuous model and rounding afterward is not the same optimization problem.
Scope and backend prerequisite
This exercise follows Gnumeric 1.12.62 GTK desktop source and the upstream 1.12 manual with English controls. It is documentation-qualified, not native-tested, and does not claim an installed 1.12.57 environment has the same working backend.
Before solving, check that the Algorithm list contains an available backend that supports linear mixed-integer problems. Solver availability depends on installed components. If the necessary backend is absent or unavailable, stop at model preparation; do not install software or substitute a nonlinear/continuous-only algorithm without a separately authorized setup process.
Build the integer model
In a disposable .gnumeric workbook enter:
| Cell | Meaning | Value or formula |
|---|---|---|
| B2 | Product X units | 0 |
| C2 | Product Y units | 0 |
| B4 | Contribution | =5*B2+4*C2 |
| B5 | Resource 1 used | =3*B2+2*C2 |
| C5 | Resource 1 limit | 11 |
| B6 | Resource 2 used | =B2+2*C2 |
| C6 | Resource 2 limit | 7 |
Each unit is indivisible. The objective is to maximize contribution, not revenue at any cost. Save the zero-production baseline before using Solver.
Configure the decision and constraints
- Choose Tools > Solver. On Parameters set Set Target Cell to B4, choose Max, and set By Changing Cells to B2:C2.
- On Model select Linear Model (LP/MILP). Enable Assume Non-Negative and Assume Integer (Discrete), since both variable cells share those requirements.
- Select the verified integer-capable Algorithm. Do not treat the model checkbox alone as proof the backend can execute it.
- On Constraints add B5 <= C5 and B6 <= C6 using Left Hand Side, Type and Right Hand Side, clicking Add for each.
- Review the complete list, then click Solve. Inspect Solver Status, Problem Status and Objective Value before accepting the plan as optimal.
Expected optimum: X=3, Y=1, objective 19. Resource use is 11 and 5, both within limits. Neither decision value may be fractional or negative. If the run stops at a time or iteration limit without proving optimality, report that status rather than calling the current values the optimum.
Check independently
Resource 2 restricts Y to at most 3 whole units. For each feasible Y, choose the greatest feasible nonnegative X:
| Y | Best feasible X | Contribution |
|---|---|---|
| 0 | 3 | 15 |
| 1 | 3 | 19 |
| 2 | 2 | 18 |
| 3 | 1 | 17 |
This finite enumeration proves the 19 result for the small fixture. The continuous relaxation instead has X=2, Y=2.5, objective 20. Rounding Y down gives contribution 18, below the true integer optimum; rounding it up makes resource use 12 and 8, exceeding both limits. A rounded continuous solution is therefore either inferior or infeasible here.
Change a constraint and solve again
Change C5 from 11 to 12, leaving C6=7. Rerun the same integer model. Expected optimum becomes X=4, Y=0 with contribution 20; resource use is 12 and 4. Check the constraint references still point to C5 and C6 rather than hard-coded old limits.
Restore C5=11 and rerun for the final 3/1 plan. Save the workbook with a short note identifying the objective, integer assumptions, algorithm and solver status. Close and reopen and verify decision values and resource formulas. Do not assume that saved values prove a future installation has the same backend.
Recover safely
If results violate constraints, preserve the baseline and inspect model type, algorithm support, variable range and inequality direction. Do not delete a constraint just to obtain a success message. If backend execution fails, the independently enumerated fixture remains a check, not a claim that Solver ran.
Official references
Gnumeric Solver manual, captured 20 October 2026; official 1.12.62 source archive, solver.ui. No backend installation or native Solver execution is claimed.