Advanced maths

Robust linear programming calculator with budgeted coefficient uncertainty

Solve a linear program protected against row-wise budgeted coefficient deviations, reporting worst-case row consumption and an adversarial witness.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Solve a linear program protected against row-wise budgeted coefficient deviations, reporting worst-case row consumption and an adversarial witness.

THE FORMULAWorst row value = aᵀx+max{Σ d_j|x_j|u_j: 0≤u_j≤1, Σu_j≤Γ}; sort d_j|x_j| and take floor(Γ) full terms plus its fractional remainder.

A worked example

Minimize -x-y with x,y∈[0,10] and nominal x+y≤10, deviations 1/2 each, Gamma=1. The robust constraint is x+y+0.5max(x,y)≤10; the optimum is x=y=4 and objective -8.

Good to know

One to four bounded decision variables and at most six uncertain inequality rows, with rational nominal data, nonnegative deviations and row budgets0≤Gamma≤n. Exact rational robust-counterpart LP with explicit handling of signed variables and at most a bounded auxiliary model. Return nominal/worst-case row values and an adversarial coefficient witness. No correlation inferred, chance-constraint interpretation, adjustable robust decisions or integer robust extension as a second page.

Describe uncertainty row by row

Each constraint row contains nominal coefficients, nonnegative deviation magnitudes, a right-hand side and an uncertainty budget Gamma. A coefficient can move in either direction within its deviation interval, but the normalized absolute deviations share the row budget. Gamma ranges from zero to the number of variables, including fractional values between whole numbers.

The model minimizes a fixed linear objective subject to finite variable bounds and all robust rows. Uncertainty is attached to constraint coefficients, not automatically to the objective or right-hand side. Each row has its own adversarial choice. The input does not infer correlations between rows or observations, and the budget is an explicit uncertainty-set modeling choice rather than an estimated probability.

The budget chooses the largest adverse contributionsWorst-case row consumptionNominal: 8+ 210Γ = 1: activate one adverse coefficientTie: either deviation witness is validx = 4, y = 4; objective = −8
Scroll across to see the full diagram.
At x=y=4, nominal consumption eight plus adverse deviation two reaches the bound ten.

Compare this with the Linear and mixed integer programming calculator from constraints. Builds and solves the Bertsimas–Sim robust counterpart from nominal coefficients, deviation bounds and row-wise uncertainty budgets. Existing LP accepts one deterministic coefficient table and has no adversarial uncertainty-set input or worst-case feasibility witness.

Understand why absolute values are essential

For a fixed decision x, the adversary chooses each coefficient sign to increase the row’s left-hand side. Its beneficial contribution is deviation times the absolute value of x. A negative decision does not eliminate uncertainty: the adversary can decrease that coefficient, making its product with the negative decision more positive. Omitting absolute values would understate worst-case consumption.

Sort those nonnegative contributions from largest to smallest. A whole budget unit activates the next largest contribution fully, and any fractional remainder activates the following contribution partially. This is a small continuous knapsack calculation. It gives both the worst-case row value and a concrete admissible coefficient scenario that attains it, allowing the robustness claim to be checked directly at the returned decision.

Formulate the robust counterpart correctly

The support function of the budgeted uncertainty set has a linear-programming dual. Introduce a nonnegative threshold variable and nonnegative excess variables for each row, together with an epigraph for absolute decision values when signs are not fixed by bounds. The resulting finite rational LP enforces the worst-case row value without enumerating every coefficient scenario.

Exact arithmetic applies to the stated rational model after the counterpart is built. Fraction growth, LP work limits and any bounded auxiliary-model restrictions still matter. A cap must not be reported as optimality or infeasibility. The output should include the original decision variables and robust row witnesses so the extra optimization variables do not obscure what was actually protected.

Check the balanced default decision

The default uncertainty contributions are x/2 and y/2 because both decisions are nonnegative. With Gamma equal to one, the larger contribution is added to the nominal sum. Write s=x+y. Since max(x,y)≥s/2, the robust constraint implies s+s/4≤10, hence s≤8. This is a direct upper bound on the quantity being maximized.

At x=y=4, the nominal row value is eight and the worst-case extra consumption is two. The robust row is exactly ten, so the upper bound is attained and the minimum objective is minus eight. One adversarial witness changes the first coefficient from one to one and one half, leaving the other unchanged. A tie permits another equally valid witness; it does not make the robust objective ambiguous.

Read the uncertainty-budget graphic

The illustration separates nominal consumption from added protection and shows a full deviation allocation plus a fractional allocation when Gamma is not an integer. The tallest weighted contributions are selected first. Their ranking depends on the returned decision vector, so a fixed coefficient deviation with a small decision magnitude can matter less than a smaller deviation multiplied by a large decision.

Gamma zero removes coefficient protection and recovers the nominal row. Gamma equal to the variable count allows every coefficient to reach its adverse endpoint, producing the full interval-box model. Intermediate values limit simultaneous adverse movement. This interpolation controls conservatism within the chosen uncertainty set; it does not by itself assign a confidence level or guarantee a particular observed violation frequency.

Validate signed and fractional cases

A useful independent test uses a negative decision, because a nonnegative-only implementation can accidentally pass balanced examples while mishandling signs. Another test uses a fractional Gamma and verifies that exactly the allowed fractional amount is assigned after the full contributions. Tied contributions should produce the same worst-case value even if the chosen witness allocation differs.

The calculator supports one through four bounded variables and at most six uncertain rows with rational coefficients. It does not create integer robust optimization as a separate extension or allow a decision to adapt after uncertainty is realized. The returned x is fixed before the adversary moves. Adjustable policies would be a different model with a different feasible set and additional nonanticipativity questions.

Use robustness as an explicit design assumption

A robust solution is feasible for every coefficient vector in the declared uncertainty sets. If real deviations fall outside those sets, the mathematical protection does not apply. Conversely, an overly broad set can sacrifice objective performance for combinations that are physically implausible. Choose deviations and budgets from a defensible application model, then compare nominal and worst-case results.

Save the rational inputs, Gamma values and adversarial witnesses together. A generic deterministic LP result cannot tell a reader what uncertainty was protected against, while a robust objective alone can hide the cost of conservatism. This page makes that uncertainty set and its row-level consequences visible, leaving probability calibration, data estimation and cross-row correlation modeling to a separate analysis.

A few questions, answered

Is Gamma a probability?

No. It limits simultaneous normalized coefficient deviations in the chosen uncertainty set.

Are negative decisions supported?

Yes. Worst-case contributions use deviation times absolute decision value.

What does Gamma zero do?

It recovers the nominal constraint without coefficient protection.

Can two witnesses differ?

Yes. Tied weighted deviations can yield several equally adverse coefficient scenarios.

Find your calculator

Start typing to explore the library.