Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Stopping Rules

Purpose

This spec defines the available stopping rules for the Cobre SDDP solver, their configuration, and how they combine. It covers iteration limits, time limits, bound stalling, and the recommended simulation-based stopping criterion.

1 Available Stopping Rules

SDDP can terminate based on multiple criteria. Each rule is evaluated independently, and the stopping_mode determines how they combine:

  • "any": Stop when any rule triggers (OR logic)

  • "all": Stop when all rules trigger (AND logic)

2 Iteration Limit (Mandatory)

Configuration:

{ "type": "iteration_limit", "limit": 50 }

Evaluation:

where is the current iteration and is the limit.

Purpose: Safety bound to prevent infinite loops. Must always be included.

3 Time Limit

Configuration:

{ "type": "time_limit", "seconds": 3600 }

Evaluation:

Wall-clock time is checked at the end of each iteration.

4 Bound Stalling

Configuration:

{
  "type": "bound_stalling",
  "iterations": 10,
  "tolerance": 0.0001
}

Evaluation:

Track the deterministic lower bound over iterations. Compute relative improvement over a window of iterations (the iterations parameter):

Stopping condition:

Interpretation: The bound has plateaued — the relative improvement over the last iterations is below the specified tolerance, indicating diminishing returns from further iterations.

Risk-averse note: Under risk-averse formulations (e.g., CVaR), the lower bound may not be a valid bound in the classical sense. Bound stalling still detects convergence of the outer approximation, but the gap interpretation changes. See Risk Measures for details.

Configuration:

{
  "type": "simulation",
  "replications": 100,
  "period": 20,
  "bound_window": 5,
  "distance_tol": 0.01,
  "bound_tol": 0.0001
}
ParameterDescription
replicationsNumber of Monte Carlo forward simulations to run
periodCheck every this many iterations
bound_windowNumber of past iterations over which to measure bound stability
distance_tolThreshold for normalized distance between consecutive simulation results
bound_tolRelative tolerance for bound stability check

Algorithm:

  1. Check bound stability first:

    where is the bound_window parameter.

  2. If bound is stable, run replications Monte Carlo simulations using the current policy. Compute per-stage total costs and compare to the previous simulation’s costs :

    The comparison metric is the mean per-stage cost across replications. Future extensions may compare other quantities (e.g., state variable trajectories or decision variable distributions).

  3. Stopping condition:

Interpretation: Both the outer approximation (bound) and the policy (simulated costs) have stabilized.

Why recommended: Combines a theoretical convergence indicator (bound) with practical policy quality (simulation), avoiding premature termination from statistical noise.

Risk-averse note: For risk-averse problems, the bound stability check monitors convergence of the risk-adjusted outer approximation. The simulation comparison remains valid since it measures policy stability directly, independent of bound interpretation. See Risk Measures.

Partial Implementation: The current implementation is a stub that compares simulation costs against a zero baseline rather than consecutive simulation snapshots. Specifically, when simulation_costs are available, the distance is computed as against zero, which is conservative: it never triggers on the first evaluation and only triggers when per-stage costs are themselves near zero. The planned full version (targeted for a future epic) will store the previous simulation’s cost vector and compute the distance between consecutive snapshots as described above ( vs ). The convergence monitor is responsible for managing the two-snapshot comparison externally.

Additionally, the bound stability pre-check (Phase 1) is not yet implemented: the bound_tol and bound_window parameters are parsed from configuration but currently discarded – the rule skips directly to the simulation distance comparison. Until Phase 1 is implemented, the rule may evaluate simulations even when the bound is still actively improving, which is conservative (wastes simulation time) but not incorrect.

6 Combining Rules

Mode: "any" (default):

First rule to trigger causes termination.

Mode: "all":

All rules must trigger simultaneously.

Example (conservative setup):

{
  "stopping_rules": [
    { "type": "iteration_limit", "limit": 500 },
    {
      "type": "simulation",
      "replications": 100,
      "period": 20,
      "bound_window": 5,
      "distance_tol": 0.01,
      "bound_tol": 0.0001
    }
  ],
  "stopping_mode": "any"
}

This runs until simulation-based convergence OR 500 iterations, whichever comes first.

7 Output on Termination

When any stopping rule triggers, the output includes:

FieldDescription
stopping_ruleWhich rule triggered
final_iterationIteration count at termination
lower_boundFinal deterministic lower bound
upper_boundFinal simulated upper bound (if available)
gapOptimality gap:

Cross-References