1 15.053 Thursday, May 2 Dynamic Programming – Review – More examples Handouts: Lecture Notes.

Slides:



Advertisements
Similar presentations
Outline LP formulation of minimal cost flow problem
Advertisements

BU Decision Models Integer_LP1 Integer Optimization Summer 2013.
Linear Programming (LP) (Chap.29)
Dynamic Programming In this handout A shortest path example
MIT and James Orlin © Dynamic Programming 1 –Recursion –Principle of Optimality.
Deterministic Dynamic Programming.  Dynamic programming is a widely-used mathematical technique for solving problems that can be divided into stages.
1 Appendix B: Solving TSP by Dynamic Programming Course: Algorithm Design and Analysis.
1 Chapter 9 Dynamic Programming General Problem-Solving strategy Was born in the 1950s (Bellman) Based on successive decomposition Leads to functional.
MIT and James Orlin © Stochastic Dynamic Programming –Review –DP with probabilities.
Dynamic Programming Dynamic Programming is a general algorithm design technique for solving problems defined by recurrences with overlapping subproblems.
MIN-COST ABORESCENCES YQ Lu. Aborescence Definition: Given a directed graph G=(V,E) and a root r, an aborescence rooted at r is a subgraph T that each.
Branch and Bound Searching Strategies
MIT and James Orlin © Dynamic Programming 2 –Review –More examples.
Pertemuan 23 : Penerapan Dinamik Programming (DP) Mata kuliah : K0164-Pemrograman vers 01.
1 Branch and Bound Searching Strategies 2 Branch-and-bound strategy 2 mechanisms: A mechanism to generate branches A mechanism to generate a bound so.
Odds and Ends HP ≤ p HC (again) –Turing reductions Strong NP-completeness versus Weak NP-completeness Vertex Cover to Hamiltonian Cycle.
Dynamic Programming A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 8 ©2012 Pearson Education, Inc. Upper Saddle River,
Real Estate Developer A real estate developer is considering three possible projects: a small apartment complex, a small shopping center, and a mini-warehouse.
1 Dynamic Programming Jose Rolim University of Geneva.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
1.3 Modeling with exponentially many constr.  Some strong formulations (or even formulation itself) may involve exponentially many constraints (cutting.
A. Levitin “Introduction to the Design & Analysis of Algorithms,” 3rd ed., Ch. 8 ©2012 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
1 LINEAR PROGRAMMING Introduction to Sensitivity Analysis Professor Ahmadi.
Dynamic Programming Sequence of decisions. Problem state. Principle of optimality. Dynamic Programming Recurrence Equations. Solution of recurrence equations.
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.
Review for E&CE Find the minimal cost spanning tree for the graph below (where Values on edges represent the costs). 3 Ans. 18.
Honors Track: Competitive Programming & Problem Solving Optimization Problems Kevin Verbeek.
Thursday, May 16 Review of Handouts: Lecture Notes.
Algorithm Design Methods (II) Fall 2003 CSE, POSTECH.
Tuesday, April 30 Dynamic Programming – Recursion – Principle of Optimality Handouts: Lecture Notes.
CS 3343: Analysis of Algorithms Lecture 18: More Examples on Dynamic Programming.
Chapter 18 Deterministic Dynamic Programming
15.082J and 6.855J and ESD.78J The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Computationally speaking, we can partition problems into two categories. Easy Problems and Hard Problems We can say that easy problem ( or in some languages.
Review for E&CE Find the minimal cost spanning tree for the graph below (where Values on edges represent the costs). 3 Ans. 18.
Introduction to Integer Programming Integer programming models Thursday, April 4 Handouts: Lecture Notes.
Branch and Bound Searching Strategies
Computationally speaking, we can partition problems into two categories. Easy Problems and Hard Problems We can say that easy problem ( or in some languages.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
1 4.7 TIME ALIGNMENT AND NORMALIZATION Linear time normalization:
Cycle Canceling Algorithm
Dynamic Programming Sequence of decisions. Problem state.
Water Resources Planning and Management Daene McKinney
CS 3343: Analysis of Algorithms
Dynamic Programming Dynamic Programming is a general algorithm design technique for solving problems defined by recurrences with overlapping subproblems.
Chapter 8 Dynamic Programming
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Algorithms and Networks
The Knapsack Problem.
1.3 Modeling with exponentially many constr.
Dijkstra’s Algorithm for the Shortest Path Problem
Analysis and design of algorithm
Unit 4: Dynamic Programming
Lecture 19-Problem Solving 4 Incremental Method
Introduction to Minimum Cost Flows
Shortest-Path Property 4.1
1.3 Modeling with exponentially many constr.
Dynamic Programming General Idea
Algorithms and Networks
Advanced LP models column generation.
Advanced LP models column generation.
Dynamic Programming 動態規劃
Example 5A: Solving Simple Rational Equations
Advance Algorithm Dynamic Programming
Department of Computer Science & Engineering
Chapter 6. Large Scale Optimization
Presentation transcript:

Thursday, May 2 Dynamic Programming – Review – More examples Handouts: Lecture Notes

2 Match game example Suppose that there are 50 matches on a table, and the person who picks up the last match wins. At each alternating turn, my opponent or I can pick up 1, 2 or 6 matches. Assuming that I go first, how can I be sure of winning the game?

3 Determining the strategy using DP n = number of matches left (n is the state/stage) g(n) = 1 if you can force a win at n matches. g(n) = 0 otherwise g(n) = optimal value function. At each state/stage you can make one of three decisions: take 1, 2 or 6 matches. g(1) = g(2) = g(6) = 1 (boundary conditions) g(3) = 0; g(4) = g(5) = 1. The recursion: g(n) = 1 if g(n-1) = 0 or g(n-2) = 0 or g(n-6) = 0; g(n) = 0 otherwise. Equivalently, g(n) = 1 – min (g(n-1), g(n-2), g(n-6)).

4 The same table

5 Principle of Optimality Any optimal policy has the property that whatever the current state and decision, the remaining decisions must constitute an optimal policy with regard to the state resulting from the current decision. Whatever node j is selected, the remaining path from j to the end is the shortest path starting at j.

6 Finding shortest paths in graphs with no directed circuits. If a network has no directed cycles, then the nodes can be labeled so that for each arc (i,j), i < j. Such a node labeling is called a topological order.

7 Finding a topological order

8 More on topological orders

9 The shortest path problem on acyclic graphs

10 Find d(j) using a recursion.

11 DPs for enumeration

12 Finding optimal paragraph layouts

13 Solving the paragraph problem Recall: F(i,j) is the ugliness of a line beginning at word i and ending at work j-1. Let g(j) be the “ugliness” of the best paragraph layout including words 1, 2, …, j-1. Let n be the number of words in the paragraph. Initial condition: g(0) = 0. What is the ugliness of the best paragraph layout. Is it g(n)? What is the correct recursion?

14 Capital Budgeting, again Investment budget = $14,000

15 Solving the Stockco Problem At stage j compute for each budget from 0 to $14,000 compute the best NPV while limited to stocks 1 to j. Let f(j,k) be the best NPV using a budget of exactly k and limited to stocks 1, 2, …, j only. f(1,k) is easy to calculate The optimum solution to our original problem is f(6, 14)

16 Capital Budgeting: stage 1 Consider stock 1: cost $5, NPV: $16

17 Capital Budgeting: stage 2 Consider stock 2: cost $7, NPV: $22

18 Capital Budgeting: stage 3 Consider stock 3: cost $4, NPV: $12

19 Capital Budgeting: stage 4 Consider stock 4: cost $3, NPV: $8

20 Capital Budgeting: stage 5 Consider stock 5: cost $4, NPV: $11

21 Capital Budgeting: stage 6 Consider stock 6: cost $6, NPV: $19

22 Capital budgeting in general

23 The recursion f(0,0) = 0; f(0,k) is undefined for k > 0 f(k, v) = min ( f(k-1, v), f(k-1, v-ak) + ck) either item k is included, or it is not The optimum solution to the original problem is max { f(n, v) : 0 ≤ v ≤ b }. Note: we solve the capital budgeting problem for all right hand sides less than b.

24 The Knapsack Problem Is there a feasible solution to 31 x + 35 y + 37 z = 422 x, y, z are non-negative integers.

25 The recursion for the knapsack problem Is there a feasible solution to 31 x + 35 y + 37 z = 422 x, y, z are non-negative integers.

26 The recursion for the knapsack problem Is there a feasible solution to 31 x + 35 y + 37 z = 422 x, y, z are non-negative integers.

27

28 The recursion for the knapsack problem Is there a feasible solution to 31 x + 35 y + 37 z = 422 x, y, z are non-negative integers.

29

30 The recursion for the knapsack problem Is there a feasible solution to 31 x + 35 y + 37 z = 422 x, y, z are non-negative integers.

31

32 Dynamic Programming Review Recursion Principle of optimality states and stages and decisions useful in a wide range of situations – shortest paths – capacity expansion – knapsack – many, many more