Spokes

In this section we provide an overview of some of the spoke classes that are part of the mpi-sppy release. When using generic_cylinders.py (see generic_cylinders.py), spokes are enabled with command-line flags such as --lagrangian, --xhatshuffle, --xhatxbar, --fwph, --subgradient, --ph-dual, --relaxed-ph, and --reduced-costs.

Outer Bound

For minimization problems, outer bound means lower bound.

Frank-Wolfe

This bound is based on the paper Combining Progressive Hedging with a Frank–Wolfe Method to Compute Lagrangian Dual Bounds in Stochastic Mixed-Integer Programming by Boland et al [boland2018]. It does not receive information from the hub, it simply sends bounds as they are available. Compared to the Lagrangian bounds, it takes longer to compute but is generally tighter once it reports a bound.

Lagrangian

This bound is based on the paper Obtaining lower bounds from the progressive hedging algorithm for stochastic mixed-integer programs by Gade et al [gade2016]. It takes W values from the hub and uses them to compute a bound.

certified_outer_bound

An outer bound for problems whose scenario subproblems are convex and continuous, enabled with --certified-outer-bound.

Most runs do not need this spoke. It is for subproblem solvers that return no outer bound of their own, such as Ipopt and other local NLP solvers. With a MIP solver such as Gurobi, CPLEX or Xpress, the Lagrangian spoke (--lagrangian) and the other outer-bound spokes use the bound the solver reports, and that is usually the better choice; on a continuous model some solver interfaces report a number there that is within solver tolerance of a bound but is not one (see below). A model with integer variables cannot use this spoke at all.

The Lagrangian spoke gets its bound from the solver’s dual bound. A local NLP solver such as Ipopt reports none, so on a convex NLP that spoke produces nothing usable. Some solver interfaces instead report the objective value at the returned point as the bound on a continuous model, which is close to a bound but not one. This spoke computes the bound itself, from the subproblem’s own duals.

This spoke does not simply report the solved objective value. That value is measured at a point, hence an inner bound for a minimization – the wrong direction. The spoke instead computes a Lagrangian weak-duality bound, corrected by a tangent-plane underestimator minimized in closed form over the variable box. The result is valid for any multipliers, so no assumption that the solver converged is needed: a truncated or sloppy solve gives a loose bound rather than a wrong bound. At an exact KKT point the correction vanishes and the bound equals the subproblem optimum.

How tight the bound is depends on two things: how close the solve stops to a KKT point, and how tight the variable bounds are. The correction is zero at an exact KKT point and grows with both the distance from one and the width of the box. A loose box can make even a good solve’s bound weak, and a variable with no bound in the direction its gradient points gives no bound at all; see Variable bounds below.

Cost is one solve per scenario per iteration, the same as the Lagrangian spoke.

Warning

Convexity is assumed and mostly cannot be checked. If the objective is non-convex, or an inequality is non-convex in canonical form, the bound is simply wrong rather than merely loose.

Canonical form matters, and it is easy to get backwards. Every inequality is rewritten as g(v) <= 0, which negates the body of a >= row:

as written

canonical g

requirement on the body

body <= upper

body - upper

convex

body >= lower

lower - body

concave

lo <= body <= up

both of the above

affine

body == rhs

body - rhs

affine

So the theorem applies to x**2 <= 4 but not to x**2 >= 1, even though both are written with a convex body – and the feasible set of the latter is not convex at all. Getting this wrong yields an outer bound that can exceed the true optimum.

The objective and the constraint bodies have to be convex (or concave, per the table) over the variable bounds as the model states them, not merely where the other constraints hold. x**3 - 3*x <= z is convex only for x >= 0; written with x >= 0 as a constraint and a wider bound on x, it is outside the theorem, and the bound can exceed the optimum. Put such a restriction in the variable’s bounds. The fbbt tightening described below can shrink the box further, but it is not relied on for convexity, since it does not always succeed.

What is checked, as a hard error at setup: discrete variables, nonlinear equality constraints, nonlinear two-sided (ranged) constraints, a maximization objective, a dual Suffix the scenario creator already attached in a direction that does not import (the certificate needs the solver’s duals back, so Suffix.IMPORT or Suffix.IMPORT_EXPORT is required), and an expression Pyomo’s differentiate has no rule for. The affine cases are decidable, so they are enforced; convexity of a one-sided nonlinear body is not, so convexity remains a user assertion.

That last one is worth expanding, because it refuses models that are perfectly convex. The certificate differentiates the objective and the constraint bodies, so an expression differentiate cannot handle means no bound is available for that scenario on any iteration – and because Ebound is all-or-nothing, one such scenario leaves the whole N column empty for the run. Today the gap is cosh, sinh, tanh, ceil, floor and Expr_if; the error names the one it found. Convexity is not the issue and asserting it does not help – cosh is convex and unsupported alike – so the expression has to be rewritten in terms differentiate knows, or this spoke left off the run.

Variable bounds. The certificate minimizes over the box of variable bounds, so its looseness is roughly sum_i |d_i phi| * (width of the box in the descending direction). Tight bounds give a tight bound; enormous ones give a valid but useless number. fbbt runs first to recover bounds implied by the constraints. A variable still unbounded afterwards produces a warning at setup, and the spoke reports nothing on iterations where that variable’s gradient component is nonzero – it stays quiet rather than sending a wrong number. The bounds matter for validity as well as tightness: the model has to be convex over them as stated (see the convexity warning above), so a restriction such as x >= 0 that the convexity depends on belongs in the variable’s bounds.

Failed solves. This spoke is an optional source of a bound, so losing a solve means one thing: no bound for that iteration. Nothing about a subproblem solve ends the run – not a solution that fails to load, and not a solver that raises outright. The solver’s own status and termination condition are printed for the scenario that failed, and a once-per-run warning names the rank and the exception. Because Ebound is all-or-nothing, one failure empties the N column for that iteration; the run continues and the next iteration tries again.

Which solver. The spoke uses Ipopt unless --certified-outer-bound-solver-name names another; it does not inherit --solver-name, so the hub and the other spokes can run a MIP solver while this spoke runs an NLP solver. Any solver that returns constraint duals into a Pyomo dual Suffix can be used, for example Knitro or, on a convex QP or QCP, Gurobi. The duals are read with Ipopt’s sign convention, which is the only one that has been checked against known multipliers; Gurobi agrees with it on the farmer example. A solver whose signs differ, or that returns no duals (the spoke warns), can only loosen the bound, because any multipliers give a valid one – or cost it altogether, where zero multipliers leave a gradient component pointing at an unbounded side of the box. Neither can make it invalid. None of this lets the spoke certify a non-convex model, and if the model has integer variables the spoke is inapplicable whatever solver runs it.

Solver options. Unlike other spokes, this one does not inherit the global --solver-options or the --max-solver-threads cap. Ipopt hard-fails on an unrecognized keyword rather than ignoring it, so a perfectly ordinary run (a MIP solver and its options for the hub, this spoke attached alongside) would otherwise kill the spoke on its first solve. Pass this spoke’s solver settings, including a thread count if its solver takes one, through --certified-outer-bound-solver-options, --certified-outer-bound-solver-options-file, or a spokes.certified_outer_bound block in the --solver-options-file.

An inexact or ill-conditioned solve is safe. The certificate assumes nothing about the accuracy of the solve. The model is convex by assumption, so it has no non-global local minima, and a solver returning a sub-optimal answer can only mean it stopped short of converging – an inexact point with inexact multipliers, and the bound holds for any point in the box and any lam >= 0. The point the solver returns need not lie in the box: the certificate first moves each variable that is outside its bounds onto the nearer bound, which covers the slightly-out-of-bounds iterate bound_relax_factor can produce, and a solver whose tolerances allow more. Ill-conditioning does not enter either: the certificate evaluates the objective and one gradient, and inverts nothing, so there is no linear solve for a condition number to amplify. What both cost is tightness. The looseness term grows as the point moves away from optimal, so a badly conditioned subproblem reports a weak bound, and the hub keeps the best outer bound it has seen and ignores it.

--certified-outer-bound-cushion (default 1e-9) subtracts a small relative amount, q - eps*(1+|q|), from the reported bound. This is last-bit hygiene against floating point, not a proof-carrying margin; pass 0 to disable it.

The one case worth raising it for is a badly scaled model. The bound is summed as f + lam^T g + mu^T h, so its rounding error tracks the size of those terms, while the cushion tracks the size of the answer. Multipliers of order 1e8 against an objective of order one put the error floor near 1e-8 while the default cushion is 1e-9. Rescaling the offending constraint rows is the better fix; raising the cushion is the cheap one. A solve that diverges outright produces no number at all – a non-finite result is rejected and the spoke stays quiet.

Maximization is not supported and raises at setup.

Note

Ipopt builds obtained from the IDAES idaes-ext distribution (the usual way to get one with good linear solvers, and what mpi-sppy’s CI installs) link the Harwell Subroutine Library and default to the ma27 linear solver rather than to MUMPS. That is worth knowing because results can differ slightly between them, and because HSL asks that its use be acknowledged:

HSL, a collection of Fortran codes for large-scale scientific computation. See https://www.hsl.rl.ac.uk/

Pass --certified-outer-bound-solver-options "linear_solver=mumps" to choose otherwise.

Subgradient

This bound is based on the subgradient method. It computes its own W values based on the Lagrangian relaxation and reports a bound to the hub.

Lagranger

This bounder is no longer recommended for use. It does not seem to work as well as others.

This bound is a variant of the Lagrangian bound, but it takes x values from the hub and uses those to compute its own W values. It can modify the rho values (typically to use lower values). The modification is done in the form of scaling factors that are specified to be applied at a given iteration. The factors accumulate so if 0.5 is applied at iteration 1 and 1.2 is applied at iteration 10, from iteration 10 onward, the factor will be 0.6. Here is a sample json file:

{
 "1": "0.5",
 "10": "1.2"
}

ph_ob

This cylinder was deprecated in August of 2025 in favor of ph_dual.

Reduced Costs

The reduced cost spoke is equivalent to the Lagrangian spoke, except that it relaxes all integrality contraints in the subproblems. This enables the computation of reduced costs for the nonanticipative variables, which can be used for provable bound tightening, which is shared to all cylinders. The reduced cost can also be used for heuristic fixing in the hub via the reduced_cost_fixer extension.

Inner Bounds

For minimization problems, inner bound means upper bound. But more importantly, the bounds are based on a solution, whose value can be computed. In some sense, if you don’t have this solution, you don’t have anything (even if you think your hub algorithm has converged in some sense). We refer to this solution as xhat (\(\hat{x}\)) or somes as an incumbent solution. ` xhat_specific_bounder ^^^^^^^^^^^^^^^^^^^^^

At construction, this spoke takes a specification of a scenario per non-leaf node of the scenario tree (so for a two-stage problem, one scenario), which are used at every iteration of the hub algorithm as trial values for \(\hat{x}\). This bounder is mainly useful for debugging and testing.

xhatshufflelooper_bounder

This bounder shuffles the scenarios and loops over them to try a \(\hat{x}\) until the hub provides a new x. To ensure that all subproblems are tried eventually, the spoke remembers where it left off, and resumes from its prior position. Since the resulting subproblems after fixing the first-stage variables are usually much easier to solve, many candidate solutions can be tried before receiving new x values from the hub.

This spoke also supports multistage problems. It does not try every subproblem, but shuffles the scenarios and loops over the shuffled list. At each step, it takes the first-stage solution specified by a scenario, and then uses the scenarios that follow in the shuffled loop to get the values of the non-first-stage variables that were not fixed before.

xhatxbar_bounder

This bounder computes and uses \(\overline{x}\) as \(\hat{x}\). It does simple rounding for integer variables.

stage2ef

An option for xhatshufflelooper_bounder for multistage problems that creates an EF for each second stage node by fixing the first stage nonanticipative variables. This code requires that the number of ranks allocated to the xhatshufflelooper_bounder is an integer multiple of the number of second stage nodes.

When using generic_cylinders.py, this is enabled with the --stage2-ef-solver-name flag:

mpiexec -np 3 python -m mpi4py mpisppy/generic_cylinders.py \
    --module-name hydro --solver-name cplex --max-iterations 100 \
    --default-rho 1 --lagrangian --xhatshuffle --rel-gap 0.001 \
    --branching-factors "3 3" --stage2-ef-solver-name cplex

In a custom driver, set the spoke options directly:

xhatshuffle_spoke["opt_kwargs"]["options"]["stage2_ef_solver_name"] = solver_name
xhatshuffle_spoke["opt_kwargs"]["options"]["branching_factors"] = branching_factors

An example is shown in examples.hydro.hydro_cylinders.py (this particular example is intended to show the coding, not normal behavior. It is sort of an edge case: including this option causes the upper bound to immediately be Z*)

Feasibility cuts from xhatters

For problems without complete recourse, any xhatter can optionally emit a no-good feasibility cut when its candidate \(\hat{x}\) is infeasible in some scenario; the hub then installs the cut into every scenario so the same \(\hat{x}\) is not revisited. See Xhat Feasibility Cuts.

slam_heuristic

This heuristic attempts to find a feasible solution by slamming every variable to its maximum (or minimum) over every scenario associated with that scenario tree node. This spokes only supports two-stage problems at this time.

General

cross scenario

Computes and passes cross scenario cuts.

Relaxed PH

For S-MIPs, executes PH on the continuous relaxation of the problem. Provides W values to the Lagrangian or Reduced Costs spokes, as well as relaxed nonants which can be used with the relaxed PH fixer for the PH Primal Hub. This spoke can be useful, along with the PH Primal Hub, when the continuous relaxation allows for good dual (but not primal) convergence of the original problem. This typically happens for problems with a “strong” continuous relaxation. The option relaxed_ph_rescale_rho_factor allows the user to adjust provided rho values by a constant multiplier across all variables, which occurs between PH iteration 0 and PH iteration 1.

PH Dual

Executes another copy of PH, providing W values to the Lagrangian and/or Reduceds Costs spokes. This spoke can be useful, along with the PH Primal Hub, for problems which need different rho strategies for primal and dual convergence. The option ph_dual_rescale_rho_factor allows the user to adjust provided rho values by a constant multiplier across all variables, which occurs between PH iteration 0 and PH iteration 1.