Dyanamic Programing
Dyanamic Programing
Dyanamic Programing
Introduction
• Dynamic programming is a useful mathematical technique for making a sequence of
interrelated decisions.
• It provides a systematic procedure for determining the optimal combination of decisions.
• In contrast to linear programming, there does not exist a standard mathematical
formulation of “the” dynamic programming problem.
• Rather, dynamic programming is a general type of approach to problem solving, and the
particular equations used must be developed to fit each situation.
• Therefore, a certain degree of ingenuity and insight into the general structure of dynamic
programming problems is required to recognize when and how a problem can be solved
by dynamic programming procedures.
• These abilities can best be developed by an exposure to a wide variety of dynamic
programming applications and a study of the characteristics that are common to all these
situations.
• The technique is useful in a large number of multi-period business problems, such as
(a) smoothing production employment,
(b) allocating capital funds,
(c) Allocating salespeople to marketing areas, and (d) evaluating investment
opportunities.
Definition
the mathematical technique of optimizing a sequence of inter-related decisions over a
period of time is called dynamic programming.
(1) First, there is no algorithm (like the simplex method) that can be programmed to solve all
problems. Instead, dynamic programming is a technique that allows a difficult problem to be
broken down into a sequence of easier sub-problems, which are then evaluated by stages. (2)
Second, linear programming is a method that gives single-stage (i.e., one-time period) solutions.
Dynamic programming has the power to determine the optimal solution over a one year time
horizon by breaking the problem into 12 smaller one-month horizon problems and to solve each
of these optimally. Hence, it uses a multistage approach.
Dynamic Programming uses the backward recursive method for solving the problems
Bellman’s Principle of Optimality Bellman’s principle of optimality is the principle which
guides the solution of a problem using dynamic programming.
It states:
1
Regardless of the decisions taken to enter a particular state in a particular stage,
the remaining decisions made for leaving that stage must constitute an optimal
policy”
2. Solve the last stage of the problem for all possible conditions or states.
3. Working backward from that last stage, solve each intermediate stage.
4. Obtain the optimal solution for the original problem by solving all stages sequentially.
2. State variables: possible beginning situations or conditions of a stage. These have also
been called the input variables.
5. Optimal policy: a set of decision rules, developed as a result of the decision criteria, that
gives optimal decisions for any entering condition at any stage.
Find the shortest path from City 1 to City 10 in the diagram shown below using
the recursive principle of Dynamic Programming.
2
Solution
Stage 1
• There is only one path from node (8) to node (10). The distance of (8) – (10) = 6.
• Therefore, label node (8) with 6. Indicate the segment (8) –(10) with a *
• There is only one path from node (9) to node (10). The distance of (9) – (10) = 7.
therefore, label node (9) with 7. Indicate the segment (9) –(10) with a *
3
Stage 3 from node (2)
• There are three paths from (2) to (10) viz., (2)-(5), (2)-(6) and (2)-(7)
• Distance of path (2)-(5) = Length of (2)-(5) + Label of (5) = 4 +10 = 14
• Distance of path (2)-(6) = Length of (2)-(6) + Label of (6) = 2 + 13 = 15
• Distance of path (2)-(7) = Length of (2)-(7) + Label of (7) = 5 + 8 = 13
• Therefore label of (2) = Min {14, 15, 13} = 13. Indicate (2) –(7) with a *
4
SIMULATION
INTRUDCTION
A simulation of a system is the operation of a model. The model can be reconfigured and
experimented with; The operation of the model can be studied, and hence, properties
concerning the behaviour of the actual system or its subsystem.
In its broadest sense, simulation is a tool to evaluate the performance of a system, existing or
proposed, under different configurations of interest and over long periods of real time.
Simulation is used before an existing system is altered or a new system built, to reduce the
chances of failure to meet specifications, to eliminate unforeseen bottlenecks, to prevent
under or overutilization of resources, and to optimize system performance.
Advantages of simulation
New policies, operating procedures, information flows and son on can be explored without
disrupting ongoing operation of the real system.
New hardware designs, physical layouts, transportation systems and … can be tested
without committing resources for their acquisition.
Insight can be obtained about interaction of variables and important variables to the
performance.
Bottleneck analysis can be performed to discover where work in process, the system is
delayed.
5
Disadvantages of simulation
Model building requires special training.
- Vendors of simulation software have been actively developing packages that contain
models that only need input (templates).