Dynamic Programming
Dynamic Programming
Introduction:
State-2: The condition of the decision process at a stage is called its state.
The variables which specify the condition of the decision process, i.e.,
describe the status of the system at a particular stage are called state
variables. The number of state variables should be as small as possible,
since larger the number of state variables, more complicated is the
decision process.
1
an optimal policy with regard to the state resulting from the first
decision." This principle implies that a wrong decision taken at a stage
does not prevent form taking optimal decisions for the remaining stages.
Stage -1
Stage -2
Stage -3
Stage: The points at which decisions called. as stages. Each stage for are
referred to as stages. Each stage can be thought of having beginning and
2
an end. The different stages come in a sequence, with the ending of a
stage marking the beginning of the immediately succeeding stage.
State: The variable that tit links up two stages is called a state variable. -
any stage, the status of the problem can be described by the values the
state variable can take. These values. are reffered to as states.
While, solving and state the problem we use the concepts of stage and
state. Moreover, the problem is solved stage by stage and to ensure that
suboptimal solution does not result, we cumulated the objective function
value in a particular way.
Working backwards, for every stage, we found the decisions in that stage
that will allow us to reach the final destination optimally, starting from
each of the states of the stage.
3
The dynamic programming approach removes these difficulties by:
* First breaking each problems and the problem into st small en sub sub
problem is referred to a stage.
Characteristic of D. P. Problem:
2. Every stages, consists of number of states associated with it. The stages
are the different associated with it possible conditions in which the
system may find itself at the stage of the problem.
3. Decision at each stage converts the current stage into state associated
with the next stage.
5. When the current state is known an optimal policy for the remaining
stages is independent of the policy of the previous ones.
6. The solution procedure begins finding the optimal policy for each state
to the last stage.
4
8. Using recursive equation approach each time the solution procedure
moves backward stage for the particular stage fill it attains the optimum
policy beginning at the initial stage.
Step1: Identify the decision variables and specify the objective function
to be optimized under certain limitations if any.
Step3: Write down the general recursive relationship for computing the
optimal policy. Decide whether forward or backward method is to be
followed to solve the problem.
Step5: Determine the overall optimal policy on decisions and its value at
each. "There may be more than such optimal policy".
Home Work:
1.
Minimize Z= y 21 + y 22+ y 23
Subject to y 1 + y 2 + y 3=10
5
0 ≤ y1 ≤ 1 0
At stage-2.
f 2 ( x 2 )=min ( y 22 +f ¿1 ( x 2− y 2 )2 )
0 ≤ y 2 ≤ 10
The computations for 2nd stage are shown below, where the minimum
f 2 ( x 2 ) values are identified by asterisks.
y1 y1
2
0 1 2 3 4 5 6 7 8 9 10
y2 y2
2
0 1 2 3 4 5 6 7 8 9 10
¿ ¿
0 0 0 1 4 9 16 25 36 49 64 81 100
¿ ¿ ¿
1 1 1 2 5 10 17 26 37 50 65 82
¿ ¿
2 4 4 5 8 13 20 29 40 53 68
¿ ¿ ¿
3 9 9 10 13 18 25 34 45 58
¿ ¿ ¿
4 16 16 17 20 25 32 41 52
¿
5 25 25 26 29 34 41 50
6 36 36 37 40 45 52
7 49 49 50 53 58
8 64 64 65 68
9 81 81 82
1 100 10
0 0
6
x2 0 1 2 3 4 5 6 7 8 9 10
¿
f 2 ( x2 ) 0 1 2 5 8 13 1 25 3 41 50
8 2
¿
At stage-3, f 3 ( x 3 )=min¿
=min ( y 3∨f 2 ( x 3− y 3 ) )
2 ¿ 2
x3 0 1 2 3 4 5 6 7 8 9 10
x 3− y 3 10 9 8 7 6 5 4 3 2 1 0
2
y3 0 1 4 9 16 25 3 49 64 8 100
6 1
¿
f 2 ( x 3− y3 ) 50 41 3 25 18 13 8 5 2 1 0
2
¿ ¿
f 3 ( x 3) 50 42 3 34 34 38 4 54 66 8 100
6 4 2
¿
f 3 ( x 3 ) =3 4 for y ¿3=3∨4
¿ ¿
For y 3=3 , f 2 ( x 2 )=25, for which y 1=3 and y 2=4
{ y 1 , y 2 , y 3 }= (3 ,3 , 4 ) , ( 3 , 4 , 3 ) ,(4 ,3 , 3).
2.
7
Use dynamic programming to solve
Maximize Z= x 21+ 2 x 22 +4 x3
Subject to x 1+ 2 x 2 + x3 ≤ 8
And x 1 , x 2 , x 3 ≥ 0 .
f 3 ( y3 ) =m ax x {4 x3 + f 2 ( y 2 ) }
3
f 2 ( y 2 ) =max x {2 x 22 +f 1 ( y 1 ) }
2
2 2
And f 1 ( y 1 ) =max x {x 1 }=x 1
1
¿ 2
∴ f 1 ( y 1 )=x 1
Since, y 1= y 2−2 x 2
2
And f 1 ( y 1 ) =x1
2 2
Differentiating 2 x 2+ ( y 2−2 x 2 ) w.r.t. x 2 and equating with zero.
y3
4 x 2−4 ( y 2−2 x 2 ) =0∴ x 2=
3
¿ 2 2 1 2
So, f 2 ( y 2 ) =2 x 2 + ( y 2−2 x 2 ) = 3 y 2
516 page and 517 page…. Kindly ektu dheken… ami khubi osustho.
8
R lecture er math…. Ja amr kce nai…