Asee peer logo

Using A Scripting Language For Dynamic Programming

Download Paper |


2008 Annual Conference & Exposition


Pittsburgh, Pennsylvania

Publication Date

June 22, 2008

Start Date

June 22, 2008

End Date

June 25, 2008



Conference Session

Programming for Engineering Students I

Tagged Division

Computers in Education

Page Count


Page Numbers

13.1325.1 - 13.1325.8



Permanent URL

Download Count


Request a correction

Paper Authors

author page

Louis Plebani Lehigh University

Download Paper |

NOTE: The first page of text has been automatically extracted and included below in lieu of an abstract

Using a Scripting Language for Dynamic Programming


In this paper we present a simple programming framework that can be used in teaching Dynamic Programming at an introductory level. The target audience for the framework is the student in an introduction to dynamic programming setting who possesses rudimentary programming skills. The framework takes advantage of the late binding features of the Python scripting language to allow students to model their problem with somewhat arbitrary data types and and to subsequently solve without worrying about more complex computer programming issues.


Dynamic programming (DP) is a versatile technique for modeling and solving sequential optimization problems. While the approach is well known to the operations research community, its impact has been limited when compared to other mathematical programming techniques such as linear programming. Ironically, in part, this has been due to its flexibility. Because DP can be adapted to a myriad of problems and those models can be implemented in a variety of ways, many modelers, particulary inexperienced ones, are overwhelmed by the large number of choices. This is often referred to as the “art” of dynamic programming. Our goal was to provide a framework and base computer code for students to achieve an ease of modeling and solution for dynamic programming similar to what has been achieved for linear programming. In so far as the teaching dynamic programming, this will allow educators in operations research to focus their teaching on issues relevant to dynamic programming as opposed to computer programming issues; and allow students in operations research to focus their learning on the power of dynamic programming, as opposed to the nuances of computer implementations.

Since the formulation of Dynamic programming (DP) by Bellman,1 it has been successfully applied to a variety of problems, including capacity planning, equipment replacement, production planning, production control, assembly line balancing and capital budgeting. Despite seemingly successful, dynamic programming has not been adapted nearly as readily, and thus successfully, as its mathematical programming counterparts such as linear and integer programming. Some of the reasons for this are the lack of standardization in representing dynamic programs and the lack of available software to aid implementation. The problem is exacerbated when an instructor attempts to introduce dynamic programming into an introductory level course because many students in these courses have not achieved the programming skill level required to program the problem specific solvers in a reasonable time efficient manner. Inevitable student frustration leads to limited experience and a decrease in learning. The standardized framework contained herein is an attempt to address these shortcomings.

Plebani, L. (2008, June), Using A Scripting Language For Dynamic Programming Paper presented at 2008 Annual Conference & Exposition, Pittsburgh, Pennsylvania. 10.18260/1-2--4378

ASEE holds the copyright on this document. It may be read by the public free of charge. Authors may archive their work on personal websites or in institutional repositories with the following citation: © 2008 American Society for Engineering Education. Other scholars may excerpt or quote from these materials with the same citation. When excerpting or quoting from Conference Proceedings, authors should, in addition to noting the ASEE copyright, list all the original authors and their institutions and name the host city of the conference. - Last updated April 1, 2015