Lecture 8 Dynamic Programming
Lecture 8 Dynamic Programming
1 8/16/2017
Introduction
In most practical problems, decisions have to be made
sequentially at different points in time, at different
points in space, and at different levels, say, for a system
and/or a subsystem.
2 8/16/2017
As applied to dynamic programming, a multistage
decision process is one in which a number of single-stage
processes are connected in series so that the output of one
stage is the input of the succeeding stage.
3 8/16/2017
Example of A serial Multistage decision problem
8/16/2017
Dynamic programming (DP) is a useful mathematical
technique ideally suited for the optimization of sequential
decision problems (multistage decision problems).
8 8/16/2017
Example of A single stage decision problem
9 8/16/2017
Example
For instance, take the case of maximizing a monthly
(variable) yield for a reservoir of known capacity.
Assume further that there are n-months of historic (or
synthetic) flow records.
10 8/16/2017
DP, on the other hand, approaches the problem from a
different angle.
11 8/16/2017
Thus, decision is made at each stage; in the present
example, at each month.
This sequential decision process can be shown as in the
following figure:
r1 r2 ri rN-1 rN
S3 Si+1
S1 S2 Si
1 2 i N-1 N
d1 d2 di dN-1 dN
12 8/16/2017
Terminologies
14 8/16/2017
Types of Multistage Decision Problems
16 8/16/2017
DP solution is based on Bellman’s principle
of optimality
Bellman’s principle of optimality state that
Given the current state of a system, the optimal policy
(Sequence of decisions) for the remaining stages is independent
of the policy adopted in the previous stages.
17 8/16/2017
Bellman’s principle of optimality
8/16/2017 18
Recursive nature of computations in DP
Computations in DP are done recursively, so that the optimum
solution of one sub problem is used as an input to the next
sub problem.
8/16/2017 19
Characteristics of a DP problem
A single n-variable problem is divided into n number
of single variable problems.
A problem is divided into stages, with a policy
decision required at each stage.
Each stage has a number of possible states associated
with it.
The policy decision transforms the current state into a
state associated with the next stage.
A recursive relationship identifies the optimal
decision at a given stage for a specific state, given the
optimal decision for each state at the previous stage.
A solution moves backward or forward, stage by stage
20 till optimal decision for the last stage is found. 8/16/2017
21 8/16/2017
22 8/16/2017
Example 1. Shortest route problem
Suppose that you want to select the shortest highway route
between two cities. The network in the Figure below shows
the possible routes between the starting city at node 1 and
the destination city at node 7. The routes pass through
intermediate cities designated by nodes 2 to 6.
8/16/2017 23
Solution
1. We can solve this problem by exhaustively
enumerating all the routes between node 1 and 7 (there
are five such routes). But in a large network exhaustive
enumeration may be difficult computationally. Thus,
another method of solution is required. DP is the most
suitable technique for such type of problems.
8/16/2017 25
Solution using DP : Points that should be noted
1. The problem is decomposed into three stages
2. At each stage a decision is made.
3. The solution to the problem is found recursively. there
are two ways – beginning at the left most node and
moving from left to right, called the forward-moving
(but backward-looking) algorithm, or beginning at the
most right column of nodes or states and moving from
right to left, called the backward-moving (but
forward-looking) algorithm.
First we will see the forward recursion and then we will
see the backward recursion.
Go to solution
8/16/2017 26
Example 2. Water Allocation problem
8/16/2017 27
28 8/16/2017
Go to solution
Exercises
1.
8/16/2017 29
2. A minimum-cost pipeline is to be laid
between points (towns) A and E. The
pipeline is required to pass through one
node out of B1, B2, and B3, one out of
C1, C2, and C3, and one out of D1, D2,
and D3 (see Fig. below). The costs
associated with the various segments of
the pipeline are given below:
8/16/2017 30
8/16/2017 31
8/16/2017 32