Home

StructDualDynProg.jl Documentation

This packages aims at providing an implementation of SDDP that is both efficient and modular/flexible. It features the following:

The packages is built on top of StochOptInterface (SOI). It implements an representation of stochastic programming implementing SOI in the StructProg submodule and provides the following function for transforming a StructJuMP model into an instance of this representation:

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 AvgCutGenerator, 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.

This packages also provides an implemention of the SDDP algorithm that can be run on any stochastic program implementing the SOI interface:

struct Algorithm{ST<:AbstractPathSampler}
    K::Int
    verbose::Int
    pathsampler::ST
    ztol::Float64
    stopatinf::Bool
    mergepaths::Bool
    forwardcuts::Bool
    backwardcuts::Bool
end

SDDP algorithm exploring K paths per iteration 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.

Contents