25-Introduction To Dynamic Programming-08-03-2024
25-Introduction To Dynamic Programming-08-03-2024
In dynamic programming problems, decision variables vary with time, and these
situations are called to be dynamic in nature.
Dynamic programming splits the original large problem (which involves many
variables) into many sub-problems involving few variables. This technique is called as
recursive optimization.
Bottom-Up(Dynamic Programming):
Stage decision: At each stage there are number of alternatives and the selection of one
of the most suitable and feasible alternative is called stage decision.
State Variables: The variables whose value specify the condition of decision process
and summarize the current status of the system are called state variables.
Decision Variables: The unknown in the given problem that needed to be determined
are called decision variables.
Procedures adopted in Dynamic Programming
Decide whether to follow the forward or the backward method to solve the problem.
Make the tabular presentation to show the required values and calculations for each
stage.
Find the optimal policy at each stage and then the overall optimal policy.
Formulation of Dynamic Programming
Formulation of Dynamic Programming (Contd.)
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Principle of Optimality
Example 1- Resource Allocation - Dynamic Programming
A firm has divided its marketing area in to three zones. The amount of sales depends upon the number of salesmen in
each zone. The firm has been collecting the data regarding sales and salesmen in each area over a number of past
years.
The information is summarised in below Table in thousands of rupees. For the next year firm has only 9 salesmen
and the problem is to allocate these salesmen to three different zones so that the sales are maximum.
Find out the number of medical teams to be allocated in each country so that the total years of life of a person are
maximum.
The maximum cargo load is restricted to 17. How many units of each item be loaded to maximize the value?
Example 2- Cargo loading- Dynamic Programming
Max Z = 4𝑖=1 𝑎𝑖 𝑝𝑖
Subject to
4
𝑖=1 𝑎𝑖 𝑤𝑖 ≤W
Example 2- Cargo loading- Dynamic Programming
𝑊 17
Stage 1: Here 𝑤1 = 1 kg/unit, 𝑝𝑖 = Rs 1 /unit; = =17 Let 𝑓1 (𝑥1 ), 𝑓2 (𝑥2 ), 𝑓3 (𝑥3 ) and 𝑓4 (𝑥4 )
𝑤1 1
i.e. 𝑎1 = 0, 1, 2, 3, ….., 17 be the values of the loaded items at
stage 1,2,3, 4 respectively.
𝑊 17
Stage 2: Here 𝑤2 = 3 kg/unit, 𝑝2 = Rs 5 /unit; = =5.67
𝑤2 3
≌5
i.e. 𝑎2 = 0, 1, 2, 3, 4, 5
𝑊 17
Stage 3: Here 𝑤3 = 4 kg/unit, 𝑝3 = Rs 7 /unit; = =4.25
𝑤3 4
≌4
i.e. 𝑎3 = 0, 1, 2, 3, 4
𝑊 17
Stage 4: Here 𝑤4 = 6 kg/unit, 𝑝4 = Rs 11 /unit; = =2.83
𝑤4 6
≌2
i.e. 𝑎4 = 0, 1, 2
Example 2- Cargo loading- Dynamic Programming
Example 2- Cargo loading- Dynamic Programming
Example 2- Cargo loading- Dynamic Programming
Example 2- Cargo loading- Dynamic Programming
Example 2- Cargo loading- Dynamic Programming
Example 2- Cargo loading- Dynamic Programming
Optimal Solution: (2units of item 4 +1 unit of item 3+1 unit of item 1) & Max.value = 30