Lawfare Academy

Business Analytics: Optimization and Simulation · Chapter 4 of 8

Model indivisibility, setup logic and valid bounds

Return to the linked course unit →

DEVELOPED COURSE TEXT

Model indivisibility, setup logic and valid bounds

Explain why rounding a linear optimum can fail

If Helix services are indivisible jobs, x and y must be integers. With original machine capacity 80, the continuous optimum(30,25)already is integral, so the integer optimum is the same. Change machine capacity to 81. The continuous solution becomes(30,25.5), value 1965. Rounding both quantities upward violates capacity; rounding down gives(30,25), value 1950, but a nearby alternative could in principle be better. Integer optimization requires checking feasible combinations or using a valid search method, not assuming a rounding rule proves optimality.
In this small record, enumeration of x from 0 to 30 and y from 0 to 40 verifies 1950 at(30,25). The continuous objective 1965 is an upper bound on the integer maximum because relaxing integrality enlarges the feasible set. A feasible integer value is a lower bound for maximization. Their 15 difference is a valid bound on the possible improvement before the enumeration certificate establishes the exact optimum.

Represent setup as a separate binary decision

Suppose serving any A requires an incremental setup paymentF. Introduce z_A in{0,1} and impose x≤30 z_A. The objective becomes 40 x+30 y-Fz_A. This linking constraint prevents positive A production without paying setup. The bound 30 is valid because of the actual A demand limit; using an enormous arbitrary constant weakens the relaxation and can worsen numerical performance. The model should not multiply two decision variables when a linear linking formulation represents the logic.
AtF=200, the best setup-on plan remains(30,25)with net 1750, while setup-off gives x 0, y 40, value 1200. Thus setup-on wins. AtF=800, the same setup-on net is 1150, below setup-off 1200, so do not activate A. The threshold isF=750 under these assumptions. This is a finite alternatives comparison; the fixed setup does not change A's marginal contribution conditional on activation.

Understand branch-and-bound as a proof process

A mixed-integer solver can solve a continuous relaxation to obtain a bound, then branch on a fractional variable to divide the feasible integer possibilities. Each branch adds restrictions; infeasible branches are discarded, and branches whose bound cannot improve the incumbent are pruned. The incumbent is the best feasible integer solution found. A reported optimality gap compares that incumbent with the best remaining bound, not with an unknown true optimum directly.
For a maximization problem, be explicit about sign conventions because many solvers minimize the negative objective. The supplied analysis uses SciPy's minimization interface for the LP and converts the objective/marginals back to the economic maximization convention. Integer enumeration is independent of that solver. A stopping status indicating a feasible incumbent with a nonzero gap is not the same as a proof of optimality. Report tolerances, time limits and the business materiality of the remaining bound.

Test logical constraints with adversarial examples

A formulation should be tested against plans that ought to be impossible. Can it produce A while z_A=0?Can it pay setup without production?The latter may be allowed but dominated when setup is positive; it is different from an invalid logical requirement. If a minimum run of 5 A is required when setup occurs, add x≥5 z_A. If exactly one of two incompatible technologies must be selected, define the binary selection relationship explicitly rather than hope cost minimization enforces it.
The advanced lesson is to connect every discrete rule to a feasible-set statement and a verification case. A smooth shadow price from the LP relaxation need not equal the value of one additional indivisible resource unit. Re-solve the integer model for a finite change. This distinction matters when jobs, machines, crews or contracts come in whole units, and it keeps the solver's approximation from becoming an unsupported operational promise.

Worked records

Record 1

Helix integer jobs, capacity 81 machine-hours. Continuous optimum(30,25.5), value 1965. Enumerated integer optimum(30,25), value 1950. Separate original-capacity setup model:x≤30 z_A, F=200 or 800.

Develop the reasoning

Enumeration checks every bounded integer pair and returns 1950. With setup 200, net 1750 exceeds all-B 1200. With setup 800, net 1150 is below 1200, so x 0, y 40, z_A 0. At setup 750 the two alternatives tie. These values use the original 80-hour setup comparison; the 81-hour integrality contrast is explicitly a separate changed-capacity example.

Progressive practice — optional

1. Foundation

Why is rounding(30,25.5)up infeasible?

Compare the worked reasoning

(30,26)uses 82 machine-hours, exceeding 81.

Change the record

Machine capacity rises to 82.

Compare the changed-record reasoning

(30,26)becomes feasible and earns 1980. Verify labor 86 and demand bounds before accepting it.

2. Application

Calculate setup-on and setup-off values atF=500.

Compare the worked reasoning

On 1950-500=1450; off 1200, so activate A.

Change the record

A minimum run 35 is required whenever setup is active, but demand remains at most 30.

Compare the changed-record reasoning

Setup-on becomes infeasible through 35 z_A≤x≤30 z_A. Choose setup-off if allowed; do not ignore the contradictory active-run condition.

3. Transfer

Does LP machine shadow 15 value every extra integer machine-hour?

Compare the worked reasoning

No. Discrete feasibility can make finite values uneven.

Change the record

Increase integer machine capacity 80→81→82 with all else fixed.

Compare the changed-record reasoning

Values are 1950,1950,1980, respectively. The first hour adds 0 and the second adds 30, while the continuous marginal value is 15 per hour over this range.

Sources and scope