Abstract
Although stochastic programming is a powerful tool for modeling decision-making under uncertainty, various impediments have historically prevented its wide-spread use. One factor involves the ability of non-specialists to easily express stochastic programming problems as extensions of their deterministic counterparts, which are typically formulated first. A second factor relates to the difficulty of solving stochastic programming models, particularly in the mixed-integer, non-linear, and/or multi-stage cases. Intricate, configurable, and parallel decomposition strategies are frequently required to achieve tractable run-times on large-scale problems. We simultaneously address both of these factors in our PySP software package, which is part of the Coopr open-source Python repository for optimization; the latter is distributed as part of IBM’s COIN-OR repository. To formulate a stochastic program in PySP, the user specifies both the deterministic base model (supporting linear, non-linear, and mixed-integer components) and the scenario tree model (defining the problem stages and the nature of uncertain parameters) in the Pyomo open-source algebraic modeling language. Given these two models, PySP provides two paths for solution of the corresponding stochastic program. The first alternative involves passing an extensive form to a standard deterministic solver. For more complex stochastic programs, we provide an implementation of Rockafellar and Wets’ Progressive Hedging algorithm. Our particular focus is on the use of Progressive Hedging as an effective heuristic for obtaining approximate solutions to multi-stage stochastic programs. By leveraging the combination of a high-level programming language (Python) and the embedding of the base deterministic model in that language (Pyomo), we are able to provide completely generic and highly configurable solver implementations. PySP has been used by a number of research groups, including our own, to rapidly prototype and solve difficult stochastic programming problems.
Similar content being viewed by others
References
AIMMS: Optimization software for operations research applications. http://www.aimms.com/operations-research/mathematical-programming/stochastic-programming, July (2010)
Alonso-Ayuso A., Escudero L.F., Ortuño M.T.: BFC, a branch-and-fix coordination algorithmic framework for solving some types of stochastic pure and mixed 0-1 programs. Eur. J. Oper. Res. 151(3), 503–519 (2003)
AMPL: A modeling language for mathematical programming. http://www.ampl.com, July (2010)
Badilla, F.: Problema de Planificación Forestal Estocástico Resuelto a Traves del Algoritmo Progressive Hedging. PhD thesis, Facultad de Ciencias Físicas y Matemáticas, Universidad de Chile, Santiago, Chile (2010)
Bertsekas D.P.: Constrained Optimization and Lagrange Multiplier Methods. Athena Scientific, Massachusetts (1996)
Birge J.R.: Decomposition and partitioning methods for multistage stochastic linear programs. Oper. Res. 33, 989–1007 (1985)
Birge J.R., Dempster M.A., Gassmann H.I., Gunn E.A., King A.J., Wallace S.W.: A standard input format for multiperiod stochastic linear program. COAL (Math. Prog. Soc. Commun. Algorithms) Newsletter 17, 1–19 (1987)
Birge J.R., Louveaux F.: Introduction to Stochastic Programming. Springer, Berlin (1997)
Carøe C.C., Schultz R.: Dual decomposition in stochastic integer programming. Oper. Res. Lett. 24(1–2), 37–45 (1999)
Chen D.-S., Batson R.G., Dang Y.: Applied Integer Programming. Wiley, New York (2010)
COIN-OR: COmputational INfrastructure for Operations Research. http://www.coin-or.org, July (2010)
CPLEX: http://www.cplex.com, July (2010)
Crainic, T.G., Fu, X., Gendreau, M., Rei, W., Wallace, S.W.: Progressive hedging-based meta-heuristics for stochastic network design. Technical report CIRRELT-2009-03, University of Montreal CIRRELT, January (2009)
Fan Y., Liu C.: Solving stochastic transportation network protection problems using the progressive hedging-based method. Netw. Spatial Econ. 10(2), 193–208 (2010)
FLOPCPP: Flopc++: Formulation of linear optimization problems in C++. http://www.projects.coin-or.org/FlopC++, August (2010)
Fourer R., Gay D.M., Kernighan B.W.: AMPL: a mathematical programming language. Manage. Sci. 36, 519–554 (1990)
Fourer R., Lopes L.: A management system for decompositions in stochastic programming. Ann. Oper. Res. 142, 99–118 (2006)
Fourer R., Lopes L.: StAMPL: a filtration-oriented modeling tool for multistage recourse problems. INFORMS J. Comput. 21(2), 242–256 (2009)
Fourer R., Ma J., Martin K.: OSiL: an instance language for optimization. Comput. Optim. Appl. 45(1), 181–203 (2010)
FrontLine: Frontline solvers: developers of the Excel solver. http://www.solver.com, July (2011)
GAMS: The General Algebraic Modeling System. http://www.gams.com, July (2010)
Gassmann H.I.: MSLiP: a computer code for the multistage stochastic linear programming problem. Math. Program. 47, 407–423 (1990)
Gassmann H.I., Ireland A.M.: On the formulation of stochastic linear programs using algebraic modeling languages. Ann. Oper. Res. 64, 83–112 (1996)
Gassmann H.I., Schweitzer E.: A comprehensive input format for stochastic linear programs. Ann. Oper. Res. 104, 89–125 (2001)
GUROBI: Gurobi optimization. http://www.gurobi.com, July (2010)
Hart W.E., Laird C.D., Watson J.P., Woodruff D.L.: Pyomo: Optimization Modeling in Python. Springer, Berlin (2012)
Hart, W.E., Siirola, J.D.: The PyUtilib component architecture. Technical report, Sandia National Laboratories (2010)
Hart W.E., Watson J.P., Woodruff D.L.: Python optimization modeling objects (Pyomo). Math. Program. Comput. 3, 219–260 (2011)
Helgason T., Wallace S.W.: Approximate scenario solutions in the progressive hedging algorithm: a numerical study. Ann. Oper. Res. 31(1–4), 425–444 (1991)
Huang, Y.: Sustainable Infrastructure System Modeling under Uncertainties and Dynamics. PhD thesis, Department of Civil and Environmental Engineering, University of California, Davis (2010)
Hvattum L.M., Løkketangen A.: Using scenario trees and progressive hedging for stochastic inventory routing problems. J. Heurist. 15(6), 527–557 (2009)
Jorjani S., Scott C.H., Woodruff D.L.: Selection of an optimal subset of sizes. Int. J. Prod. Res. 37(16), 3697–3710 (1999)
Kall, P., Mayer, J.: Building and solving stochastic linear programming models with SLP-IOR. In: Wallace, S.W., Ziemba, W.T. (eds.) Applications of Stochastic Programming, pp. 79–93. MPS-SIAM (2005)
Kall P., Mayer J.: Stochastic Linear Programming: Models, Theory, and Computation. Springer, Berlin (2005)
Karabuk, S.: An open source algebraic modeling and programming software. Technical report, University of Oklahoma, School of Industrial Engineering, Norman (2005)
Karabuk S.: Extending algebraic modeling languages to support algorithm development for solving stochastic programming models. IMA J. Manage. Math. 19, 325–345 (2008)
Karabuk S., Grant F.H.: A common medium for programming operations-research models. IEEE Softw. 24(5), 39–47 (2007)
LINDO: LINDO systems, August (2010)
Listes O., Dekker R.: A scenario aggregation based approach for determining a robust airline fleet composition. Transport. Sci. 39, 367–382 (2005)
Løkketangen A., Woodruff D.L.: Progressive hedging and tabu search applied to mixed integer (0,1) multistage stochastic programming. J. Heurist. 2, 111–128 (1996)
Maximal Software: http://www.maximal-usa.com/maximal/news/stochastic.html, July (2010)
Parija G.R., Ahmed S., King A.J.: On bridging the gap between stochastic integer programming and mip solver technologies. INFORMS J. Comput. 16, 73–83 (2004)
PYRO: Python remote objects. http://pyro.sourceforge.net, July (2009)
Python: Python programming language—official website. http://python.org, July (2010)
Dive Into Python: http://diveintopython.org/power_of_introspection/index.html, July (2010)
Rockafellar R.T., Wets R.J.-B.: Scenarios and policy aggregation in optimization under uncertainty. Math. Oper. Res. 16(1), 119–147 (1991)
Schultz R., Tiedemann S.: Conditional value-at-risk in stochastic programs with mixed-integer recourse. Math. Program. 105(2–3), 365–386 (2005)
Shapiro, A., Dentcheva, D., Ruszczynski, A.: Lectures on stochastic programming: modeling and theory. Society for Industrial and Applied Mathematics (SIAM) (2009)
SMI: SMI. http://www.projects.coin-org.org/Smi, August (2010)
SUTIL: SUTIL—a stochastic programming utility library. http://www.coral.ie.lehigh.edu/~sutil, July (2011)
Thénié J., van Delft Ch., Vial J.-Ph.: Automatic formulation of stochastic programs via an algebraic modeling language. Comput. Manage. Sci. 4(1), 17–40 (2007)
Valente C., Mitra G., Sadki M., Fourer R.: Extending algebraic modelling languages for stochastic programming. INFORMS Journal On Computing 21(1), 107–122 (2009)
Valente, P., Mitra, G., Poojari, C.A.: A stochastic programming integrated environment. In: Wallace, S.W., Ziemba, W.T. (eds.) Applications of Stochastic Programming, pp. 115–136. MPS-SIAM (2005)
Van Slyke R.M., Wets R.J.-B.: L-shaped linear programs with applications to optimal control and stochastic programming. SIAM J. Appl. Math. 17, 638–663 (1969)
Wallace, S.W., Ziemba, W.T. (eds.): Applications of Stochastic Programming. Society for Industrial and Applied Mathematics (SIAM) and the Mathematical Programming Society (MPS) (2005)
Watson J.P., Woodruff D.L.: Progressive hedging innovations for a class of stochastic mixed-integer resource allocation problems. Comput. Manage. Sci. 8(4), 355–370 (2011)
Woodruff D.L., Zemel E.: Hashing vectors for tabu search. Ann. Oper. Res. 41(2), 123–137 (1993)
Word, D.P., Burke, D.A., Iamsirithaworn, D.S., Laird, C.D.: A nonlinear programming approach for estimation of transmission parameters in childhood infectious disease using a continuous time model. J. R. Soc. Interface (Under Review)
Xpress-Mosel. http://www.dashopt.com/home/products/products_sp.html, July (2010, to appear)
XpressMP: FICO express optimization suite. http://www.fico.com/en/products/DMTools/pages/FICO-Xpress-Optimization-Suite.aspx, July (2010)
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Watson, JP., Woodruff, D.L. & Hart, W.E. PySP: modeling and solving stochastic programs in Python. Math. Prog. Comp. 4, 109–149 (2012). https://doi.org/10.1007/s12532-012-0036-1
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s12532-012-0036-1