SDDP Solver — Stochastic Dual Dynamic Programming in GTOpt

The methods and their validation are described in the gtopt paper, M. Matus et al., engrXiv 2026, DOI 10.31224/8872; see publications for the related papers.

1. Introduction

The SDDP solver in GTOpt implements a Nested Benders Decomposition (NBD) algorithm — also known as Stochastic Dual Dynamic Programming (SDDP) — to decompose the multi-phase power system planning problem into smaller, per-phase LP subproblems. This enables the solver to handle long-horizon problems (many phases/stages) that would be computationally expensive or memory-intensive to solve monolithically.

The SDDP solver is an alternative to the default monolithic solver, which assembles and solves the entire LP in one shot. Both solvers produce equivalent optimal solutions; the SDDP solver trades a single large LP for multiple smaller LP solves connected by Benders optimality cuts.

When to use SDDP

CriterionMonolithicSDDP
Number of phases1–3≥ 2 (designed for 5+)
Memory footprintLarge (full LP in memory)Smaller (per-phase LPs)
State variablesNot requiredReservoir volumes, battery SoC, capacity expansion
Convergence guaranteeExact (single solve)Iterative convergence (exact at optimality)
ParallelismPhases solved sequentially within one LPScenes solved in parallel

2. Theoretical Background

2.1 Benders Decomposition

Benders decomposition [1] is a divide-and-conquer technique for structured linear programs. Consider a two-stage LP:

\[\min_{x, y} \quad c^T x + d^T y \quad \text{s.t.} \quad Ax + By \ge b, \; x \ge 0, \; y \in Y \]

The key insight is that for fixed first-stage decisions \(\bar{y}\), the residual (second-stage) problem in \(x\) can be solved independently:

\[\min_x \; c^T x \quad \text{s.t.} \quad Ax \ge b - B\bar{y}, \; x \ge 0 \]

The dual of this residual provides sensitivity information (dual variables / reduced costs) that quantifies how changes in \(\bar{y}\) affect the second-stage cost. This information is encoded as a Benders optimality cut:

\[\alpha \ge z^*_2 + \pi^T (y - \bar{y}) \]

where \(z^*_2\) is the second-stage objective value, \(\pi\) are the reduced costs of the linking (state) variables, and \(\alpha\) is an auxiliary variable representing the second-stage cost approximation.

The master problem iteratively refines its decisions by accumulating cuts:

\[\min_{y, \alpha} \; d^T y + \alpha \quad \text{s.t.} \; y \in Y, \; \{\text{accumulated cuts}\} \]

Convergence is guaranteed when the gap between the master lower bound (LB) and the actual second-stage cost upper bound (UB) falls below a tolerance.

2.2 Nested Benders Decomposition (SDDP)

For multi-stage problems (more than two stages), Nested Benders Decomposition [2] applies the Benders technique recursively. Each stage \(t\) has:

  • State variables \(x_t\) (e.g., reservoir volume, battery SoC) that link to stage \(t+1\)
  • Operating variables (generation dispatch, line flows, demand served)
  • A future cost function \(\alpha_t\) approximated by accumulated cuts

The algorithm iterates between:

  1. Forward pass: solve stages 1 → T sequentially, fixing state variables from the previous stage's solution (trial values)
  2. Backward pass: solve stages T → 1 in reverse, computing Benders cuts from the dual information of each stage and adding them to the previous stage's LP

This is the classic SDDP algorithm introduced by Pereira and Pinto [3] for hydrothermal scheduling, later generalized by Shapiro [4] and others.

2.3 Optimality Cut Formula

In GTOpt's SDDP solver, the optimality cut added to phase \(t-1\) from phase \(t\) is:

\[\alpha_{t-1} \ge z_t^* + \sum_{i \in S} \text{rc}_i \cdot (x_{t-1,i} - \hat{v}_i) \]

where:

  • \(z_t^*\) is the optimal objective of phase \(t\) (including its own \(\alpha_t\))
  • \(S\) is the set of state-variable links between phases \(t-1\) and \(t\)
  • \(\text{rc}_i\) is the reduced cost of the dependent column for state variable \(i\) in phase \(t\)'s LP, in physical units: the LP reduced cost divided by the dependent column's own scale factor (times scale_objective). Under Ruiz equilibration the source and dependent columns get different scales, so using the source column's scale would skew every slope (see SDDP cut validity)
  • \(x_{t-1,i}\) is the source column in phase \(t-1\)
  • \(\hat{v}_i\) is the trial value used in the forward pass

This cut is a linear outer approximation of the true future cost function. As iterations proceed, the piecewise-linear approximation converges to the exact cost-to-go function [3][4].

2.4 Elastic Filter for Feasibility

When a forward-pass subproblem is infeasible (the trial values from the previous phase violate the current phase's constraints), the solver applies an elastic filter — a technique from the PLP hydrothermal scheduler [5][6].

The elastic filter:

  1. Clones the LP (using LinearInterface::clone(), which calls OsiSolverInterface::clone() — the same pattern as PLP's osi_lp_get_feasible_cut)
  2. Relaxes fixed state-variable columns to their physical source bounds
  3. Adds penalized slack variables (s⁺, s⁻) to allow violation: \(x_i + s_i^+ - s_i^- = \hat{v}_i\)
  4. Solves the cloned LP with the elastic objective
  5. Extracts dual information for cut generation
  6. Discards the clone — the original LP is never modified

This approach follows the PLP pattern in osicallsc.cpp (osi_lp_get_feasible_cut), where the LP is cloned before applying elastic modifications, ensuring the underlying LP state remains clean for subsequent iterations.

2.5 Convergence

At each iteration, the algorithm computes:

  • Lower Bound (LB): the phase-0 objective value (includes \(\alpha_0\), the accumulated future cost approximation)
  • Upper Bound (UB): the sum of actual phase operating costs from the forward pass (without \(\alpha\) contributions)
  • Gap: \((UB - LB) / \max(1, |UB|)\)

The algorithm terminates when the gap falls below the convergence tolerance (primary criterion). For deterministic problems (single scenario), SDDP converges finitely to the exact optimum [3]. For stochastic problems, statistical convergence criteria apply [4].

Secondary criterion — stationary gap

Some problems converge to a non-zero stationary gap due to stochastic noise, problem structure, or numerical conditioning. The gap stops improving but never reaches the primary tolerance \(\varepsilon\). The stationarity criterion detects this plateau on the upper bound (the policy-cost estimate) — see §4.5:

gap_change = |UB[k] − UB[k − window]| / max(1e-10, |UB[k − window]|)
if gap_change < stationary_tol → declare convergence

When triggered, the solver sets converged = true and stationary_converged = true. In gtopt this stationarity test is the default and sole stopping criterion; the gap tolerance \(\varepsilon\) (convergence_tol) is used only when stationarity is disabled (§4.5).

Example

![SDDP lower and upper bounds per iteration, and the relative gap on a log scale, for a two-reservoir hydro cascade with 24 phases and 8 inflow scenarios; the bounds meet after 8 iterations](../images/sddp_convergence.svg)

The figure shows a typical run: the upper bound (expected cost of the forward-pass policy) falls and the lower bound (phase-0 objective with the cuts collected so far) rises until they meet. The case is a 24-phase, 8-scenario variant of cases/hydro_valley_sddpjl, built by tools/figures/make_sddp_demo_case.py and solved with HiGHS and all scenarios as backward-pass apertures (--sddp-num-apertures -1). The bounds and gap come from the history array of solver_status.json; gtopt_monitor plots the same data live, and tools/figures/plot_sddp_convergence.py draws this figure.


3. Mapping to GTOpt's Time Structure

GTOpt's simulation has a hierarchical time structure:

Scenario (probability weight)
  └─ Phase (SDDP decomposition unit)
       └─ Stage (investment period, discount factor)
            └─ Block (operating hour, duration in hours)

3.1 Phases as SDDP Stages

The SDDP algorithm decomposes along phases. Each phase contains one or more stages and their blocks. The phase is the natural decomposition unit because:

  • State variables (reservoir volumes, battery SoC, expansion capacity) link consecutive phases
  • Within a phase, the monolithic LP handles all stages and blocks together
  • Between phases, Benders cuts approximate the future cost function
GTOpt conceptSDDP role
PhaseSDDP stage (decomposition unit)
StageTime period within a phase (handled monolithically)
BlockOperating hour within a stage
ScenarioStochastic realization
SceneParallel SDDP instance (groups scenarios)

3.2 State Variables

State variables are the coupling quantities between consecutive phases:

ComponentState variableSource columnDependent column
ReservoirVolume at end of phaseefin (last block)eini (first block of next phase)
BatteryState of charge at end of phaseefineini
Capacity expansionInstalled capacitycapainstcapainst_ini

These are registered via SystemContext::add_state_variable() during LP construction. The SDDP solver discovers them generically through the SimulationLP::state_variables() interface.

3.3 Scenes and Parallel Solving

Each scene groups one or more scenarios and is solved independently in the SDDP algorithm. Scenes are processed in parallel using the adaptive work pool (AdaptiveWorkPool). Cut sharing between scenes is controlled by the cut_sharing_mode option:

ModeBehaviour
none (default)Each scene uses only its own cuts; scenes are solved independently in parallel with no synchronization. Unconditionally valid — each scene's α bounds its own persistent-path cost-to-go
multicutPLP-faithful: every scene-LP carries N future-cost columns varphi_0..N-1, each priced at the M4 weight w_r = p_s (the owning scene's normalized probability; = 1/N under uniform probabilities); scene S's cuts land on varphi_S in every LP. Valid for the resampled process: a true lower bound for the stagewise-resampled process with measure q_r = p_r, for any probability vector (M4 pricing fix, 2026-07-08). See docs/formulation/sddp-cut-validity.md §8
markov (opt-in, experimental)Markov-chain SDDP: every scene-LP carries M future-cost columns (one per Markov state), priced w_{s,m'} = p_s·P[m(s)][m']/pi_{m'}; scene S's cuts land on varphi_{m(S)} in every LP. Requires markov_states + markov_transition in sddp_options. Conditionally valid for the Markov-modulated resampled process (theorem MK1): singleton states are exact; multi-scene states are valid-but-loose under non-negative stage costs. Generalizes multicut (M = N singleton states, transition rows = normalized scene probabilities). See docs/formulation/sddp-markov.md

Removed modes (2026-07-08): broadcast_mean (formerly expected), accumulate, and max were deleted. All three broadcast a cut from scene S onto every other scene's OWN α, which over-tightens whenever Q_S ≠ Q_d and produced LB > UB compounding across iterations on distinct-sample-path runs (settled by the 2026-04-30 audit, docs/analysis/investigations/sddp/sddp_cut_sharing_fix_plan_2026-04-30.md; verdicts in docs/formulation/sddp-cut-validity.md §7). Their names now hard-error at JSON/CLI ingestion; the implementation survives only in git history.

multicut semantics (2026-07 certification + M4 pricing fix): scene S's cuts bound a dedicated column varphi_S in every LP, so no cut ever over-tightens another scene's own bound. Since the M4 pricing fix (2026-07-08, alpha_unit_cost: every varphi_r in scene-s's LP priced at w_r = p_s) the resulting LB is provably the lower bound of the stagewise-resampled process with measure q_r = p_r (scene data redrawn at each phase boundary) for any probability vector — the former "unsound for non-uniform probabilities" caveat (theorem M3, pre-M4 uniform 1/N pricing) is retired. The resampled process is still a different process from the persistent-path forward simulation, so a transient LB > UB against the sampled UB is a process mismatch, not a cut bug; an INFO noting this is emitted at SDDP setup (source/sddp_method.cppinitialize_solver) for cut_sharing=multicut with non-uniform scene probabilities. Full statements and proofs: docs/formulation/sddp-cut-validity.md §7–§8; extensive-form certification harness: test/source/test_sddp_cut_oracle.cpp.

Feasibility cuts are never shared between scenes regardless of the cut sharing mode — they remain local to the originating scene.

When cut sharing is disabled (none), each scene's backward pass runs its full phase sweep independently in parallel, with no waiting or coupling between scenes.

When cut sharing is enabled (multicut), the backward pass is synchronized per-phase: all scenes complete the backward step for a given phase, then optimality cuts are broadcast across scenes for that phase before proceeding to the previous phase. This allows shared cuts to inform earlier phases within the same iteration.


4. Algorithm Details

4.1 Initialization

  1. Bootstrap solve: the monolithic solver runs once to establish a baseline solution and warm-start the LP basis
  2. Add α variables: a future-cost variable \(\alpha\) is added to every phase except the last, bounded below by the cut-derived floor (or alpha_min when set) and with objective coefficient 1.0
  3. Discover state links: for each phase, the solver enumerates all state variables and their dependent columns in the next phase
  4. Load hot-start cuts (optional): previously saved cuts are loaded from a file to accelerate convergence
  5. Load boundary cuts (optional): external future-cost cuts for the last phase are loaded from a CSV file (see §4.11)

4.2 Forward Pass

For each scene (in parallel):

for phase = 0 to T-1:
    if phase > 0:
        propagate trial values from phase-1 solution
        (fix dependent columns to source column values)

    update LP coefficients (see §4.6)
    solve phase LP

    if infeasible:
        clone LP → apply elastic filter → solve clone
        use clone's solution for cost/cut data
        (original LP remains unmodified)

    cache: forward_full_obj; mirror reduced costs onto each StateVariable

    opex += objective - α value

Forward sampling (forward_sampling_mode, 2026-07-08): by default (persistent) each scene-driver simulates its OWN scenario data at every phase — the historical behaviour, byte-identical. Under resampled, at every phase boundary (phase > 0) the driver re-draws a scene realization with probability p_r (deterministic in (iteration, scene, phase) — stable across backtracking re-entries and thread scheduling) and overwrites the phase LP's stochastic bounds with the drawn scene's data via the same bound-only update_aperture machinery the aperture backward pass uses (flow discharges + profile bounds; replay-recorded, so low-memory reconstructs preserve it). The forward UB then estimates the stagewise-resampled process — the same measure q_r = p_r the cut_sharing_mode = multicut lower bound certifies (Theorems M1/M4, docs/formulation/sddp-cut-validity.md §8) — removing the Corollary-M2 UB/LB process mismatch. v1 draws ONE sampled path per scene-driver per iteration; the drawn id is cached on the phase state so the backward pass re-solves the SAME realization, and the simulation pass restores each scene's own (persistent) data so final outputs keep per-scene semantics. Warm-start seeding (forward basis chain, basis_cross_mode) is unaffected — realizations differ only in column bounds.

4.3 Backward Pass

For each scene (in parallel):

for phase = T-1 down to 1:
    build Benders cut from cached reduced costs:
        α_{phase-1} ≥ z_phase + Σ rc_i · (x_{phase-1,i} - v̂_i)

    add cut to phase-1 LP
    store cut for persistence

    if phase > 1:
        re-solve phase-1 LP
        if infeasible:
            iterative feasibility backpropagation
            (clone + elastic + cut to phase-2, etc.)

4.4 Backward Pass with Apertures

Unless apertures are switched off (num_apertures = 0 or apertures = []), the backward pass uses apertures (also called hydrological openings in PLP) to compute the expected future-cost cut. Instead of using the cached forward-pass solution to build a single Benders cut, the solver solves the phase LP once per aperture, each time with different stochastic parameters (flow/inflow values), and averages the resulting cuts:

for phase = T-1 down to 1:
    for ap = 0 to num_apertures-1:
        clone the phase LP
        update scenario-dependent bounds for aperture ap
        solve clone via work pool
        if optimal:
            build Benders cut from clone's reduced costs
            store cut with probability weight

    if no apertures produced a valid cut:
        skip this phase

    compute expected cut = probability-weighted average of aperture cuts
    add expected cut to phase-1 LP
    store cut for persistence

    if phase > 1:
        re-solve phase-1 LP via work pool

Aperture data updates: When switching to an aperture scenario, the solver updates all scenario-dependent LP elements via a unified update_aperture() method. Each element that satisfies the HasUpdateAperture concept receives an ApertureValueFn — a std::function<std::optional<double>(StageUid, BlockUid)> — that provides the new values. The value function abstracts over two data sources:

  • LP scenario data (when the aperture's source scenario is in the forward set): reads directly from the element's schedule data via aperture_value().
  • Aperture data cache (when the source scenario is external): looks up pre-loaded parquet data via ApertureDataCache::lookup().
ElementWhat is updatedMechanism
FlowLPDischarge column bounds (m³/s)set_col_low / set_col_upp
GeneratorProfileLPProfile constraint (capacity factor)Row coefficient or RHS
DemandProfileLPProfile constraint (demand factor)Row coefficient or RHS

This ensures that hydro inflows, solar/wind capacity factors, and demand forecast uncertainty are all varied across aperture scenarios during the backward pass. State variable bounds remain fixed at the forward-pass trial values.

Aperture data cache: The ApertureDataCache loads all *.parquet files from the sddp_aperture_directory at construction time into a flat_map keyed by (class_name, element_name, scenario_uid, stage_uid, block_uid). The directory structure is aperture_dir/ClassName/ElementName.parquet, with each parquet file containing stage, block, and uid:N columns (one per scenario UID). Loading is O(n log n) via vectorized bulk insert.

Configuration (sddp_options.num_apertures, CLI --sddp-num-apertures):

  • unset (default) — every aperture in the phase's Phase.apertures list (when a phase has no list, every active entry of aperture_array)
  • num_apertures = 0 — no apertures: the deterministic Benders backward pass (same as apertures: [])
  • num_apertures = N > 0 — the first N entries of each phase's list (aperture_selection_mode picks head, stride or tail); with the wettest-first order written by plp2gtopt that is the N wettest

Aperture task grouping (aperture_chunk_mode): how the apertures of one (scene, phase) are split into work-pool tasks. Each task clones the phase LP once and solves its apertures in series on that clone, so under the default warm solve mode every aperture after the first re-optimizes the previous one's basis with a few dual-simplex pivots.

ModeTasks per (scene, phase)Trade-off
per_scene (default)1 (all apertures)maximum warm-start reuse, one clone per cell; parallelism capped at the number of scenes
per_apertureone per aperturemaximum fan-out; every aperture is a fresh clone + cold solve
chunked⌈A / K⌉ with K = aperture_chunk_sizein between; K unset → ⌈A·S / (2·cores)⌉ rounded down to a power of two

Measured on a 16-scene × 16-aperture hydrothermal case, the backward pass is several times faster under per_scene than under per_aperture, with the same bounds and the same peak memory. The grouping changes only the scheduling and the simplex path, never the cuts, so bounds agree up to solver tolerance. The resolved grouping is logged at setup as SDDP Aperture: chunk_mode=<name> chunk_size=<K> ....

The integer aperture_chunk_size used to encode the mode (1 = one task per aperture, -1 = per scene, K > 1 = K per task, 0 = auto, which resolved to 1). It is still accepted when aperture_chunk_mode is unset — with a deprecation warning — but 0/unset now means the new default per_scene. A size that contradicts an explicit mode (e.g. per_scene with aperture_chunk_size = 4) is ignored with a warning.

Aperture solve modes (aperture_solve_mode): how each aperture subproblem is solved and how its cut's coefficients are recovered. Apertures of one (scene, phase) share the LP matrix and differ only in flow column bounds, which is what the warm and dual-shared modes exploit.

ModePer-aperture workCut sourceNotes
coldcold barrier + crossover solvevertex reduced costslegacy byte-for-byte behaviour
warmwarm dual simplex off the resident chunk basisvertex reduced costseffective default (unset resolves to warm); the within-chunk chain engages whenever a task holds several apertures — aperture_chunk_mode = per_scene (the default) or chunked with K > 1
reduced_costcold barrier, no crossoverinterior-point reduced costs~35% faster on big LPs; ε-optimal duals filtered by cut_coeff_eps
dual_sharedno solve (representative only)representative's vertex duals + bound-delta intercept correctionopt-in Infanger–Morton sharing (Lemma AP2, cut-validity §6); forces a single chunk; falls back to exact solves on row-touching profile updates, sentinel deltas, or an infeasible representative
screeneddual_shared + aperture_screen_count exact re-solvesmixedthe synthesized cuts with the largest |correction| are re-solved exactly on the resident basis

The dual-shared modes target backends with no warm-start path (cuOpt/PDLP: set_basis is a no-op and every resolve is a cold run) — on CPU simplex backends the warm re-solves they skip are already only a few pivots, so expect little wall-clock win there. aperture_screen_count (default 2) sets the screened re-solve budget; per-cascade-level overrides are available via cascade_options.level_array.N.sddp_options.aperture_screen_count. There is deliberately no dedicated plp2gtopt CLI flag for it — set it via the JSON field or --set sddp_options.aperture_screen_count=N.

AR(1) inflow models (Flow.inflow_model) are incompatible with the dual-shared synthesis: the aperture hydrology enters through the AR equality-row RHS, which the column-bound intercept correction cannot price (Lemma AP2's yᵀΔb term — ledger F12). SDDP setup WARNs and downgrades dual_shared/screened to warm (exact per-aperture solves) whenever any Flow.inflow_model is present.

PLP correspondence: In PLP, apertures are called "aberturas hidrologicas" (hydrological openings). PLP iterates over all hydrological realizations for each stage, solves each one, and computes the expected cut weighted by scenario probabilities. The GTOpt implementation follows the same pattern: clone the LP, update scenario-dependent bounds, solve, collect cuts, and compute the probability-weighted average.

Infeasible apertures (drop-and-rescale)

An aperture LP that is infeasible (or times out / is abandoned, see §4.11) is dropped: the expected cut of that (scene, phase) is the probability-weighted average over the remaining feasible apertures, with their weights renormalised to sum to one. The dropped aperture is solved again at the next iteration.

This is only safe when the model has relatively complete recourse: every aperture LP must be feasible at every trial state the forward pass can produce. A hard terminal target (efin without efin_cost, on a reservoir or battery) usually breaks it: the forward pass sees only its own hydrology, and a dry aperture cannot reach efin from a low-storage trial state. The cut then carries no feasibility signal, the policy never moves off that trajectory, and the same aperture is dropped on every iteration. The LB freezes at a tie-break-dependent level and describes a rescaled (typically wetter) distribution rather than the declared one.

The high-storage side needs the same care. A reservoir has no spill column unless spillway_cost is set (0 is allowed), so its only outlets are the turbines and any other waterways. If the forward pass fills it to emax and a wetter aperture brings more water than the system can turbine (generation is capped by the demand), that aperture LP is infeasible and is dropped as well. Give such reservoirs a spillway (a small spillway_cost is enough) when the apertures can be wetter than the forward hydrology.

gtopt makes this visible and refuses to call it convergence:

  • every (scene, phase, aperture) dropped in 3 consecutive iterations gets one persistent aperture infeasibility warning (scene, phase and aperture uids, consecutive count); afterwards the per-cell "apertures dropped" line for that cell drops to DEBUG, and each iteration logs one INFO summary with its drop count;
  • apertures_dropped (per iteration, summed over every cell) is reported in the iteration log line and in the solver-status history;
  • an iteration whose backward pass dropped any aperture is never converged — neither by the gap test, ΔUB stationarity, the statistical CI test, nor (async mode) the per-scene gap test; the run continues to max_iterations and the stop line reads not converged: N aperture(s) infeasible in the last backward pass, the LB is over a rescaled distribution (cascade levels likewise);
  • every SDDP solve ends with an aperture summary block (INFO, next to the stop-reason line): aperture LPs solved, how many were dropped as infeasible vs failed (time limit / numerical / non-optimal), the dropped fraction, first / last iteration counts, distinct (scene, phase, aperture) triples ever dropped, how many are still dropped in the last iteration, how many were escalated as persistent, and the phases / apertures with the most drops. A cascade prints one line per level and a Cascade [total] block; cascade_levels.csv gains aperture_solves, aperture_infeasible, aperture_failed and aperture_dropped_last_iteration columns, and the solver-status JSON an aperture_summary object.

Recommendation for aperture runs: give terminal targets relatively complete recourse with a soft efin — set efin_cost on the reservoir / battery so the LP can miss efin at a price instead of going infeasible. Two caveats:

  • a meaningful efin_cost may not be available. It has to be well above the marginal value of the stored energy for the target to bind in practice (e.g. above the thermal cost it displaces), yet it also enters the objective, the cuts and the duals; there is often no defensible number for it;
  • with a soft target the solution may never actually reach efin: the LP simply pays the penalty whenever that is cheaper, so the constraint can be silently unmet. Check the efin slack in the output (and its cost in the objective) before reading the policy as one that honours the terminal target.

The principled fix — feasibility cuts for infeasible backward apertures instead of drop-and-rescale — is planned.

4.5 Convergence Check

Convergence is evaluated at the end of each training iteration (a paired forward + backward pass that generates cuts). The simulation pass (see S4.5.1) does not determine convergence on its own — it inherits the convergence status from the last training iteration. When max_iterations = 0 (e.g. simulation_mode), no training iterations run, so converged is always false.

Exactly one stopping criterion is live per run, chosen by whether ΔUB stationarity is enabled:

StationarityConditionStop criterion
enabled (default)convergence_mode ≠ gap_only and stationary_tol > 0 and stationary_window > 0ΔUB stationarity only; convergence_tol does not stop the run
disabledstationary_tol <= 0 or stationary_window <= 0 or convergence_mode = gap_onlygap test with convergence_tol

Both require iter >= min_iterations. convergence_mode = statistical additionally runs the statistical CI test on top of whichever criterion is live.

LB = sum of phase-0 objectives across feasible scenes
UB = sum of total forward-pass costs across feasible scenes
gap = (UB - LB) / max(1, |UB|)

Both bounds are plain sums, not averages: every LP cost coefficient already carries its scenario's probability via cost_factor = probability × discount × duration (CostHelper::block_ecost), so each per-scene value is ≈ p_s × physical_cost(s) and the sum is the expectation. Multiplying by per-scene weights again would double-count probability (pre-2026-05-02 bug; see SDDPMethod::compute_iteration_bounds). Infeasible scenes contribute 0 to both bounds; the missing probability mass is reported separately as scene_probability_lost.

ΔUB stationarity (default)

The solver checks whether the upper bound (the Monte-Carlo estimate of the policy cost) has stopped moving over the look-back window:

gap_change = |UB[iter] - UB[iter - window]| / max(1e-10, |UB[iter - window]|)
if gap_change < stationary_tol                 # UB has stopped moving
   AND own_iters_with_cuts >= stationary_window
   AND signed_gap < stationary_gap_ceiling     # default 0.02
   AND iter >= min_iterations:
    converged = true
    stationary_converged = true

Three guards make a stationary stop meaningful:

  • Own window. The lookback must lie entirely in iterations of the current solve that had cuts. Bounds seeded from the previous cascade level (seed_prior_bounds) are shown in Δgap but never satisfy the test, and a solve that starts without any cut (no hot start, no inherited or boundary cuts) does not count its first, cut-less iteration.
  • Gap ceiling (stationary_gap_ceiling, default 0.02). A stationary UB with a large positive gap means the lower bound has not caught up; the run keeps iterating (to max_iterations, or the cascade level's budget). The ceiling is one-sided: a negative gap (multi-cut / aperture overshoot, LB above UB) passes. Set it to 1.0 to disable.
  • min_iterations, as before.

The gap test itself (convergence_tol) does not stop the run while stationarity is enabled, because under multi-cut / aperture overshoot the signed gap zero-crosses (LB can settle above UB) before the policy has stabilised. A run whose gap already reached zero therefore keeps iterating until UB is stable over the window. The per-iteration log prints gap_change as Δgap; an iteration where UB is stationary but the stop is refused logs why (only N own iteration(s) with cuts or signed gap … >= stationary_gap_ceiling …). Every solve ends with one line naming the reason: SDDP: training stopped after N iteration(s) — converged: UB stationary with gap below stationary_gap_ceiling / converged by convergence_tol / converged by the statistical CI test / max_iterations reached (not converged) / stop requested.

History. The 2026-06-16 rewrite removed the gap ceiling (then a symmetric |gap| gate that refused stationary overshoot states) and the window-fill wait. In 2026-11 both came back in the form above: without them a cold cascade level seeded with the previous level's bounds declared "stationary" at its first iteration with a 40 % gap, and the levels of a large hydrothermal cascade stopped with a gap of several percent after a few iterations.

Gap test (stationarity disabled)

gap_ok    = (-1e-9 < gap) AND (gap < convergence_tol)
converged = gap_ok AND (iter >= min_iterations)

The band is one-sided: a gap below -1e-9 (kSddpGapFpEpsilon) means LB > UB beyond rounding noise — the cuts overshoot the optimum — and is never read as converged. A gap printed as -0.0000% is usually pure rounding (e.g. -2e-16) and lies inside the band. Set convergence_tol to a negative value to disable the test. To stop on convergence_tol, disable stationarity, e.g. --set sddp_options.stationary_tol=0.

History. The 2026-05-14 rewrite made ΔUB stationarity the only trigger and dropped the gap exit everywhere, so a run with stationarity disabled had no exit at all: bounds met exactly (gap = ±0.0000% from iteration 2) yet it iterated to max_iterations. Since 2026-11-18 the gap test applies when (and only when) stationarity is disabled. The asynchronous path (max_async_spread > 0) additionally marks individual scenes converged when their own gap is in the band.

If no criterion fires, the run ends with a warning naming the live criterion and its value, e.g. SDDP: max_iterations reached without convergence (ΔUB=… not < stationary_tol=… over stationary_window=…; gap=… is not a stop criterion while stationarity is enabled …) or (gap=… not in (-1e-09, convergence_tol=…); ΔUB stationarity disabled).

With boundary cuts loaded the raw gap is replaced, in both tests, by the corrected gap gap* (see §4.14.1); without boundary cuts gap* = gap and the behaviour is unchanged.

Iteration result fields

FieldDescription
gapRelative optimality gap: \((UB - LB) / \max(1, \lvert UB \rvert)\)
boundary.*Boundary-cut gap accounting (only with boundary cuts) — see §4.14.1
gap_changeRelative change in UB over the look-back window (1.0 if not yet checked)
convergedtrue if the live criterion (or the statistical CI test) was met and no aperture was dropped in that iteration's backward pass
apertures_droppedBackward-pass aperture solves dropped (infeasible / timed out) in the iteration, summed over every (scene, phase); > 0 blocks converged (see §4.4, Infeasible apertures)
stationary_convergedtrue if convergence was declared by the stationary criterion

4.5.1 Simulation Pass

After all training iterations complete (or when max_iterations = 0), the solver runs a simulation pass — a forward-only policy evaluation with no backward pass and no cut generation. The simulation pass solves all phases sequentially using the accumulated cuts from training and records the resulting operating costs and state-variable trajectories.

The simulation pass always runs, regardless of whether training converged. Its purpose is to evaluate the final policy under the full set of Benders cuts without modifying the LP.

Feasibility cuts during simulation: if the simulation pass encounters an infeasible trial point, the elastic filter is activated and may produce a feasibility cut. By default these cuts are discarded to ensure that hot-start reproducibility is not affected by the evaluation pass (the C++ SDDPOptions::save_simulation_cuts flag keeps them; it is not exposed in the JSON options).

simulation_mode: set "simulation_mode": true in sddp_options to skip all training iterations (max_iterations is forced to 0) and disable cut saving entirely. Only the simulation pass runs, evaluating the policy from previously loaded cuts (typically via cut_recovery_mode). This is useful for policy evaluation without modifying any cut state.

4.6 Cut Sharing (Optional)

After each backward phase step, cuts from all scenes are optionally redistributed by share_cuts_for_phase (source/sddp_cut_sharing.cpp), per the cut_sharing_mode table in §3.3:

  • none — no redistribution; each scene's cuts stay on its own α.
  • multicut — every cut from scene S is added to the dedicated column varphi_S in every scene-LP. Broadcast copies are never persisted — on cut-file reload the broadcast is reconstructed from the origin-only file (sddp_cut_parquet.cpp, multicut_broadcast).

The legacy broadcast_mean/expected, accumulate, and max redistribution branches were REMOVED 2026-07-08 (invalid — see §3.3; history in git and the 2026-04-30 plan docs/analysis/investigations/sddp/sddp_cut_sharing_fix_plan_2026-04-30.md).

Validity of each mode is analyzed in docs/formulation/sddp-cut-validity.md §7 (mode-by-mode verdicts) and §8 (the multicut theorem). Feasibility cuts are never shared — they are scene-local statements.

4.7 LP Coefficient Updates

The update_lp mechanism updates LP matrix coefficients, bounds, and RHS values that depend on the current state of the system (e.g., reservoir volumes). It uses a two-layer architecture:

Layer 1 — SystemLP::update_lp(): Unconditional dispatch. Iterates over all (scenario, stage) pairs in this system's scene/phase and calls element.update_lp(sys, scenario, stage) on every element that satisfies the HasUpdateLP concept. Returns the total number of LP modifications.

Layer 2 — SDDPMethod::dispatch_update_lp(scene, iteration): Conditional wrapper called at the start of each forward pass (per scene, in the per-scene thread). Applies three-way iteration logic before delegating to SystemLP::update_lp() for each phase:

  • iteration.update_lp == false → skip (explicitly disabled)
  • iteration.update_lp == true → force (bypass skip count)
  • not specified → apply global update_lp_skip count

Call sites:

  • After LP assembly (planning_lp.cpp): sys.update_lp() is called unconditionally for every system, setting volume-dependent coefficients from reservoir eini values before any solver runs.
  • SDDP forward pass (sddp_forward_pass.cpp): dispatch_update_lp(scene, iteration) runs before the phase solve loop.

Currently implemented element updates:

  1. Turbine efficiency (ReservoirProductionFactorLP) — evaluates the piecewise-linear efficiency curve at the current reservoir volume and sets the turbine's conversion-rate LP coefficient via set_coeff().
  2. Seepage (ReservoirSeepageLP) — updates slope and RHS of seepage constraints based on volume-dependent piecewise-linear segments.
  3. Discharge limits (ReservoirDischargeLimitLP) — updates slope and RHS of volume-dependent discharge limit constraints.

Volume source (include/gtopt/update_context.hpp). Rule axes read the stage's initial volume vini and final volume vfin (bound rules use (vini + vfin) / 2):

QuantityResolution order
vinihorizon start: eini; eini column pinned by trial propagation: that value; else the predecessor stage's solved efin (same phase, or the previous phase's last stage); else this LP's optimal eini column
vfinthe stage's own solved efin; else this LP's optimal efin column
neithereini — correct only before the first solve

"Solved `efin`" is the efin StateVariable written after every forward solve (StateVariable::has_col_sol()), so it is the same value under every low_memory mode: a compress reconstruct, a cut row or the trial pin clears the LP's optimal flag but not the state variable. Falling back to eini after the LP has been solved means the value was lost; it logs a one-time warning with the element, scenario, stage and mode.

Skip count: the update_lp_skip option in sddp_options controls how often the update is applied. A skip of \(N\) means "update every \(N{+}1\) iterations". Per-iteration overrides via the iteration_array take precedence over the global skip count.

Solver fallback: if the LP solver does not support in-place matrix coefficient modification (supports_set_coeff() returns false), the update is skipped entirely and static coefficients are used unchanged.

4.8 Sentinel File Stop

The solver checks for a sentinel file (configurable via sentinel_file in SDDPOptions) at the beginning of each iteration. If the file exists, the solver stops gracefully after saving all accumulated cuts. This is analogous to PLP's userstop mechanism.

4.9 Incremental Cut Saving

By default (save_per_iteration: true), cuts are saved to the output file after every iteration (not just at the end). This ensures that if the solver is interrupted — whether by the sentinel file, a time limit, or an external signal — the accumulated cuts are available for a subsequent hot-start run.

Set save_per_iteration: false to defer all cut saving until the solve completes or is stopped. This reduces I/O overhead when saving is not needed between iterations.

4.10 Cut Types

The SDDP solver generates two types of Benders cuts:

Optimality cuts (CutType::Optimality, CSV marker o) are the standard Benders cuts that approximate the future cost function. They are generated during the backward pass from the reduced costs of the solved phase LPs (see S2.3).

Feasibility cuts (CutType::Feasibility, CSV marker f) are generated when the elastic filter is activated due to an infeasible forward-pass trial point. The dual information from the elastic-clone LP produces a cut that tightens the previous phase's feasible region, preventing the same infeasible trial point from reappearing.

Both cut types are now stored and saved to the cut CSV files. Previously, feasibility cuts were transient (applied to the LP but not persisted). Saving them ensures that hot-start runs can benefit from previously discovered feasibility information.

In the cut CSV files, the type column distinguishes the two kinds:

MarkerCutTypeDescription
oOptimalityStandard Benders optimality cut
fFeasibilityFeasibility cut from elastic filter

4.11 Solve Timeouts

Two timeout settings protect against runaway LP solves:

forward_solver_options.time_limit (seconds; the former sddp_options.solve_timeout key was removed and is now rejected) is the solver time limit applied to each forward-pass LP solve.

aperture_timeout (default: 30 seconds) applies to individual aperture LP solves in the backward pass. When an aperture LP exceeds this time, it is treated as infeasible (skipped), a WARNING is logged, and the solver continues with the remaining apertures for that phase.

Set either timeout to 0 to disable the corresponding time limit.

{
  "options": {
    "sddp_options": {
      "forward_solver_options": {"time_limit": 300},
      "aperture_timeout": 30
    }
  }
}

4.12 Single-Phase Fallback

When method: "sddp" is requested but only 1 phase exists in the planning model, the solver factory automatically falls back to the monolithic solver with an informational log message. This prevents the SDDP "requires at least 2 phases" error and allows the same JSON configuration to work for both single-phase and multi-phase models.

4.13 Solver API for Monitoring and Control

The SDDPMethod exposes a thread-safe API designed for GUI integration, external monitoring tools, and programmatic control of the solve process:

Iteration callback — register an SDDPIterationCallback via set_iteration_callback(). It is invoked after every iteration with the full SDDPIterationResult (iteration number, lower/upper bound, gap, cuts added, feasibility flags). Return true from the callback to request an immediate stop.

sddp.set_iteration_callback([](const SDDPIterationResult& r) {
    fmt::print("iter {} gap={:.6f}\n", r.iteration, r.gap);
    return r.gap < 1e-6;  // true → stop
});

Programmatic stop — call request_stop() from any thread; the solver checks this atomic flag at the start of each iteration and exits gracefully, saving all accumulated cuts.

// From a UI thread or signal handler:
sddp.request_stop();

Live query — poll the solver's convergence state at any time via atomic accessors. These are safe to call from any thread during solve:

MethodReturns
current_iteration()Current iteration number (0 before start)
current_gap()Current relative convergence gap
current_lower_bound()Current LB (phase-0 obj including α)
current_upper_bound()Current UB (sum of forward-pass costs)
has_converged()Whether convergence tolerance has been met
num_stored_cuts()Number of accumulated Benders cuts
is_stop_requested()Whether a stop has been requested

Data access — after solving (or mid-solve via callback), the full per-phase state is available via phase_states(scene), and all stored cuts via stored_cuts().

4.14 Boundary Cuts (Future-Cost Approximation)

Boundary cuts approximate the expected future cost beyond the planning horizon. They are the SDDP analogue of PLP's "planos de embalse" (reservoir future-cost function). Each cut is of the form:

\[\alpha \;\ge\; \beta_0 \;+\; \sum_{i} \rho_i \cdot x_i \]

where \(\alpha\) is the future-cost variable added to the last phase, \(x_i\) are the state variables (reservoir volumes, battery SoC), \(\rho_i\) are gradient coefficients, and \(\beta_0\) is the intercept (RHS).

The boundary cuts are configured on the FutureCost element (system.future_cost_array; full field list in Input Data — Future Cost), the single source read by every method (monolithic, SDDP, cascade). A relative cuts_file resolves against options.input_directory. The keys sddp_options.boundary_* / missing_cut_var_mode are deprecated aliases honoured only under method = sddp or cascade; monolithic_options.boundary_* keys are ignored by SDDP. sddp_options.scale_alpha and cut_coeff_eps remain SDDP settings (future_cost_array[].scale_alpha, when set, overrides the α scale).

CSV format (future_cost_array[].cuts_file):

name,iteration,scene,rhs,Reservoir1,Reservoir2,...
bc_1_1,1,1,-5000.0,0.25,0.75,...
bc_1_2,1,2,-4800.0,0.30,0.60,...
bc_2_1,2,1,-5100.0,0.26,0.74,...
ColumnDescription
nameCut identifier
iterationSDDP iteration number (PLP: IPDNumIte)
sceneScene UID (matches uid in scene_array; PLP: ISimul)
rhsIntercept \(\beta_0\) (PLP: \(-\)LDPhiPrv)
State columnsGradient coefficients \(\rho_i\) per state variable

Load modes (future_cost_array[].mode):

ModeDescription
"noload"Skip loading even if a file is specified
"separated" (default)Each cut is assigned to the scene matching its scene UID
"combined"All cuts are broadcast to all scenes
"phi_expectation"PLP-literal terminal FCF: the scene column is read as PLP's ISimul plane hydrology; every scene's terminal LP carries NVarPhi φ_j columns priced p_s/NVarPhi, each bounded by its hydrology's cuts at FULL magnitude (raw CSV — no 1/NVarPhi pre-division). The forward UB carries the terminal E_j[FCF_j] at realized volumes (PLP ZSPFAdd). See docs/formulation/sddp-cut-validity.md §9

Iteration filtering (future_cost_array[].iteration_limit):

When set to a positive integer \(N\), only cuts from the last \(N\) distinct SDDP iterations (by the iteration column) are loaded. This is useful for PLP cases where many iterations of cuts are available but only the most recent ones are relevant. Set to 0 to load all cuts (default).

Example — load the last 3 iterations of cuts, per-scene:

{
  "options": {
    "method": "sddp"
  },
  "system": {
    "future_cost_array": [
      {
        "uid": 1,
        "name": "fcf",
        "cuts_file": "boundary_cuts.csv",
        "mode": "separated",
        "iteration_limit": 3,
        "valuation": "end_of_horizon"
      }
    ]
  }
}

4.14.1 Gap accounting with boundary cuts

The forward-pass UB strips every future-cost column, including the terminal α that carries the boundary FCF Φ, while the LB carries Φ through the master's α. With the mean shift (boundary_cuts_mean_shift) the constant c̄ = mean(Φ) is moved out of the cuts (Φ' = Φ − c̄) into the first-phase objective, where both bounds see it. Hence, even with perfectly valid cuts,

\[LB - UB \;\to\; \mathbb{E}[\Phi'(v_T)] \;+\; \text{(cut over-estimation)} \]

and LB > UB is expected whenever Φ' is positive at the terminal volumes (docs/formulation/sddp-cut-validity.md §9). gtopt therefore evaluates, every iteration and only when boundary cuts were loaded:

QuantityDefinition
E[Φ']Σ over feasible scenes of the last phase's weighted α / φ_j value at the forward pass's final states (physical cost units, scene probability folded in)
c̄Σ over scenes of the c̄ actually folded into the objective (c̄, or p_s·c̄ under phi_expectation)
opexexpected stage cost excluding c̄ and the terminal term (may be negative in net-reward cases)
E\|opex\|Σ_s |opex_s| — a scale that stays meaningful when positive and negative scene opex cancel
ub*UB + E[Φ'] = E[stage costs + Φ(v_T)] (= UB under phi_expectation, whose UB already keeps the terminal φ, PLP ZSPFAdd)
gap*(ub* − LB) / max(1, \|ub*\|) — the gap the convergence tests read
overLB − ub* — the residual cut over-estimation

over ≈ 0 (or negative while the policy still improves) means the negative raw gap is pure terminal accounting — including a foreign FCF, which is simply a different terminal condition. over > 0 means some cut claims more future cost than the forward pass realises: cuts invalid for this system's intermediate phases (foreign or hot-start cuts), cut sharing across non-identical scenes, or numerical overshoot. A WARN is emitted when over > tol · max(|ub*|, E|opex|, 1) with tol = max(1e-9, 5·convergence_tol):

    iter 9  obj   ub=8.562500M  lb=30.812500M  gap=-259.8540%  Δgap=+100.0000%
    iter 9  bcut  E[Φ']=21.250000M  c̄=0.000000  opex=8.562500M  E|opex|=8.562500M  ub*=29.812500M  gap*= -3.3543%  over=1000.000000K ( +3.3543% of |ub*|, +11.6788% of E|opex|)
[warning] SDDP Iter [i9]: cut OVER-ESTIMATION beyond the terminal FCF accounting: LB − (UB + E[Φ'(v_T)]) = 1000.000000K = 0.0335 of |ub*| and 0.1168 of E|opex| (threshold 5.00e-09) — …

(from the unit test "Boundary gap diagnostics - over-estimating cuts": a foreign FCF plus first-phase cuts lifted by a known Δ = 1e6; the raw gap of −260 % is almost entirely terminal accounting, over isolates Δ.)

The same fields are written per iteration to solver_status.json (history[i].boundary = {terminal_future_cost, alpha_offset, expected_opex, expected_abs_opex, corrected_upper_bound, corrected_gap, overestimation, terminal_in_ub}). With boundary cuts the "SIGNIFICANT negative gap … Refusing to declare [CONVERGED]" WARN is replaced by the over-estimation WARN above, and the gap-only and statistical-CI convergence tests use gap* / ub* instead of the raw gap / UB, so a run whose LB > UB is explained by E[Φ'] can converge. Without boundary cuts nothing changes. The asynchronous path (max_async_spread > 0) computes the same fields on its aggregate snapshot (iter N bcut ... line, each scene contributing its latest forward pass) and its per-scene gap test uses the scene's corrected gap; the over-estimation WARN is emitted by the synchronous path only.

4.14.2 LP-scaling invariance check

Equilibration (lp_matrix_options.equilibration_method) and scale_objective are LP-numerics knobs only: LB, UB, the objective and every cut in physical units must not depend on them. tools/check_equilibration_invariance.sh runs a case under several of them with one solver and compares the results:

tools/check_equilibration_invariance.sh -s highs -n 5 -o 1,1000 \
    cases/sddp_hydro_3phase                         # SDDP, 3 eq × 2 so
tools/check_equilibration_invariance.sh -m monolithic cases/ieee_9b/ieee_9b.json

Per variant it runs gtopt with --set lp_matrix_options.equilibration_method=<eq> (default list none,row_max,ruiz, -e to change), optionally --set model_options.scale_objective=<so> (-o), and for SDDP min = max = N iterations (-n, default 3) with per-iteration cut saving. tools/check_equilibration_invariance.py then compares, against the first variant: LB / UB of every iteration (solver_status.json), the objective (solution.csv; SDDP: first phase only, since later phases' obj_value also carries α), and the first-iteration optimality cuts from cuts/sddp_cuts.parquet, normalised by the α coefficient into a physical intercept a = rhs/w and slopes β = c/w. A pair passes when |x − y| ≤ rtol · max(|x|, |y|, 1) (--rtol, --cut-rtol, default 1e-6). Output is one [ok] / [FAIL] line per check and a PASS: k/n checks / FAIL: … summary; exit 0 = pass, 1 = fail, 2 = run error, 77 = skipped (no gtopt binary or no pyarrow). Extra --set K=V options are forwarded; -w DIR -k keeps the run directories. The CTest smoke test tool_check_equilibration_invariance (integration build) runs it on sddp_hydro_3phase.

4.15 Named Cuts (Multi-Phase Hot-Start)

Named cuts extend boundary cuts to all phases (not just the last). Each row includes a phase column indicating which phase the cut belongs to. The solver resolves named state-variable headers (reservoir, battery, junction) to LP column indices in the specified phase, then adds each cut as a lower-bound constraint on the corresponding future-cost variable:

\[\alpha_{\text{phase}} \;\ge\; \text{rhs} \;+\; \sum_{i} \rho_i \cdot x_i[\text{phase}] \]

Retired (2026-05): the CSV named_cuts_file option no longer exists; hot-start cuts are loaded from sddp_options.cuts_input_file (Parquet), and end-of-horizon boundary cuts from the FutureCost element (system.future_cost_array[].cuts_file). The format below is kept for reference only.

CSV format (former named_cuts_file):

name,iteration,scene,phase,rhs,Reservoir1,Reservoir2,...
hs_1_1_3,1,1,3,-5000.0,0.25,0.75,...
hs_2_1_4,2,1,4,-4800.0,0.30,0.60,...
ColumnDescription
nameCut identifier
iterationSDDP iteration number
sceneScene UID
phasePhase UID (determines which phase LP receives the cut)
rhsIntercept \(\beta_0\)
State columnsGradient coefficients per state variable (by name)

Example (current equivalent — Parquet hot-start cuts):

{
  "options": {
    "sddp_options": {
      "cuts_input_file": "cuts/sddp_cuts.parquet",
      "cut_recovery_mode": "keep"
    }
  }
}

5. Configuration

5.1 SDDPOptions

Defaults below are the values gtopt uses when the JSON leaves a field unset; the complete list is in Planning Options → SddpOptions.

FieldTypeDefaultDescription
max_iterationsint100Maximum SDDP iterations
min_iterationsint1Minimum iterations before declaring convergence
convergence_toldouble0.01Relative gap tolerance; stops the run only when ΔUB stationarity is disabled (§4.5)
elastic_penaltydouble1.0Penalty cost for elastic slack variables
elastic_modeElasticFilterModefarkas_recursiveElastic filter strategy (see S5.4)
multi_cut_thresholdint100Infeasibility count before auto-switching to multi_cut (0 = always multi_cut, <0 = disabled)
alpha_mindoubleunsetUniversal lower bound for α. Unset: α is floored only by the cut-derived box floor (from the first installed cut on). Set 0 when every stage cost is non-negative (the SDDP.jl lower_bound = 0 analogue); not valid with negative-cost elements or boundary_cuts_mean_shift
cut_sharing_modeCutSharingModenoneCut sharing strategy between scenes
save_per_iterationbooltrueSave cuts to CSV after each iteration
cut_recovery_modestring"none"Hot-start from saved cuts: none, keep, append, replace (replaces the removed hot_start flag; CLI --hot-start)
aperture_timeoutdouble30.0Aperture LP solve timeout in seconds (0 = no timeout)
sentinel_filestring""Path to sentinel file for graceful stop
cuts_output_filestring""Path for saving cuts (CSV format)
cuts_input_filestring""Path for loading cuts (hot-start)
log_directorystring"logs"Directory for log and error LP files
lp_debugboolfalseSave debug LP file for every (iter, scene, phase)
lp_onlyboolfalseBuild LP matrices and exit without solving (CLI: --lp-only / -c)
lp_debug_compressionstring""Compression for LP debug files ("gzip" / "")
enable_apibooltrueEnable monitoring API (JSON status file)
api_status_filestring""Path for the JSON status file
api_stop_request_filestring""Path for monitoring API stop-request file
api_update_intervalms500Interval between monitoring samples
num_aperturesintunsetApertures per backward-pass phase: unset = the phase's full list, 0 = none (Benders), N = first N
boundary_cuts_modestring—Deprecated alias → future_cost_array[].mode
boundary_max_iterationsint—Deprecated alias → future_cost_array[].iteration_limit
max_cuts_per_phaseint0Max retained cuts per (scene, phase) LP (0 = unlimited)
cut_prune_intervalint10Iterations between cut pruning passes
prune_dual_thresholddouble1e-8Dual threshold for inactive cut detection
single_cut_storageboolfalseStore cuts per-scene only (halves memory)
max_stored_cutsint0Max stored cuts per scene (0 = unlimited)
simulation_modeboolfalseSkip training (force max_iterations=0), run simulation pass only, disable cut saving
stationary_toldouble0.005ΔUB stationarity tolerance — the sole stop criterion while > 0; 0 disables it and makes convergence_tol the stop criterion (§4.5)
stationary_windowint4Look-back window (iterations) for ΔUB stationarity; also the minimum number of the solve's own iterations with cuts before a stationary stop; <= 0 disables stationarity
stationary_gap_ceilingdouble0.02A stationary stop is refused while the signed gap is at or above this value (negative gaps pass); 1.0 disables (§4.5)

5.2 Options (JSON)

The SDDP solver and all key tuning parameters are fully configurable from the JSON planning file.

{
  "options": {
    "method": "sddp",
    "log_directory": "logs",
    "sddp_options": {
      "cut_sharing_mode": "multicut",
      "cut_directory": "cuts",
      "max_iterations": 200,
      "convergence_tol": 1e-5,
      "elastic_penalty": 1e7,
      "elastic_mode": "chinneck",
      "cut_recovery_mode": "replace",
      "forward_solver_options": {"time_limit": 300},
      "aperture_timeout": 30,
      "stationary_tol": 0.01,
      "stationary_window": 10
    }
  }
}

The top-level method field selects the planning solver. SDDP-specific options live in the nested sddp_options sub-object (without the sddp_ prefix, since the section name already provides the namespace).

Top-level options fields:

FieldTypeDefaultDescription
methodstring"monolithic"Solver: "monolithic" or "sddp" (recommended shorthand)
log_directorystring"<output_directory>/logs"Directory for log and trace files

sddp_options sub-object fields:

FieldTypeDefaultDescription
cut_sharing_modestring"none"Cut sharing: "none", "multicut", or "markov" (experimental; the removed "expected"/"broadcast_mean"/"accumulate"/"max" names hard-error)
forward_sampling_modestring"persistent"Forward-pass sampling: "persistent" (each scene-driver on its own path) or "resampled" (per-phase-boundary probability-weighted re-draw, deterministic seed; matches the multicut LB's resampled process — see §4.2)
integer_cuts_modestring"none"Backward cuts on integer-bearing cells: "none" (legacy — LP cells certified, MIP cells convexified/unsound) or "strengthened" (LP-relaxation cut + one-MIP Lagrangian intercept, valid by weak duality and never looser; requires a MIP-capable solver — see docs/analysis/investigations/sddp/sddip_integer_expansion_2026-07.md)
markov_statesarray of intunsetmarkov only: scene → Markov-state assignment, one entry per scene, each in [0, M) (docs/formulation/sddp-markov.md)
markov_transitionarray of doubleunsetmarkov only: row-major M×M row-stochastic transition matrix (rows sum to 1)
cut_directorystring"cuts"Directory for Benders cut files
max_iterationsint100Maximum SDDP iterations
min_iterationsint1Minimum iterations before declaring convergence
convergence_toldouble0.01Relative gap tolerance; stops the run only when ΔUB stationarity is disabled (§4.5)
elastic_penaltydouble1.0Penalty for elastic slack variables
elastic_modestring"farkas_recursive"Elastic filter mode: "farkas_recursive", "state_repair" (alias "plp"), "chinneck" (alias "iis"), "single_cut" (alias "cut") or "multi_cut"
fact_epsdouble1e-8PLP FactEPS tolerance (state_repair / farkas_recursive only)
fact_max_cyclesint500PLP FactMXC per-phase solve-cycle cap (state_repair / farkas_recursive only)
fcut_logboolfalseWrite the PLP-style feasibility-cut debug log gtopt_fcut.log to log_directory (plpfact.log analogue; every elastic mode). CLI: --fcut-log
multi_cut_thresholdint100Auto-switch to multi_cut after N cumulative infeasibilities at a (scene, phase) (counter is persistent)
cut_recovery_modestring"none"Hot-start from saved cuts (none, keep, append, replace); replaces the removed hot_start flag
save_per_iterationbooltrueSave cuts to CSV after each iteration
forward_solver_optionsobject—Solver options for forward-pass solves; time_limit replaces the removed solve_timeout
aperture_timeoutdouble30.0Aperture LP solve timeout in seconds (0 = no timeout)
num_aperturesintunsetApertures per backward-pass phase: unset = the phase's full list, 0 = none (Benders), N = first N
aperture_chunk_modestring"per_scene"How backward apertures are grouped into pool tasks (each task clones the phase LP once and solves its apertures in series): "per_scene" (all apertures of a (scene, phase) in one task — warm-start chain, one clone per cell; parallelism capped at the scene count), "per_aperture" (one task per aperture, fresh clone, cold solve), "chunked" (aperture_chunk_size = K per task). See Aperture task grouping. CLI: --aperture-chunk-mode
aperture_chunk_sizeintunsetK apertures per task for aperture_chunk_mode = "chunked" (unset = auto formula). Deprecated as a mode selector when aperture_chunk_mode is unset: -1 → per_scene, 1 → per_aperture, K > 1 → chunked, 0 → default (warning logged). CLI: --aperture-chunk-size
aperture_solve_modestring"warm"Per-aperture solve / cut recovery: "cold" (barrier + crossover, exact vertex duals), "warm" (chunk-resident basis re-optimize; engages under per_scene / chunked K > 1), "reduced_cost" (barrier without crossover, ~35% faster per aperture on big LPs), "dual_shared" (representative solve + Lemma AP2 synthesis; see §4.4), "screened" (dual_shared + top-|corr| exact re-solves)
aperture_screen_countint2Synthesized cuts re-solved exactly under aperture_solve_mode = "screened" (picked by largest |intercept correction|); ignored by every other mode
aperture_cut_resolveboolfalseRe-solve the source phase LP after installing each aperture-built cut, as an optimality check (non-optimal → revert and install the forward-data cut). Off by default: nothing reads the post-cut solution and the check costs one extra LP solve per backward step (PLP has no such step)
aperture_seed_basisboolfalseSeed each iteration's first backward aperture from the previous iteration's basis (dual warm start; acts only under cold/warm modes)
basis_cross_modestring"full_cross"Cross-pass basis reuse between forward and backward solves of the same (scene, phase); correctness-neutral, CPLEX/HiGHS only
aperture_directorystring""Directory for aperture-specific scenario data
api_enabledbooltrueEnable SDDP monitoring API (JSON status file)
update_lp_skipint0Iterations to skip between LP coefficient updates (0 = every iteration)
boundary_cuts_filestring—Deprecated alias → future_cost_array[].cuts_file
boundary_cuts_modestring—Deprecated alias → future_cost_array[].mode
boundary_cut_sharing_modestring—Deprecated alias → future_cost_array[].sharing
boundary_cuts_mean_shiftbool—Deprecated alias → future_cost_array[].mean_shift
boundary_max_iterationsint—Deprecated alias → future_cost_array[].iteration_limit
missing_cut_var_modestring—Deprecated alias → future_cost_array[].missing_cut_var_mode
simulation_modeboolfalseSkip training, run simulation pass only (S4.5.1)
stationary_toldouble0.005ΔUB stationarity tolerance — the sole stop criterion while > 0; 0 disables it and makes convergence_tol the stop criterion (§4.5)
stationary_windowint4Look-back window (iterations) for ΔUB stationarity; also the minimum number of the solve's own iterations with cuts before a stationary stop; <= 0 disables stationarity
stationary_gap_ceilingdouble0.02A stationary stop is refused while the signed gap is at or above this value (negative gaps pass); 1.0 disables (§4.5)

Note: the boundary cuts live on the FutureCost element (system.future_cost_array). The boundary_* / missing_cut_var_mode keys above are deprecated aliases honoured only for method = sddp / cascade (translated with a warning; conflicting values are an error). Migrate cases with python tools/migrate_future_cost.py FILE....

5.3 CLI

# Run with SDDP solver, custom cut directory, and tight convergence
gtopt my_case.json \
  --set sddp_options.cut_directory=cuts \
  --set log_directory=logs \
  --set sddp_options.max_iterations=300 \
  --set sddp_options.convergence_tol=1e-5 \
  --set sddp_options.elastic_mode=chinneck \
  --trace-log sddp_trace.log
FlagDescription
--trace-log <file>Capture all SPDLOG_TRACE messages to a file
--set sddp_options.cut_directory=<dir>Directory for Benders cut files (default: cuts)
--set log_directory=<dir>Directory for log and trace files (default: logs)
--set sddp_options.max_iterations=<n>Maximum SDDP iterations (default: 100)
--set sddp_options.convergence_tol=<tol>Relative gap tolerance (default: 0.01); stops the run only with stationarity disabled (stationary_tol=0)
--set sddp_options.elastic_penalty=<p>Elastic slack penalty coefficient (default: 1e2)
--set sddp_options.elastic_mode=<mode>Elastic filter mode: chinneck (default), single_cut, multi_cut, state_repair (alias plp), farkas_recursive

The --trace-log option captures all SPDLOG_TRACE messages to a file, providing detailed iteration-by-iteration data including:

  • Forward pass phase objectives and α values
  • Backward pass cut coefficients and RHS values
  • Elastic filter activations
  • Convergence metrics

5.4 Elastic Filter Modes

When a backward-pass phase is infeasible due to the fixed trial values of state variables from the forward pass, the elastic filter handles the infeasibility by temporarily relaxing the state-variable bounds using penalised slack variables. Five modes are available:

Mode taxonomy

ModeOriginCut shapeWhen to use
single_cut (alias cut)classical NBD / Birge–Louveaux1 aggregated π-weighted fcutsmall problems, classical behaviour
multi_cutGTOpt (PLP-inspired)1 signed bound cut per activated slackpersistent per-reservoir infeasibility
chinneck (alias iis)Chinneck 1991/2008 §3.5multi_cut restricted to the IISgeneral default; never worse than multi_cut
state_repair (alias plp)PLP-CEN (plp-agrespd.fAgrElastici)N single-variable minimal-repair cutsPLP parity runs; bound-consistent by construction
farkas_recursiveFüllner & Rebennack, SIAM Review 2023, §17.2–17.31 aggregated recursive cut (installed fcut rows relaxed with +z)runs where installed fcuts themselves become infeasible (the "relaxed clone infeasible" kill chain)

Solver-independence principle (design directive, 2026-07-11): every feasibility-cut mode derives its cut from the ORDINARY optimal duals of the elastic Phase-1 clone — σ on the state-fixing rows, ω on elasticized cut rows — which every LP backend exposes portably. No mode may consume a solver-specific Farkas/ray certificate API (CPXdualfarkas, Gurobi FarkasDual, …): those are backend-dependent, non-comparable across solvers, and would make runs non-reproducible when the backend changes. This matches PLP itself (osicallsc.cpp reads getRowPrice() off the elastic LP, never the ray API).

Feasibility-cut debug log (fcut_log)

Setting sddp_options.fcut_log = true (CLI shorthand --fcut-log) writes a dedicated feasibility-cut debug file, gtopt_fcut.log, to the resolved log_directory (sibling of gtopt_<N>.log) — the GTOpt analogue of PLP's plpfact.log (gated there by FactDBL ≥ 1), so cuts can be diffed across the two tools line-by-line. Every mode in the taxonomy above is covered: each forward-pass infeasibility event appends an INFEASIBLE iter=… scene=… phase=… cycle=… status=… detection line, then one atomic record with a mode: header (aggregated / multi_cut / state_repair / farkas_recursive), one cut: <Class>:<uid>[:<name>] <var> col=<c> coef=<v> line per coefficient of every emitted row (physical units, printed {:.17g} — mirroring PLP's cf: lines), a rhs: <sense> <v> line per row (PLP's rhsi:), and the INSTALLED … dest=<p−1> rows=<n> confirmation naming the destination phase. The no-cut outcomes land as HOLGURAS … (PLP IStat = −1) and FAIL … reason=… lines, and forward_infeas_rollback deletions as ROLLBACK iter=… scene=… rows=…. Records are mutex-serialised and flushed per event, so the file is safe to tail -f under the scene-parallel forward pass and survives a killed run; the file is opened in append mode so cascade levels extend it rather than truncate. See FcutLogWriter in include/gtopt/fcut_log.hpp.

Mode 1: "single_cut" (default, alias "cut")

This is the standard Nested Benders Decomposition approach. When the elastic clone is solved, its dual information is used to build a single feasibility cut for the previous phase. The feasibility cut is added to the previous phase's LP and the phase is re-solved. This tightens the previous phase's feasible region and prevents the same infeasible trial point from reappearing.

When to use: when you want the classical NBD guarantee that all phases remain strictly feasible after each iteration and cuts accurately capture the future cost.

Mode 2: "multi_cut"

Like single_cut, this mode adds a feasibility cut, but also adds one additional bound-constraint cut per activated slack variable. This provides stronger information to the previous phase's LP, potentially reducing the number of iterations needed to achieve feasibility.

The solver can auto-switch from single_cut to multi_cut when a specific (scene, phase) pair has been infeasible for more than multi_cut_threshold consecutive forward passes (default: 10). Set the threshold to 0 to always use multi_cut for any infeasibility, or to a negative value to disable auto-switching entirely.

Mode 3: "chinneck" (Chinneck IIS default)

Runs a Chinneck-style elastic IIS filter pass on top of the elastic clone. After the standard elastic relaxation solves, the algorithm inspects the slack variables to identify which relaxed state-variable bounds are truly essential to the infeasibility (slack > tolerance) vs which were activated only due to penalty competition (slack ≈ 0). Non- essential bounds are re-pinned to their trial values and the LP is re-solved. If the re-fix maintains feasibility, those bounds are classified as non-essential and dropped from the cut set; if not, the algorithm falls back to the full elastic result.

The result feeds build_multi_cuts() with only the IIS subset, so the emitted per-bound cuts forbid only the genuine infeasibility-causing region rather than the convex hull of all relaxed bounds.

When to use: the default for SDDP runs. In the worst case (when the LP has degenerate primal optimum and chinneck cannot identify a smaller IIS) it falls through to behaviour identical to multi_cut, so it is never strictly worse. When the IIS is genuinely smaller it produces fewer per-bound cuts → smaller LP basis growth, fewer rescale_benders_cut warnings, lower per-iteration kappa.

Cost: one extra LP solve per fcut event (the IIS re-fix solve).

Reference: Chinneck, Feasibility and Infeasibility in Optimization, 2008, §3.5; PLP osi_lp_get_feasible_cut.

Mode 4: "state_repair" (alias "plp")

Exact reproduction of PLP's feasibility-cut formulation (plp-agrespd.fAgrElastici + osicallsc.cpp:: osi_lp_get_feasible_cut, default FOneFeasRay=FALSE). The elastic Phase-1 clone prices the slack pair at unit-per-physical-unit cost ((1 ± tilt) × col_scale(dep) — PLP's LP is unscaled, so its flat unit costs are physical prices; the col_scale fold keeps parity under GTOpt's auto scale_reservoir) tilted by 0.01 × rc(source col, previous basis) toward the cheapest reservoir, with slack caps equal to the previous phase's state box — the repaired state is therefore bound-consistent BY CONSTRUCTION. One single-variable cut

ray_i · x_i ≥ ray_i · nx_i · (1 + fact_eps),   nx_i = v̂_i + dx_i

is emitted per link whose |ray| survives the PLP emission tolerance. NO box clamp, NO saturation / degenerate-family drops, NO aggregated fallback. Cuts persist across iterations (exempt from forward_infeas_rollback). Tolerances: fact_eps (PLP FactEPS); cycle cap: fact_max_cycles (PLP FactMXC).

CANUTILLAR case study (CEN65, 2-year case, stage 25, sim 16): the maintenance floor emin = 596.152 (‰, = 635.13 hm³) was unreachable from the trial vini = 528.705 (‰). PLP's elastic clone found the minimal repair +3.842 and emitted the mid-box single-variable cut vf64(t−1) ≥ 532.547 — NOT a clamp to the box top (sim 17's coefficient 1.292 shows the 0.01·rc tilt). GTOpt's legacy multi_cut path on the same family of events instead produced all-at-source_upp degenerate families that the drop guard cleared, then the aggregated fallback re-installed the degenerate cut — the state_repair mode reproduces PLP's per-reservoir mid-box cuts verbatim (pinned by test_plp_feasibility_cuts.cpp).

Mode 5: "farkas_recursive" (Füllner–Rebennack §17.2–17.3)

The published SDDP-correct RECURSIVE feasibility cut (Füllner & Rebennack, SIAM Review 2023, §17.2–17.3). Two pieces on top of the standard elastic clone (flat unit slack costs per PHYSICAL unit — eᵀy⁺ + eᵀy⁻ with the col_scale(dep) fold, no rc tilt):

  1. + I z relaxation of installed cuts (§17.2): every feasibility-cut row already installed in the stage LP (any family: fcut / mcut / plpcut / frcut, enumerated from the cut store) receives a slack z_r ≥ 0 with coefficient +1 (a_rᵀx + z_r ≥ b_r) and cost = row_scale(r) (one raw z unit = row_scale physical units of violation). The clone can therefore ALWAYS relax a poisoned cut — the empirically-photographed kill chain (2-year case, i1 s10/s12/s13/s17 p51/p52: the fallback fcut sddp_fcut_51_12_52_1_1 sat HARD in the clone with 0 slacks → "relaxed clone infeasible" → scene declared infeasible every iteration) is structurally impossible.
  2. Recursive aggregated cut (§17.3): from the clone's ordinary optimal duals, one cut on the previous phase per event:

    Σ_i σ_i·x_i ≥ Σ_i σ_i·v̂_i + V,    σ_i = −dual(fixing_row_i)

    where V is the clone optimum (the minimum total PHYSICAL violation) minus the LP's objective constant — the Phase-1 reset zeroes both the column costs and the solver-native objective offset (demand-fail Option-A baseline, boundary c̄), which is NOT part of the feasibility gap. (Pre-2026-07-11 the offset leaked into V, inflating every intercept by ~1.7e8/phase on the 2-yr case and compounding through the z-fold into a 6.2e9 RHS at p1 — the p52→p0 cascade.) By strong duality V = σᵀh_t + ωᵀb + (box folds), so the intercept folds the relaxed downstream cut intercepts ω_r·b_r exactly — eq. (17.3)'s α^f term — without ever calling a solver ray API. The emitted cut is a valid subgradient cut even at degenerate vertices; the fact_eps outward margin is clamped at the box-top LHS whenever the unmargined intercept was box-satisfiable, so the margin alone can never make the master presolve-infeasible. If the previous phase genuinely cannot satisfy it, the recursion continues: the new frcut row is itself elasticized at the next event one phase upstream.

Shares fact_eps (σ/ω zero-guard + outward RHS margin), fact_max_cycles, and the rollback exemption with state_repair. See build_farkas_recursive_cut in benders_cut.cpp.

Note on the retired "backpropagate" mode: an earlier version of this file documented a mode that updated source state-variable bounds directly instead of installing cuts (PLP-style). The implementation was deleted during the forward-pass-installs-fcuts refactor and the enum value removed. Legacy elastic_mode: "backpropagate" JSON / CLI strings now silently fall back to the default mode (chinneck).

Comparison:

Aspectsingle_cutmulti_cutchinneckstate_repairfarkas_recursive
Adds cut rows11 + per-slack1 + per-IIS-slack1 per moved reservoir1 aggregated
Extra LP solves per fcut001 (IIS re-fix)00
Relaxes installed fcut rowsnonononoyes (+z)
Convergence guaranteeStandard NBDStandard NBDStandard NBD (cut-based)PLP empirical§17.3 exact recursive
Best forSmall problemsPersistent infeasibilityGeneral use (default)PLP paritypoisoned-fcut kill chains

5.5 Cut CSV Format

Cut files use a CSV format with a header line and one row per cut. The format includes a type column and uses name-based coefficients for portability across LP structure changes:

# scale_objective=1000
type,phase,scene,name,rhs,coefficients
o,1,1,sddp_scut_1_1_3_0,-5000.0,Res1_efin=0.25,Res2_efin=0.75
f,1,1,sddp_fcut_1_1_3_1,-4800.0,Res1_efin=0.30
o,2,1,sddp_scut_1_2_4_0,-5100.0,Res1_efin=0.26
ColumnDescription
typeCut type: o = optimality, f = feasibility
phasePhase UID this cut was added to
sceneScene UID that generated this cut
nameCut identifier (encodes scene, phase, iteration, offset)
rhsRight-hand side in physical objective units
coefficientsVariable-coefficient pairs (see below)

Coefficient format: coefficients are written as comma-separated col_name=coeff pairs using LP column names (e.g., Reservoir1_efin=0.25). This name-based format is portable across runs where the LP column order may change. Values are stored in fully physical space (scaled by scale_objective and inverse column scales).

Backward-compatible loading: the loader also accepts the legacy col_index:coeff format (e.g., 42:0.25), where col_index is a 0-based LP column index. If a named column is not found in the current LP (due to structural changes), the coefficient is skipped with a warning.

5.6 Per-Scene Cut Files

When cuts_output_file is set, the solver saves both a combined cut file and per-scene files to avoid write contention during parallel backward passes. File names use scene UIDs (not 0-based indices):

cuts/
├── sddp_cuts.csv      # Combined cuts from all scenes
├── scene_1.csv         # Cuts generated by scene with UID 1
├── scene_2.csv         # Cuts generated by scene with UID 2
└── ...

Each per-scene file has the same CSV format as the combined file. This allows concurrent scene processing to write independently without locking. Cut files for infeasible scenes are automatically renamed with an error_ prefix (e.g. error_scene_2.csv).

The phase and scene columns in cut CSV files contain UIDs (matching the uid field in phase_array and scene_array), not 0-based C++ indices.

5.7 Infeasible Scene Handling

When one or more scenes are infeasible during the forward pass:

  1. Skip: the infeasible scene is excluded from lower/upper bound computation and from the backward pass.
  2. Save error LP: the infeasible LP is written to log_directory as error_scene_<UID>_phase_<UID>.lp for debugging (using scene and phase UIDs).
  3. Rename cut files: per-scene cut files for infeasible scenes are renamed with an error_ prefix (e.g. error_scene_0.csv) instead of being removed, preserving diagnostic data.
  4. Continue: the solver continues with remaining feasible scenes.
  5. Error: if all scenes are infeasible, the solver returns an error and gtopt_main exits with a non-zero exit code.

5.8 Hot-Start and Error File Filtering

Hot-start requires setting cut_recovery_mode (keep, append or replace) in sddp_options (CLI: --hot-start). When enabled, the solver loads cuts from the cut directory to warm-start the Benders approximation. If cuts_input_file is also set, it takes precedence as the source of hot-start cuts.

Files with the error_ prefix (from infeasible scenes in previous runs) are automatically skipped to prevent loading invalid cuts:

cuts/
├── sddp_cuts.csv        ← loaded (combined cuts)
├── scene_0.csv           ← loaded (valid scene)
├── scene_1.csv           ← loaded (valid scene)
├── error_scene_2.csv     ← SKIPPED (infeasible in previous run)
└── error_scene_3.csv     ← SKIPPED (infeasible in previous run)

The load_scene_cuts_from_directory() method handles this filtering. Only files matching scene_<N>.csv or sddp_cuts.csv are loaded.


6. Integration Tests

Three integration tests validate that the SDDP solver produces the same optimal solution as the monolithic solver. Each test exercises a different type of state-variable coupling between phases: reservoir volume, reservoir depletion dynamics, and capacity expansion. A fourth test validates scalability with a year-long 12-phase hydro simulation.

6.1 Reservoir Test (make_5phase_reservoir_planning)

System configuration:

  • 1 bus (single-bus / copper-plate mode)
  • 1 hydro generator: 50 MW, $5/MWh
  • 1 thermal generator: 200 MW, $80/MWh
  • 1 demand: 100 MW constant
  • 1 reservoir: 500 dam³ capacity, starts at 300 dam³
  • Natural inflow: 8 dam³/h via junction topology (2 junctions, 1 waterway, 1 turbine)

Time structure:

  • 5 phases × 1 stage each × 8 blocks of 3 hours = 120 hours total
  • 1 scenario, 1 scene

Expected behaviour: the reservoir carries water value across phases. The hydro generator displaces expensive thermal generation when water is available.

Results:

SolverTotal costPhase-0 objIterationsGap
Monolithic865,500155,1001 (single LP)—
SDDP865,500155,10050.000000

The SDDP solver converges to the exact monolithic solution in 5 iterations with zero gap.

6.2 Small Reservoir Test (make_5phase_small_reservoir_planning)

System configuration:

  • 1 bus (single-bus / copper-plate mode)
  • 1 hydro generator: 80 MW, $3/MWh
  • 1 thermal generator: 200 MW, $80/MWh
  • 1 demand: 100 MW constant
  • 1 small reservoir: 200 dam³ capacity, starts at 180 dam³
  • Low natural inflow: 5 dam³/h (reservoir depletes over time)

Time structure:

  • 5 phases × 1 stage each × 8 blocks of 3 hours = 120 hours total
  • 1 scenario, 1 scene

Expected behaviour: the reservoir is small relative to demand, so it depletes across phases. This creates non-trivial state-variable values at phase boundaries, forcing the SDDP cuts to properly capture the marginal water value.

Results:

SolverTotal costIterationsGap
Monolithic899,9401 (single LP)—
SDDP899,94050.000000

6.3 Expansion Test (make_5phase_expansion_planning)

System configuration:

  • 1 bus (single-bus / copper-plate mode)
  • 1 expandable generator: 0 MW initial capacity, 50 MW/module, max 10 modules, $80/MWh operating cost, $500/module-year investment
  • 1 backup generator: 200 MW, $200/MWh (expensive "peaker")
  • 1 demand: 100 MW constant

Time structure:

  • 5 phases × 1 stage each × 8 blocks of 3 hours = 120 hours total
  • 1 scenario, 1 scene

Expected behaviour: the expandable generator starts at 0 MW and must invest in capacity modules to displace the expensive backup. The capainst (installed-capacity) state variable links across phases, ensuring that capacity built in phase \(t\) is available in phase \(t+1\). The solver finds the optimal expansion plan that minimizes total discounted CAPEX + OPEX.

Results:

SolverTotal costIterationsGap
Monolithic960,6851 (single LP)—
SDDP960,68550.000000

6.4 Yearly Hydro Test (make_12phase_yearly_hydro_planning)

System configuration:

  • 1 bus (single-bus / copper-plate mode)
  • 1 hydro generator: 25 MW, $5/MWh
  • 1 thermal generator: 200 MW, $80/MWh
  • 1 demand: 50 MW constant
  • 1 reservoir: 150 dam³ capacity, starts at 100 dam³
  • Inflow: 10 dam³/h (constant; seasonal patterns can be added)
  • 12 phases × 1 stage × 24 hourly blocks = 288 blocks total

What it tests:

  • Scalability to a full year (12 monthly phases, each with a representative 24-hour day)
  • Reservoir state coupling across 12 consecutive phases
  • Convergence behaviour with a longer planning horizon

Expected behaviour: The monolithic solver solves all 12 phases jointly in one LP. The SDDP solver decomposes the problem into 12 monthly subproblems, building Benders cuts to approximate the future cost of water. Both should produce the same total cost (within 5% tolerance due to cut approximation).

6.5 Why the Results Match Exactly

For deterministic problems (single scenario, no stochastic uncertainty), the SDDP algorithm is equivalent to Benders decomposition on a deterministic multi-stage LP. With linear cost-to-go functions (no integer variables), the piecewise-linear approximation built by the Benders cuts converges to the exact cost-to-go function in a finite number of iterations [1][3]. The 5-phase test cases are small enough that convergence is achieved quickly.


7. Implementation Architecture

7.1 Key Classes

ClassFileRole
SDDPMethodsddp_method.hpp/cppCore SDDP algorithm
SDDPPlanningMethodsddp_method.hpp/cppPlanningMethod interface adapter
MonolithicMethodplanning_method.hpp/cppDefault full-LP solver
SolverMonitorsolver_monitor.hppBackground CPU/worker monitoring (SDDP + Monolithic)
PlanningLPplanning_lp.hpp/cppLP assembly and phase management
LinearInterfacelinear_interface.hpp/cppLP solver abstraction (COIN-OR)
AdaptiveWorkPoolwork_pool.hppParallel scene processing
ApertureDataCacheaperture_data_cache.hpp/cppPre-loaded aperture parquet data
build_effective_apertures()sddp_aperture.hpp/cppDeduplicate aperture UIDs
build_synthetic_apertures()sddp_aperture.hpp/cppGenerate apertures from scenarios
solve_apertures_for_phase()sddp_aperture.hpp/cppClone + update + solve per aperture

7.2 SolverMonitor

SolverMonitor is a reusable class that samples AdaptiveWorkPool statistics (CPU load, active worker count) in a background std::jthread and writes them to a JSON status file for external monitoring tools such as scripts/gtopt_monitor/gtopt_monitor.py.

Both SDDPMethod and MonolithicMethod create a local SolverMonitor during their solve() call.

Solver status file (solver_status.json) contains:

  • "version" (of the file layout), "timestamp", "elapsed_s", "status", "iteration"
  • "gtopt_version", "gtopt_revision": the gtopt build that wrote the file (version and git describe --always --dirty of its source tree, unknown outside a git checkout); also in solution.csv
  • "lower_bound", "upper_bound", "gap", "converged", "max_iterations"
  • "agreement_rewards", "upper_bound_net" (SDDP, latest iteration): the objective contribution of water-right rewards (FlowRight / VolumeRight columns priced with a positive uvalue, e.g. irrigation-agreement delivery values; always <= 0) and upper_bound − agreement_rewards, the UB as a pure cost. A uvalue-only kink counts only the flow beyond its target; fcost shortfall penalties and usage costs are not rewards. When non-zero, each iteration also logs SDDP Iter [iN]: ub=… agreement_rewards=… ub_net=….
  • "solver", "method": runtime solver identity and planning method
  • "history": per-iteration array with lower_bound, upper_bound, agreement_rewards, upper_bound_net, gap, converged, cuts_added, scene_upper_bounds, scene_lower_bounds
  • "phase_grid": per-(iteration, scene, phase) activity grid for TUI display
  • "async": async scene execution state (when max_async_spread > 0)
  • "realtime": rolling arrays of timestamps, cpu_loads, active_workers

Both SDDP and monolithic methods write to the same solver_status.json file.

"status" is initializing / running / converged while the solve is live. When an SDDP solve ends, one last write records the terminal state: converged, max_iterations (iteration budget exhausted without converging), stopped (stop request, sentinel file or callback) or error (a forward pass failed). The periodic monitor refresh never overwrites that final document. A simulation-only run (max_iterations = 0) writes no status file. Monolithic solves end with done.

The status file is written atomically (write to .tmp, then rename) to allow external tools to read it without seeing a partial write.

7.3 Free Functions

FunctionPurpose
propagate_trial_values()Fix dependent columns to source values
build_benders_cut()Construct optimality cut from reduced costs
relax_fixed_state_variable()Apply elastic relaxation to one column
share_cuts_for_phase()Broadcast multicut rows across scenes for a phase (sddp_cut_sharing.hpp)
parse_cut_sharing_mode()Parse "none" / "multicut" / "markov" to CutSharingMode (removed/unknown names throw)
parse_elastic_filter_mode()Parse "single_cut" / "multi_cut" / "chinneck" (and aliases) to ElasticFilterMode
weighted_average_benders_cut()Probability-weighted average of aperture cuts

7.4 LP Clone Pattern

The LinearInterface::clone() method (added for the SDDP elastic filter) uses OsiSolverInterface::clone(true) to create a deep copy of the LP state. This follows the PLP pattern in osicallsc.cpp where the elastic filter operates on a clone to avoid permanently modifying the original LP:

auto cloned = li.clone();          // Deep copy via OsiSolverInterface::clone()
relax_fixed_state_variable(cloned, link, phase, penalty);  // Modify clone
auto result = cloned.resolve(opts);  // Solve clone
auto rc = cloned.get_col_cost();     // Extract dual information
// Clone is destroyed when it goes out of scope.
// Original LP `li` is untouched.

For aperture backward-pass solves, each aperture task creates its own clone of the source LP inline via LinearInterface::clone() (see source/sddp_aperture.cpp). Clones live only inside the parallel worker task that consumes them and are destroyed when the task scope exits, so concurrent aperture solves never share LP state and there is no need for a cross-task clone cache.

7.5 Thread Safety

The SDDP solver uses two levels of cut storage:

  1. Per-scene storage (m_scene_cuts_): each scene writes its own vector without any mutex, preventing lock contention during parallel backward passes. Per-scene cut files (scene_N.csv) are written from this storage.
  2. Shared storage (m_stored_cuts_): protected by m_cuts_mutex_, used for cut sharing between scenes and the combined cut file.

Each scene has its own per-phase LP subproblems, so forward/backward passes for different scenes can proceed in parallel without LP-level locking.

When single_cut_storage is enabled, cuts are stored only in the per-scene vectors. The combined cut list for persistence is built on demand from the per-scene vectors, halving the memory cost of cut metadata.

7.6 Memory Management

Long SDDP runs accumulate Benders cuts as LP constraint rows that are never automatically deleted. The CLP solver's internal matrix grows monotonically, which can cause memory exhaustion. Several mechanisms mitigate this:

  1. Cut pruning (max_cuts_per_phase, cut_prune_interval, prune_dual_threshold): periodically removes inactive cuts (those with |dual| below the threshold) from each (scene, phase) LP via OsiSolverInterface::deleteRows(). A "base row count" is saved during initialization so structural constraints are never pruned.
  2. Stored cut capping (max_stored_cuts): limits the in-memory cut metadata per scene, dropping the oldest cuts when the cap is exceeded.
  3. Single cut storage (single_cut_storage): avoids duplicating cut metadata across per-scene and shared storage.
  4. Low-memory mode (low_memory_mode): controls how aggressively the per-(scene, phase) LP backend is released between solves.
    • off: an uncompressed FlatLinearProblem is kept per cell (aperture clones are built from it). Under SDDP / cascade the element LP wrappers that update_lp does not need are dropped after the build and rebuilt only for write-out, exactly as under compress (lp_matrix_options.drop_element_collections, default true; false keeps them resident). By default (sddp_options.release_backends = true) the backends are released after every solve as under compress, but the snapshot stays uncompressed (equivalent to compress + memory_codec = uncompressed). On CEN 2y with CPLEX this cuts the peak from 22.3 GiB to 3.7 GiB at the same wall time (within run-to-run noise); the bounds match compress exactly and differ from the live backends by ~0.025 % (degenerate ties). sddp_options.release_backends = false keeps every backend loaded for the whole run (the old off: maximum memory). Only the simplex basis (~30 KB per cell) carries the warm start across the release: the next solve rebuilds the LP from the snapshot, installs the saved basis (basis_cross_mode) and resumes with dual simplex.
    • compress (default for SDDP/cascade): backend released after every solve; the FlatLinearProblem is kept in memory — compressed (zstd level 1 by default, ~7× ratio) when the backend is released and decompressed on demand — and replayed on the next access via LinearInterface::reconstruct_backend(). Cuts the solver-resident memory. The scenes of one phase share the constraint matrix, costs and scales bit for bit and differ only in a few percent of the bounds, so the snapshots are deduplicated across scenes. Each phase keeps one shared compressed base, and every cell stores only the compressed XOR of its bytes against that base, which is empty when the two are identical. The restore is bit-exact. On the CEN 2-year case the per-cell delta is about 3% of a full snapshot. The codec is chosen by memory_codec. The default auto resolves to zstd level 1, about 30% smaller than lz4 on real snapshots. memory_codec = lz4 gives the fastest decompression.
    • snapshot (back-compat alias → compress with memory_codec = uncompressed): same release/replay behaviour, but the in-memory snapshot is left uncompressed.
    • rebuild (removed 2026-05-13): this mode formerly kept no snapshot and rebuilt each (scene, phase) LP lazily; it was removed. The JSON value "rebuild" is now a back-compat alias that parses to compress.

    Label metadata (the structural column / row labels that LP names are synthesised from) is kept only when names are requested (--lp-file, lp_debug, lp_error): with names off no cell keeps any, in either mode, and diagnostics fall back to c{i} / r{i} or "unlabeled" (lp_matrix_options.label_meta_without_names = true keeps it, as before). With names on, the LinearInterface and the retained flat LP share one copy instead of two (lp_matrix_options.share_label_meta = false restores the copy).

    Two more switches keep the previous behaviour reachable: sddp_options.release_after_alpha (default true: each low-memory backend is released right after α registration instead of after the whole initialisation) and sddp_options.free_solver_scratch (default true: under off, the CPLEX / Gurobi / MindOpt copy-out getter buffers are freed after each forward solve and each iteration).

  5. Warm-start pre-padding: forward-pass solution vectors are padded with zeros at save time so that set_warm_start_solution() can use a subspan instead of allocating a temporary vector every call.
  6. Monitor history cap: the SolverMonitor background sampling thread caps its history at 7200 entries (~1 hour at 500ms), dropping the oldest 25% when full.

8. Relationship to PLP

The GTOpt SDDP solver draws on concepts from the PLP hydrothermal scheduler [5][6] — whose hydrothermal-coordination method is summarised in §8.1 — the model now maintained by the Chilean system operator (CEN):

PLP conceptGTOpt equivalent
SDDP forward/backward iterationSDDPMethod::forward_pass() / backward_pass()
Elastic filter (osi_lp_get_feasible_cut)SDDPMethod::elastic_solve() via clone()
LP cloning (LPCont::get_lpi())LinearInterface::clone()
userstop filesentinel_file option in SDDPOptions
Cut file persistencesave_cuts() / load_cuts() in CSV format
scloning modeAlways-clone approach for elastic filter
Bound backpropagation from elastic filter(REMOVED — see note below)

PLP builds the feasibility cut on a temporary copy of the LP: it zeroes the original objective, adds elastic slack variables, solves for feasibility, extracts the dual ray and discards the copy. GTOpt's elastic_solve() follows the same pattern.

The BackpropagateBounds elastic filter mode (PLP-style direct bound update from the elastic-clone solution values) was supported in early versions of GTOpt but the implementation was deleted during the forward-pass-installs-fcuts refactor. The enum value was subsequently removed; legacy --set sddp_options.elastic_mode=backpropagate calls now silently fall back to the default mode (chinneck). See §5.4 for the currently-supported modes.

8.1 Hydrothermal coordination with non-convex irrigation rules

The hydrothermal-coordination method behind PLP, and therefore behind the gtopt SDDP solver, is described in Pereira-Bonvallet, Püschel-Løvengreen, Matus and Moreno [5]. The paper addresses the scheduling of a hydrothermal system whose large reservoirs also serve agriculture, with the prescribed water-sharing rules between the electricity and agriculture sectors of the Chilean Central Interconnected System (SIC).

  • Problem. Minimise the expected electricity production cost while delivering the volumes of water the agreements assign to irrigation. Irrigation agreements such as Laja make the extraction rights depend on the stored volume (volume zones), so the feasible set is non-convex.
  • Method. A sub-optimal SDDP approach: the stochastic multi-stage problem is decomposed with Benders cuts (§2) while the non-convex rules are handled inside the convex SDDP framework. The result is compared against a MILP formulation that captures the non-convexity exactly.
  • Findings. The SDDP-based approach yields feasible, near-optimal schedules whose cost is close to the MILP optimum. The near-optimal policy, however, tends to keep lower stored volumes than the MILP optimum, which can reduce security of supply.

How the agreements map to gtopt elements (VolumeRight, FlowRight, RightBoundRule, user constraints) is documented in the irrigation agreements modelling guide. The paper's caveat on stored volumes is the reason to check reservoir trajectories, not only the cost bounds, when an SDDP run includes volume-dependent irrigation rules.

A related study, Matus, Toro and Püschel-Løvengreen (ICSP 2016), adds binary and linear security constraints to SDDP to model the Ralco reservoir operation that avoids landslide events; see publications.

8.2 Cut-coefficient extraction: why we removed the row_dual mode

Context. Until 2026-04, SDDPMethod supported two ways of extracting Benders-cut coefficients at the end of a backward solve:

  1. reduced_cost (kept, now the only mode) — build the cut directly from the reduced costs of the dependent columns that implement the inter-phase state transition. By strong duality, when a dependent column is fixed at the trial value v̂ᵢ of its source variable, the reduced cost at optimum equals the dual multiplier of that fixing constraint. The cut is α ≥ z* + Σ rcᵢ·(xᵢ − v̂ᵢ).
  2. row_dual (removed) — explicitly add one coupling row per state variable to the phase LP (xᵢ − dependentᵢ = 0), solve, and read the row duals πᵢ to build α ≥ z* + Σ πᵢ·(xᵢ − v̂ᵢ). This mirrors the PLP implementation and the broader CEPEL family (PSR SDDP, NEWAVE, DECOMP, SUISHI).

Why row_dual was removed.

  • Mathematical redundancy. For an LP at optimum, the reduced cost of a column fixed to v̂ᵢ and the row dual of an equivalent fixing row are identical (both equal the Lagrange multiplier of the fixing constraint). The two modes produced cuts that differed only by floating-point noise. The equivalence is well-known — see Birge & Louveaux §5.1 [16], Shapiro §3 [4], and Dowson §3.2 [15].
  • Cost asymmetry. row_dual requires mutating the LP (adding one row per state variable before each solve and removing it after), which invalidates the solver's basis and warm-start caches and inflates the constraint matrix. reduced_cost reads a value the solver already computes — it is strictly free after resolve().
  • Literature survey. Modern SDDP implementations use the reduced-cost formulation exclusively:
ImplementationCut coefficient sourceReference
SDDP.jl (Dowson)reduced cost of state-in columns[15]
FAST / MSPPyreduced cost[17]
SDDiP (Zou, Ahmed, Sun)reduced cost / Lagrangian2019
SINTEF EMPSreduced costWolfgang et al. 2009
Philpott & Guan analysisreduced cost[7]
Shapiro textbook derivationreduced cost[4][16]

The row_dual formulation is a PLP/CEPEL dialect — it appears in the Brazilian operational-planning tool chain (PSR SDDP, NEWAVE, DECOMP, SUISHI, and the Chilean PLP derivative) because those codes predate modern LP solver APIs that expose reduced costs reliably on fixed columns. It is not referenced in the peer-reviewed SDDP algorithmics literature outside that lineage.

  • Numerical behaviour. Both modes converge to the same lower bound on well-posed problems. The former SDDPMethod — reduced_cost and row_dual produce same objective test (removed with this change) verified this empirically on a 2-phase linear planning problem.
  • PLP cut-file interoperability is preserved. The boundary_cuts.csv format generated by PLP stores only the final numeric coefficients (πᵢ, α₀) — it has no field identifying how they were computed. By strong duality, PLP's πᵢ and GTOpt's rcᵢ are the same number at optimum, so the existing name-based loader in source/sddp_cut_io.cpp handles PLP-generated cut files unchanged.

Consequences of the removal.

  • SddpOptions::cut_coeff_mode, the CutCoeffMode enum, the build_benders_cut_from_row_duals() / propagate_trial_values_row_dual() free functions, the StateVarLink::coupling_row field, and the --sddp-cut-coeff-mode CLI flag (plus JSON key and bash completion) are all gone.
  • PhaseStateInfo::forward_row_dual is kept solely as a warm-start hint for the next backward solve; it is no longer consumed by cut construction.
  • The StateVariable runtime slot holds col_sol() (trial value) and reduced_cost() (cut coefficient). There is no row_dual() slot — the former std::optional<double> placeholder was dropped before the final removal because every downstream consumer would have needed a sentinel branch.

If a future requirement demands a PLP-verbatim dual path (e.g. for bit-exact comparison with a running PLP instance during migration), the cleanest reintroduction would be a standalone plp_compat reader in scripts/plp2gtopt that converts PLP's solver logs to reduced-cost form once, not a dual extraction mode inside the solver.


9. References

[1] J. F. Benders, "Partitioning procedures for solving mixed-variables programming problems," Numerische Mathematik, vol. 4, pp. 238–252, 1962. DOI: 10.1007/BF01386316

[2] A. M. Geoffrion, "Generalized Benders decomposition," Journal of Optimization Theory and Applications, vol. 10, no. 4, pp. 237–260, 1972. DOI: 10.1007/BF00934810

[3] M. V. F. Pereira and L. M. V. G. Pinto, "Multi-stage stochastic optimization applied to energy planning," Mathematical Programming, vol. 52, pp. 359–375, 1991. DOI: 10.1007/BF01582895

[4] A. Shapiro, "Analysis of stochastic dual dynamic programming method," European Journal of Operational Research, vol. 209, no. 1, pp. 63–72,

  1. DOI: 10.1016/j.ejor.2010.08.007

[5] E. Pereira-Bonvallet, S. Püschel-Løvengreen, M. Matus, and R. Moreno, "Optimizing hydrothermal scheduling with non-convex irrigation constraints: case on the Chilean electricity system," Energy Procedia, vol. 87, pp. 132–140, 2016. DOI: 10.1016/j.egypro.2015.12.342

[6] M. V. F. Pereira, "Optimal stochastic operations scheduling of large hydroelectric systems," International Journal of Electrical Power & Energy Systems, vol. 11, no. 3, pp. 161–169, 1989. DOI: 10.1016/0142-0615(89)90025-2

[7] A. Philpott and Z. Guan, "On the convergence of stochastic dual dynamic programming and related methods," Operations Research Letters, vol. 36, no. 4, pp. 450–455, 2008. DOI: 10.1016/j.orl.2008.01.013

[8] V. L. de Matos, A. B. Philpott, and E. C. Finardi, "Improving the performance of stochastic dual dynamic programming," Journal of Computational and Applied Mathematics, vol. 290, pp. 196–208, 2015. DOI: 10.1016/j.cam.2015.04.048

[9] T. Homem-de-Mello, V. L. de Matos, and E. C. Finardi, "Sampling strategies and stopping criteria for stochastic dual dynamic programming: a case study in long-term hydrothermal scheduling," Energy Systems, vol. 2, pp. 1–31, 2011. DOI: 10.1007/s12667-011-0024-y

[10] B. Stott, J. Jardim, and O. Alsaç, "DC power flow revisited," IEEE Transactions on Power Systems, vol. 24, no. 3, pp. 1290–1300, 2009. DOI: 10.1109/TPWRS.2009.2021235

[11] R. Romero and A. Monticelli, "A hierarchical decomposition approach for transmission network expansion planning," IEEE Transactions on Power Systems, vol. 9, no. 1, pp. 373–380, 1994. DOI: 10.1109/59.317588

[12] S. Lumbreras and A. Ramos, "The new challenges to transmission expansion planning. Survey of recent practice and literature review," Electric Power Systems Research, vol. 134, pp. 19–29, 2016. DOI: 10.1016/j.epsr.2015.10.013

[13] J. Forrest and R. Lougee-Heimer, "CBC User Guide," in Emerging Theory, Methods, and Applications, INFORMS, pp. 257–277, 2005. DOI: 10.1287/educ.1053.0020

[14] M. P. Buitrago Villada, C. E. García Bujanda, E. Sierra Baeza, and M. Matus, "Optimal Expansion and Reliable Renewable Energy Integration in Long-Term Planning Using FESOP," 2022 IEEE Kansas Power and Energy Conference (KPEC), pp. 1–6, 2022. DOI: 10.1109/KPEC54747.2022.9814781. Open access: ResearchGate.

[15] O. Dowson and L. Kapelevich, "SDDP.jl: a Julia package for stochastic dual dynamic programming," INFORMS Journal on Computing, vol. 33, no. 1, pp. 27–33, 2021. DOI: 10.1287/ijoc.2020.0987

[16] J. R. Birge and F. Louveaux, Introduction to Stochastic Programming, 2nd ed. New York: Springer, 2011. DOI: 10.1007/978-1-4614-0237-4

[17] S. Rebennack, "Combining sampling-based and scenario-based nested Benders decomposition methods: application to stochastic dual dynamic programming," Mathematical Programming, vol. 156, pp. 343–389, 2016. DOI: 10.1007/s10107-015-0884-3

[18] V. Zverovich, C. I. Fabian, E. F. D. Ellison, and G. Mitra, "A computational study of a solver system for processing two-stage stochastic LPs with enhanced Benders decomposition," Mathematical Programming Computation, vol. 4, pp. 211–238, 2012. DOI: 10.1007/s12532-012-0038-z


10. Cascade Solver — Multi-Level Hybrid Solver

For full cascade solver documentation, see Cascade Method.

The Cascade solver (method = "cascade") is a multi-level hybrid algorithm that progressively refines the LP formulation and solver strategy across a variable number of levels. It accelerates convergence by starting with a simplified network model (e.g. single bus, no Kirchhoff) and gradually adding complexity, transferring solution information between levels via optimality cuts.

10.1 Multi-Level Architecture

The cascade solver executes a sequence of levels defined in the cascade_options.level_array array. Each level has:

  • name — human-readable identifier (for logging).
  • model_options — LP construction overrides (use_single_bus, use_kirchhoff, use_line_losses, kirchhoff_threshold, loss_segments, scale_objective, scale_theta, demand_fail_cost, reserve_fail_cost). When present, a fresh PlanningLP is built. When absent, the previous level's LP is reused.
  • sddp_options — per-level solver settings (max_iterations, min_iterations, apertures, convergence_tol). Absent fields inherit from the global sddp_options.
  • transition — how to receive information from the previous level (optimality-cut inheritance).

LP rebuild rule: when model_options is present (even if all its fields match the previous level), the LP is rebuilt from scratch. When absent, the previous level's LP and solver state are reused, allowing a level to change only solver parameters (e.g. enable apertures) without the cost of LP reconstruction.

Named transfer: optimality cuts use LP column names (e.g. Reservoir1_efin) for cross-LP resolution. This allows cuts generated with one LP structure (e.g. single-bus) to be applied to a different LP structure (e.g. multi-bus with Kirchhoff), as long as the state-variable columns share the same names.

If the solver converges at any level, it returns immediately without proceeding to subsequent levels.

10.2 Built-in Default Levels

When cascade_options.level_array is empty (or omitted), a built-in 4-level default is used:

LevelNameLPSolverTransition
0uninodal_bendersSingle bus, no Kirchhoff, no lossesBenders only (no apertures)–
1transport_bendersMulti-bus, no Kirchhoff, no lossesBenders onlyInherits optimality cuts from level 0
2transport_sddpReuses level 1 LPSDDP with aperturesInherits optimality cuts from level 1
3full_sddpKirchhoff + line lossesSDDP with aperturesInherits optimality + feasibility cuts

This default progression moves from a fast coarse approximation to the full network model, transferring solution information at each step.

10.3 Level Configuration

Each level in level_array can contain three optional sub-objects.

model_options — LP Formulation

Controls how the LP is constructed for this level. When present, a fresh PlanningLP is built. When absent, the previous level's LP is reused. Only set fields override the global model_options; absent fields inherit from the global configuration.

FieldTypeDefaultDescription
use_single_busboolfalseAggregate all buses into one
use_kirchhoffbooltrueEnable DC power flow (voltage angles)
use_line_lossesboolfalseModel resistive line losses
kirchhoff_thresholdreal0.0Min bus voltage [kV] for Kirchhoff
loss_segmentsint1Piecewise-linear loss segments
scale_objectivereal1000Divisor for objective coefficients
scale_thetarealautoVoltage-angle enlargement: θ_LP = scale_theta · θ (rad); auto = 1/(3·median(X/V²)); 1 = radians; 1000 = milliradians
demand_fail_costreal1000Penalty for unserved demand [$/MWh]
reserve_fail_costreal1000Penalty for unserved reserve [$/MWh]

Note: annual_discount_rate has moved to the simulation section. For backward compatibility, it is still accepted in model_options.

sddp_options — Per-Level Solver Parameters

FieldTypeDefaultDescription
max_iterationsintfrom global sddp_optionsMax training iterations for this level
min_iterationsintfrom global sddp_optionsMin iterations before convergence
aperturesarray of UIDsfrom global sddp_optionsAperture UIDs (empty = Benders only)
convergence_tolrealfrom global sddp_optionsConvergence tolerance

transition — Transfer from Previous Level

Controls how information from the previous level is carried forward. Level 0 has no transition (it is the starting point).

FieldTypeDefaultDescription
inherit_optimality_cutsint00 = do not inherit; -1 = inherit and keep forever; N > 0 = inherit, then forget after N training iterations

10.4 Configuration Example

Cascade options are set in their own cascade_options sub-object in the JSON configuration (not inside sddp_options). The global sddp_options provide defaults that individual levels can override.

2-level cascade — uninodal warm-start followed by full network:

{
  "options": {
    "method": "cascade",
    "model_options": {
      "use_kirchhoff": true,
      "demand_fail_cost": 5000
    },
    "sddp_options": {
      "max_iterations": 50,
      "convergence_tol": 0.001
    },
    "cascade_options": {
      "level_array": [
        {
          "name": "uninodal",
          "model_options": {
            "use_single_bus": true,
            "use_kirchhoff": false
          },
          "sddp_options": {
            "max_iterations": 15,
            "convergence_tol": 0.01
          }
        },
        {
          "name": "full_network",
          "model_options": {
            "use_single_bus": false,
            "use_kirchhoff": true
          },
          "sddp_options": {
            "max_iterations": 50,
            "convergence_tol": 0.001
          },
          "transition": {
            "inherit_optimality_cuts": true
          }
        }
      ]
    }
  }
}

Reusing the LP — a level without model_options reuses the previous level's LP and solver state. This is useful when you want to change solver parameters (e.g. enable apertures) without rebuilding:

{
  "options": {
    "method": "cascade",
    "sddp_options": {
      "max_iterations": 30,
      "convergence_tol": 0.01
    },
    "cascade_options": {
      "level_array": [
        {
          "name": "benders_warm_start",
          "model_options": {
            "use_single_bus": true,
            "use_kirchhoff": false
          },
          "sddp_options": {
            "max_iterations": 10
          }
        },
        {
          "name": "sddp_with_apertures",
          "sddp_options": {
            "max_iterations": 20,
            "apertures": [1, 2, 3]
          },
          "transition": {
            "inherit_optimality_cuts": true
          }
        }
      ]
    }
  }
}

To use the built-in 4-level default, simply omit level_array (or set it to an empty array):

{
  "options": {
    "method": "cascade",
    "sddp_options": {
      "max_iterations": 30,
      "convergence_tol": 0.01
    },
    "cascade_options": {}
  }
}

10.5 Iteration Budget

Each level has its own max_iterations budget (from its sddp_options or from the global sddp_options default). The global cascade_options.sddp_options.max_iterations serves as the global iteration budget across all levels. Per-level sddp_options.max_iterations controls iterations within each level.

If a level exhausts its budget without converging, the cascade proceeds to the next level. If the final level exhausts its budget, the solver reports non-convergence.


11. See Also