StructDualDynProg.jl Documentation
This packages aims at providing an implementation of SDDP that is both efficient and modular/flexible. It features the following:
Support for unfeasible problem by generating a feasibility cut.
Support for unbounded problem by using an unbounded ray.
Support for a variety of cut pruning algorithm through the CutPruners package.
Support for any linear or conic solvers available through MathProgBase; see JuliaOpt's webpage for a list.
Support modeling the problem using the StructJuMP modeling interface.
Support specifying the problem using a low-level interface. This is used for example by the EntropicCone package.
The SDDP
algorithm can be run from any node of the lattice of problems using the following function:
StructDualDynProg.SDDP
— Method.SDDP(sp, num_stages; K, stopcrit, verbose, pathsampler, ztol, stopatinf, mergepaths, forwardcuts, backwardcuts)
Runs the SDDP algorithms on the stochastic program given by sp
. The algorithm will do iterations until stopcrit
decides to stop or when the root node is infeasible. In each iterations, K
paths will be explored up to num_stages
stages. The paths will be selected according to pathsampler
and equivalent paths might be merged if their difference is smaller than ztol
and mergepaths
is true. The parameter ztol
is also used to check whether a new cut is useful. When a scenario is infeasible and stopatinf
is true then no other scenario with the same ancestor is run. Note that since the order in which the different scenarios is run is not deterministic, this might introduce nondeterminism even if the sampling is deterministic. By default, the cuts are added backward. However, if forwardcuts
is set to true
and backwardcuts
is set to false
the cuts are added forward.
This lattice can be built from a StructJuMP model using the following function:
StructDualDynProg.stochasticprogram
— Method.stochasticprogram(m::JuMP.Model, num_stages, solver,
pruningalgo::CutPruners.AbstractCutPruningAlgo,
cutgen::AbstractOptimalityCutGenerator=MultiCutGenerator(),
detectlb::Bool=true, newcut::Symbol=:InvalidateSolver)
Creates a StochasticProgram
from a StructJuMP model. The former can then be used by the SDDP algorithm. The master problem is assumed to have model m
and the scenarios are considered up to num_stages
stages. The pruningalgo
is as defined in CutPruners. If cutgen
is MultiCutGenerator
, one variable θ_i
is created for each scenario. Otherwise, if cutgen
is AveragedCutGenerator
, only one variable θ
is created and it represents the expected value of the objective value of the scenarios. If cutgen
is NoOptimalityCut
then no θ
is created, only use this option if the objective of all models is zero except for the master model.