1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.

Slides:



Advertisements
Similar presentations
Dynamic Programming 25-Mar-17.
Advertisements

Algorithm Design Methods Spring 2007 CSE, POSTECH.
Dynamic Programming Rahul Mohare Faculty Datta Meghe Institute of Management Studies.
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS ST. EDWARD’S UNIVERSITY.
1 1 Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri.
1 1 Slide © 2001 South-Western College Publishing/Thomson Learning Anderson Sweeney Williams Anderson Sweeney Williams Slides Prepared by JOHN LOUCKS QUANTITATIVE.
Dynamic Programming In this handout A shortest path example
1 Inventory Control for Systems with Multiple Echelons.
Deterministic Dynamic Programming.  Dynamic programming is a widely-used mathematical technique for solving problems that can be divided into stages.
1 1 Slide © 2006 Thomson South-Western. All Rights Reserved. Slides prepared by JOHN LOUCKS St. Edward’s University.
Greedy vs Dynamic Programming Approach
MIT and James Orlin © Dynamic Programming 2 –Review –More examples.
1 1 Slide LINEAR PROGRAMMING Introduction to Sensitivity Analysis Professor Ahmadi.
Chapter 10 Dynamic Programming. 2 Agenda for This Week Dynamic Programming –Definition –Recursive Nature of Computations in DP –Forward and Backward Recursion.
LINEAR PROGRAMMING: THE GRAPHICAL METHOD
Chapter 3 An Introduction to Linear Programming
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
1 1 Slide LINEAR PROGRAMMING: THE GRAPHICAL METHOD n Linear Programming Problem n Properties of LPs n LP Solutions n Graphical Solution n Introduction.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS ST. EDWARD’S UNIVERSITY.
Linear Programming: Basic Concepts
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Dynamic Programming Key characteristic of a Dynamic Program: Breaking up a large, unwieldy problem into a series of smaller, more tractable problems. Shortest.
ECES 741: Stochastic Decision & Control Processes – Chapter 1: The DP Algorithm 31 Alternative System Description If all w k are given initially as Then,
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
D Nagesh Kumar, IIScOptimization Methods: M5L2 1 Dynamic Programming Recursive Equations.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1. Introduction to D.P D.P : Method of finding optimal solution as a sequence of decisions.
1 1 Slide © 2001 South-Western College Publishing/Thomson Learning Anderson Sweeney Williams Anderson Sweeney Williams Slides Prepared by JOHN LOUCKS QUANTITATIVE.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Operational Research & ManagementOperations Scheduling Economic Lot Scheduling 1.Summary Machine Scheduling 2.ELSP (one item, multiple items) 3.Arbitrary.
Tuesday, April 30 Dynamic Programming – Recursion – Principle of Optimality Handouts: Lecture Notes.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
D Nagesh Kumar, IIScOptimization Methods: M6L5 1 Dynamic Programming Applications Capacity Expansion.
1 Inventory Control with Time-Varying Demand. 2  Week 1Introduction to Production Planning and Inventory Control  Week 2Inventory Control – Deterministic.
Thursday, May 2 Dynamic Programming – Review – More examples Handouts: Lecture Notes.
Dynamic Programming.  Decomposes a problem into a series of sub- problems  Builds up correct solutions to larger and larger sub- problems  Examples.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
LINEAR PROGRAMMING.
Prepared by Dr.Osman Taylan
D Nagesh Kumar, IIScOptimization Methods: M5L1 1 Dynamic Programming Introduction.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
Introduction and Preliminaries D Nagesh Kumar, IISc Water Resources Planning and Management: M4L1 Dynamic Programming and Applications.
1 Dynamic Programming Chapter 3. Learning Objectives 2 After completing this chapter, students will be able to: 1.Understand the overall approach of dynamic.
© 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 2 Linear Programming Chapter 3 3 Chapter Objectives –Requirements for a linear programming model. –Graphical representation of linear models. –Linear.
St. Edward’s University
Water Resources Planning and Management Daene McKinney
Algorithm Design Methods
Dynamic Programming General Idea
Chapter 3 Dynamic Programming.
Dynamic Programming and Applications
Dynamic Programming General Idea
Algorithm Design Methods
Algorithm Design Methods
Chapter 1. Formulations.
Algorithm Design Methods
Algorithm Course Dr. Aref Rashad
Presentation transcript:

1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University

2 2 © 2003 Thomson  /South-Western Slide Chapter 18 Dynamic Programming n Dynamic Programming Overview n Dynamic Programming Notation n Backwards Recursion n 3 Applications of Dynamic Programming n A Production and Inventory Control Problem

3 3 © 2003 Thomson  /South-Western Slide Dynamic Programming n Dynamic programming (DP) is an approach to problem solving which permits decomposing of the original problem into a series of several smaller subproblems. n To successfully apply DP, the original problem must be viewed as a multistage decision problem. n Defining the stages of a DP problem is sometimes obvious, but at other times this requires subtle reasoning.

4 4 © 2003 Thomson  /South-Western Slide Dynamic Programming n The power of DP is that one need solve only a small portion of all subproblems, due to Bellman's principle of optimality. n Bellman’s principle states that regardless of what decisions were made at previous stages, if the decision to be made at stage n is to be part of an overall optimal solution, then the decision made at stage n must be optimal for all remaining stages.

5 5 © 2003 Thomson  /South-Western Slide Dynamic Programming Notation n At each stage, n, of the dynamic program, there is: a state variable, x n a state variable, x n an optimal decision variable, d n an optimal decision variable, d n n For each value of x n and d n at stage n, there is: a return function value, r n ( x n, d n ) a return function value, r n ( x n, d n ) n The output of the process at stage n is: the state variable for stage n- 1, x n- 1 the state variable for stage n- 1, x n- 1 x n- 1 is calculated by a stage transformation function, t n ( x n, d n ) x n- 1 is calculated by a stage transformation function, t n ( x n, d n ) n The optimal value function, f n ( x n ), is the cumulative return starting at stage n in state x n and proceeding to stage 1 under an optimal strategy.

6 6 © 2003 Thomson  /South-Western Slide n Generally, a dynamic programming problem is solved by starting at the final stage and working backwards to the initial stage, a process called backwards recursion. n The following recursion relation can be used to operationalize the principle of optimality: f n ( x n ) = MAX { r n ( x n, d n ) + f n -1 ( t n ( x n, d n ))} f n ( x n ) = MAX { r n ( x n, d n ) + f n -1 ( t n ( x n, d n ))} d n d n n A problem is solved beginning at stage 0 with the boundary condition f 0 ( x 0 ) = 0, and working backwards to the last stage, N. Backwards Recursion

7 7 © 2003 Thomson  /South-Western Slide Three Applications of Dynamic Programming Problems n Shortest Route Problem In solving a shortest route problem using dynamic programming, one should consider the network as a series of stages with a unique subset of nodes corresponding to each stage. The state variables correspond to the different nodes at each stage.

8 8 © 2003 Thomson  /South-Western Slide Three Applications of Dynamic Programming Problems n Knapsack or Cargo Loading Problem The knapsack problem seeks to determine the optimal number of each of N items (which must not be fractional) to select in order to maximize profit subject to an overall capacity constraint. In solving a knapsack problem using dynamic programming, the stages correspond to the different items being placed into a knapsack. The state variables correspond to the capacity available at the stage.

9 9 © 2003 Thomson  /South-Western Slide Three Applications of Dynamic Programming Problems n Production and Inventory Control Problems In production and inventory control problems, the stages correspond to time periods and the state variables generally will refer to the amounts of inventory on hand at the beginning of each stage.

10 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Production and Inventory Control Problem Dicom Corporation wishes to determine a production schedule for its new Model 44/12 robotic welder. Because of differences in parts availability and spare production capacity, the cost of producing the machines will vary from month to month. The holding cost for each unsold welder still in inventory at the end of the month is $500,000. Corporate policy dictates that the maximum number of welders allowed in inventory at the end of any month is 8. Additional data appears on the next slide.

11 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation Cost of Maximum Cost of Maximum Production Production Sales Production Production Sales Per Machine Level Demand Per Machine Level Demand Month (in $100,000's) for Month (in Units) Month (in $100,000's) for Month (in Units) August August September September October October November November Determine an optimal 4-month production schedule for the Model 44/12 welder.

12 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n 4-Stage Dynamic Programming Problem Working backwards, let stage 1 correspond to November, stage 2 to October, etc. The following data (costs in $100,000's) can be inferred: Product. Holding Product. Holding Product. Storage Cost Cost Product. Storage Cost Cost Month Dem. Capacity Capacity Per Unit Per unit Month Dem. Capacity Capacity Per Unit Per unit ( n ) D n P n W n C n H n ( n ) D n P n W n C n H n

13 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n State Variable Defined x n = number of computers in inventory at the beginning of month n. x n = number of computers in inventory at the beginning of month n. x 4 = 0 (Since the computer is new, there will be no inventory at the start of August.) x 4 = 0 (Since the computer is new, there will be no inventory at the start of August.) n Decision Variable Defined d n = production quantity for month n. d n = production quantity for month n.

14 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Stage Transformation Function Then the stage transformations for months 0 through 4 can be defined by: Then the stage transformations for months 0 through 4 can be defined by: (Previous month's inventory) (Previous month's inventory) + (Production this month) + (Production this month) - (Demand this month) - (Demand this month) x n- 1 = x n + d n - D n x n- 1 = x n + d n - D n

15 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Return Function r n ( x n, d n ) = (Production cost) + (Holding cost) for month n Production cost = (Production cost per unit) x (Number of units produced in month n ) Holding cost = (Holding cost per unit) x (Ending inventory for month n ) x (Ending inventory for month n ) Hence, r n ( x n, d n ) = C n d n + H n ( x n + d n - D n )

16 © 2003 Thomson  /South-Western Slide n Return Function (continued) r n ( x n, d n ) = C n d n + H n ( x n + d n - D n ) r n ( x n, d n ) = C n d n + H n ( x n + d n - D n ) This gives: r 1 ( x 1, d 1 ) = 50 d x This gives: r 1 ( x 1, d 1 ) = 50 d x r 2 ( x 2, d 2 ) = 31 d x r 2 ( x 2, d 2 ) = 31 d x r 3 ( x 3, d 3 ) = 23 d x r 3 ( x 3, d 3 ) = 23 d x r 4 ( x 4, d 4 ) = 37 d x 4 – 10 r 4 ( x 4, d 4 ) = 37 d x 4 – 10 Example: Dicom Corporation

17 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Restrictions on x n and d n Restriction (1) Restriction (1) Because backordering is not allowed, we must be able to meet the sales demand in any month. x n + d n > D n x n + d n > D n

18 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Restrictions on x n and d n (continued) Restriction (2) Restriction (2) Because there is a maximum storage of W n at each stage n, the total inventory at the end of any month cannot exceed W n. x n + d n - D n < W n x n + d n - D n < W n or or x n + d n < W n + D n x n + d n < W n + D n

19 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Restrictions on x n and d n (continued) Restriction (3) Restriction (3) The amount produced in any given month cannot exceed the production capacity for that month. d n < P n d n < P n

20 © 2003 Thomson  /South-Western Slide n Optimal Value Function f n ( x n ) = optimal return (minimal cost) for stages 1 through n given one starts stage n with x n welders in inventory f n ( x n ) = Min { r n ( x n, d n ) + f n -1 ( x n -1 )} f n ( x n ) = Min { r n ( x n, d n ) + f n -1 ( x n -1 )} d n d n where d n is constrained by restrictions (1), (2), and (3). where d n is constrained by restrictions (1), (2), and (3). Example: Dicom Corporation

21 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Stage 1 (November) Because f 0 ( x 0 ) = 0 is a boundary condition: Because f 0 ( x 0 ) = 0 is a boundary condition: f 1 ( x 1 ) = Min r 1 ( x 1, d 1 ) f 1 ( x 1 ) = Min r 1 ( x 1, d 1 ) d 1 d 1 Using the expression for r 1 ( x 1, d 1 ) and restrictions (1), (2), (3): Using the expression for r 1 ( x 1, d 1 ) and restrictions (1), (2), (3): f 1 ( x 1 ) = Min 5 x d f 1 ( x 1 ) = Min 5 x d s.t. x 1 + d 1 > 3 (1) s.t. x 1 + d 1 > 3 (1) x 1 + d 1 < 11 (2) x 1 + d 1 < 11 (2) d 1 < 5 (3) d 1 < 5 (3) and, d 1 > 0 and, d 1 > 0

22 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Tabulated Values for 50 d 1 +5 x 1 –15 d 1 d 1 x d 1 * f 1 ( x 1 ) x d 1 * f 1 ( x 1 ) Note: Having x 1 > 3 would result in having welders in inventory at the end of November which is undesirable. Note: Having x 1 > 3 would result in having welders in inventory at the end of November which is undesirable.

23 © 2003 Thomson  /South-Western Slide n Stage 2 (October) f 2 ( x 2 ) = Min 5 x d f 1 ( x 1 ) f 2 ( x 2 ) = Min 5 x d f 1 ( x 1 ) d 2 d 2 Given the restrictions, the subproblem is: Given the restrictions, the subproblem is: f 2 ( x 2 ) = Min 5 x d f 1 ( x 2 + d 2 - 5) f 2 ( x 2 ) = Min 5 x d f 1 ( x 2 + d 2 - 5) s.t. x 2 + d 2 > 5 (1) s.t. x 2 + d 2 > 5 (1) x 2 + d 2 < 13 (2) x 2 + d 2 < 13 (2) d 2 < 4 (3) d 2 < 4 (3) and d 2 > 0 and d 2 > 0 Example: Dicom Corporation

24 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Tabulated Values for 5 x d f 1 ( x 1 ) d 2 d 2 x d 2 * f 2 ( x 2 ) x 2 + d 2 *-5 = x 1 x d 2 * f 2 ( x 2 ) x 2 + d 2 *-5 = x Note: x 2 = 0 is infeasible.

25 © 2003 Thomson  /South-Western Slide n Stage 3 (September) f 3 ( x 3 ) = Min 5 x d f 2 ( x 2 ) d 3 f 3 ( x 3 ) = Min 5 x d f 2 ( x 2 ) d 3 Given the restrictions, the subproblem is: Given the restrictions, the subproblem is: f 3 ( x 3 ) = Min 5 x d f 2 ( x 3 + d 3 - 1) f 3 ( x 3 ) = Min 5 x d f 2 ( x 3 + d 3 - 1) s.t. x 3 + d 3 > 1 (1) s.t. x 3 + d 3 > 1 (1) x 3 + d 3 < 9 (2) x 3 + d 3 < 9 (2) d 3 < 3 (3) d 3 < 3 (3) and d 3 > 0 and d 3 > 0 Example: Dicom Corporation

26 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Tabulated Values for 5 x d f 2 ( x 3 + d 3 -1) x d 3 * f 3 ( x 3 ) x 3 + d 3 *-1 = x 2 x d 3 * f 3 ( x 3 ) x 3 + d 3 *-1 = x d3d3d3d3

27 © 2003 Thomson  /South-Western Slide n Stage 4 (August) f 4 ( x 4 ) = Min 5 x d f 3 ( x 3 ) f 4 ( x 4 ) = Min 5 x d f 3 ( x 3 ) d 4 d 4 Given the restrictions, the subproblem is: Given the restrictions, the subproblem is: f 4 ( x 4 ) = Min 5 x d f 3 ( x 4 + d 4 - 2) f 4 ( x 4 ) = Min 5 x d f 3 ( x 4 + d 4 - 2) s.t. x 4 + d 4 > 2 (1) s.t. x 4 + d 4 > 2 (1) x 4 + d 4 < 10 (2) x 4 + d 4 < 10 (2) d 4 < 4 (3) d 4 < 4 (3) and d 4 > 0 and d 4 > 0 Example: Dicom Corporation

28 © 2003 Thomson  /South-Western Slide n Tabulated Values for 5 x d f 3 ( x 4 + d 4 - 2) d 4 d 4 x d 4 * f 4 ( x 4 ) x 4 + d 4 *-2 = x 3 x d 4 * f 4 ( x 4 ) x 4 + d 4 *-2 = x Note: Because August starts with x 4 = 0 inventory on hand, compute table only for x 4 = 0. Example: Dicom Corporation

29 © 2003 Thomson  /South-Western Slide Example: Dicom Corporation n Solution Summary Working backwards through the tables, one can determine the optimal solution that gives the minimum cost of $327 x 100,000 = $32,700,000. Inventory On- Inventory On- Hand Beginning Hand Beginning Stage Month Produce ( d n *) Next Month x n -1 Stage Month Produce ( d n *) Next Month x n -1 4 August August September September October October November November 2 0

30 © 2003 Thomson  /South-Western Slide End of Chapter 18