How this calculation works
Solve a small linear leader–follower optimization problem under the optimistic convention using exact complementarity-pattern enumeration.
Minimize F(x,y) subject to leader constraints and y in argmin_u{cᵀu: B u≤d-Ax, follower bounds}. Optimistic selection chooses the leader-favorable follower optimum.A worked example
Minimize x-2y with 0≤x≤2, 0≤y≤3, and follower minimizing -y under y≤x+1. The response is y=x+1, and the leader optimum is x=2,y=3 with objective -4.
Good to know
One or two leader variables and one or two follower variables with finite rational bounds, at most eight lower-level inequality rows including follower bounds, and up to six leader constraints. Fixed linear follower objective. Exact complementarity-pattern enumeration plus rational LP solves, avoiding arbitrary big-M constants. The optimistic convention selects the leader-favorable follower optimum. No pessimistic or nonlinear follower model; full global-optimum claims require every pattern resolved.
Separate the leader and follower decisions
The leader controls x and chooses first. The follower controls y and solves a linear program after observing x. The leader objective can depend on both vectors, while the follower objective is a fixed linear function of y. Rows contain separate coefficient vectors for x and y and use the common less-than-or-equal right-hand-side convention.
The page supports one or two variables at each level, with finite rational bounds. Leader rows constrain the final pair, while follower rows define the follower’s feasible choices for a fixed x. This distinction matters: a leader-only restriction must not be accidentally included in the follower feasible set, and a follower constraint must not lose its optimization role by being treated merely as another joint feasibility row.
Compare this with the Linear and mixed integer programming calculator from constraints. Solves a leader decision constrained by the follower being an LP optimizer. The follower response restriction creates a hierarchical feasible set absent from the existing single-level LP/MIP and simultaneous bimatrix Nash tools.
Understand the optimistic tie convention
If several follower decisions minimize the follower objective at the chosen x, the optimistic model allows the leader to select the one that best serves its own objective. This is a stated mathematical convention about ties, not a claim that a real follower will cooperate. A pessimistic model instead protects against the least favorable follower optimum and can have a different value.
When the follower optimum is unique, the optimistic and pessimistic distinctions disappear at that x. When the follower feasible set is empty, that leader decision has no valid response and is excluded. The finite bounds prevent an unbounded follower objective within the accepted model, but they do not guarantee a feasible response for every bounded leader decision.
Replace follower optimality with certificates
For a fixed leader x, the follower problem is an LP. Primal feasibility, dual feasibility, stationarity and complementary slackness characterize follower optimality whenever a feasible bounded optimum exists. Complementarity pairs each nonnegative dual multiplier with the slack of its corresponding follower inequality, requiring at least one member of each pair to be zero.
Enumerate the finite zero-pattern choices for these complementarity pairs and solve each resulting rational LP over leader, follower and dual variables. This avoids choosing an arbitrary big-M constant that could exclude valid multipliers or create weak artificial bounds. Every pattern must be resolved before a global optimum claim is made. A work cap leaves completeness unresolved even when an attractive incumbent has been found.
Check the default response analytically
The follower minimizes minus y, so it chooses the largest feasible y. The constraint y≤x+1 and bounds 0≤y≤3 give y=x+1 for every x in [0,2]. Substituting that response into the leader objective yields x-2(x+1)=-x-2. This decreases over the entire leader interval and reaches its minimum at x=2.
The optimal pair is therefore (2,3), with objective minus four. If one ignored follower optimality and optimized both variables jointly, x=0,y=3 would give minus six, but y=3 violates the follower row at x=0. Other examples can have jointly feasible points that fail follower optimality rather than feasibility. Either way, the lower-level response restriction is an essential part of the problem.
Verify the response after solving
For the returned leader decision, independently solve the follower LP and compare its optimum with the reported follower objective. Also check all follower slacks, dual signs, stationarity and complementarity products. A leader objective alone cannot reveal whether the selected y was truly a lower-level optimum. The final certificate should expose the lower-level evidence explicitly.
Bounds on follower variables count as lower-level inequality rows and require their own dual variables in the certificate. Omitting them can invalidate stationarity even when the primal solution looks correct. Degenerate follower optima can have several valid dual certificates, so deterministic output improves reproducibility but does not imply unique multipliers. The economic or behavioral interpretation belongs to the underlying model, not to an arbitrary chosen certificate.
Read the response-graph illustration
The illustration shows follower response y=x+1 over the leader interval, with the chosen endpoint optimum marked. A separate infeasible or unconstrained comparison point helps explain why the hierarchical problem differs from a free joint optimization. The response curve is a set of follower optima, not a time trajectory in which the follower gradually moves toward the leader.
For more than one variable or nonunique follower faces, the response set can be a union of polyhedral pieces rather than a single-valued line. The static default picture does not imply continuity or uniqueness in all edited models. Consult the optimistic convention, feasibility diagnostics and enumeration-completeness status before interpreting a returned point as a globally solved hierarchical decision.
Keep the global claim within its limits
At most eight lower-level inequality rows, including follower bounds, and six leader rows are accepted. Exact rational LP arithmetic supports exact comparison of resolved candidate patterns, but fraction growth and enumeration limits still apply. A partial search may provide an incumbent without proving it globally best; that distinction must remain visible in the output.
The calculator does not handle integer followers, nonlinear lower-level objectives or pessimistic tie handling. It also does not infer strategic preferences or commitment credibility from coefficients. Use it for an explicitly stated linear hierarchical model and save both objectives, row ownership and bounds with the result. The follower-optimization restriction is the defining feature that separates this page from an ordinary LP or simultaneous equilibrium calculator.
A few questions, answered
What does optimistic mean?
Among follower-optimal ties, the leader-favorable response is selected.
Can the follower be infeasible?
Yes. Such a leader choice has no valid follower response and is excluded.
Why avoid arbitrary big-M?
An unjustified bound can remove valid solutions or create misleading relaxations.
Does an incumbent prove optimality?
Only if every required complementarity pattern was resolved and compared.