Home

PySP

PySP, or Python Stochastic Programming, is a component of the Pyomo optimization framework designed for modeling and solving stochastic programming problems that are represented by scenario trees. It focuses on two-stage and multi-stage problems in which decisions are made under uncertainty and evaluated across multiple scenarios with given probabilities.

The package provides tools to define scenario trees, assign probabilities, and connect them to a Pyomo template

PySP supports different solution approaches, including decomposition-based algorithms such as Progressive Hedging and the L-shaped method,

Usage: a user constructs a scenario tree (or a generator), writes a Pyomo model that defines decisions

Development and availability: PySP is open-source and maintained as part of the Pyomo project. It integrates

model
that
expresses
the
deterministic
subproblems
for
each
scenario.
The
solver
process
typically
involves
a
master
problem
for
first-stage
decisions
and
scenario-specific
subproblems
for
later
stages,
unified
by
the
probability-weighted
objective
and
linking
constraints.
as
well
as
scenario
reduction
and
sampling
techniques
to
manage
large
numbers
of
scenarios.
It
can
generate
a
single
reformulated
stochastic
program
or
operate
in
a
decomposed
fashion
during
solving.
across
stages,
and
uses
PySP
to
solve
by
invoking
a
solver
on
the
generated
stochastic
program.
Result
summaries
include
first-stage
decisions
and
scenario-dependent
decisions
and
costs.
with
common
optimizers
such
as
CPLEX,
Gurobi,
and
open-source
solvers,
and
is
documented
on
the
Pyomo
website
and
GitHub.