Dynamic Programming 動態規劃

Slides:



Advertisements
Similar presentations
Dynamic Programming An algorithm design paradigm like divide-and-conquer “Programming”: A tabular method (not writing computer code) Divide-and-Conquer.
Advertisements

MIT and James Orlin © Dynamic Programming 1 –Recursion –Principle of Optimality.
Optimization of thermal processes2007/2008 Optimization of thermal processes Maciej Marek Czestochowa University of Technology Institute of Thermal Machinery.
Chapter 7 Dynamic Programming.
Dynamic Programming Dynamic Programming is a general algorithm design technique for solving problems defined by recurrences with overlapping subproblems.
Dynamic Programming Technique. D.P.2 The term Dynamic Programming comes from Control Theory, not computer science. Programming refers to the use of tables.
Chapter 8 Dynamic Programming Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
MIT and James Orlin © Dynamic Programming 2 –Review –More examples.
Design and Analysis of Algorithms - Chapter 81 Dynamic Programming Dynamic Programming is a general algorithm design technique Dynamic Programming is a.
7 -1 Chapter 7 Dynamic Programming Fibonacci Sequence Fibonacci sequence: 0, 1, 1, 2, 3, 5, 8, 13, 21, … F i = i if i  1 F i = F i-1 + F i-2 if.
UNC Chapel Hill Lin/Manocha/Foskey Optimization Problems In which a set of choices must be made in order to arrive at an optimal (min/max) solution, subject.
Dynamic Programming Introduction to Algorithms Dynamic Programming CSE 680 Prof. Roger Crawfis.
CSCE350 Algorithms and Data Structure Lecture 17 Jianjun Hu Department of Computer Science and Engineering University of South Carolina
Dynamic Programming. Well known algorithm design techniques:. –Divide-and-conquer algorithms Another strategy for designing algorithms is dynamic programming.
Fundamentals of Algorithms MCS - 2 Lecture # 7
Dynamic Programming Key characteristic of a Dynamic Program: Breaking up a large, unwieldy problem into a series of smaller, more tractable problems. Shortest.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
Algorithm Paradigms High Level Approach To solving a Class of Problems.
CSC401: Analysis of Algorithms CSC401 – Analysis of Algorithms Chapter Dynamic Programming Objectives: Present the Dynamic Programming paradigm.
Dynamic Programming 張智星 (Roger Jang) 多媒體資訊檢索實驗室 台灣大學 資訊工程系.
Dynamic Programming Discrete time frame Multi-stage decision problem Solves backwards.
Tuesday, April 30 Dynamic Programming – Recursion – Principle of Optimality Handouts: Lecture Notes.
Thursday, May 2 Dynamic Programming – Review – More examples Handouts: Lecture Notes.
Optimization Problems In which a set of choices must be made in order to arrive at an optimal (min/max) solution, subject to some constraints. (There may.
Eastern Mediterranean University Department Of Industrial Engineering Deterministic Dynamic Programming presented by: Ziad El Masri Supervisor: Prof. Dr.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
What Dynamic Programming (DP) is a fundamental problem solving technique that has been widely used for solving a broad range of search and optimization.
1 Today’s Material Dynamic Programming – Chapter 15 –Introduction to Dynamic Programming –0-1 Knapsack Problem –Longest Common Subsequence –Chain Matrix.
Introduction and Preliminaries D Nagesh Kumar, IISc Water Resources Planning and Management: M4L1 Dynamic Programming and Applications.
1 4.7 TIME ALIGNMENT AND NORMALIZATION Linear time normalization:
Dynamic Programming - DP December 18, 2014 Operation Research -RG 753.
Dynamic Programming Typically applied to optimization problems
All-pairs Shortest paths Transitive Closure
Dynamic Programming Sequence of decisions. Problem state.
Water Resources Planning and Management Daene McKinney
Dynamic Programming 1 Neil Tang 4/20/2010
Lecture 5 Dynamic Programming
CS 3343: Analysis of Algorithms
Dynamic Programming Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Introduction to the Design and 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
Advanced Design and Analysis Techniques
Lecture 5 Dynamic Programming
CS330 Discussion 6.
Design and Analysis of Algorithms (07 Credits / 4 hours per week)
Dynamic Programming Lecture 13 (5/31/2017).
DYNAMIC PROGRAMMING.
Dynamic Programming.
Dynamic Programming.
Unit-5 Dynamic Programming
Dynamic Programming General Idea
Unit 4: Dynamic Programming
Unit-4: Dynamic Programming
Dynamic Programming 1/15/2019 8:22 PM Dynamic Programming.
Dynamic Programming.
Dynamic Programming.
Dynamic Programming 1 Neil Tang 4/15/2008
Dynamic Programming-- Longest Common Subsequence
Dynamic Programming General Idea
Dynamic Programming.
Dynamic Programming II DP over Intervals
Matrix Chain Product 張智星 (Roger Jang)
Dynamic Programming.
Major Design Strategies
Longest Common Subsequence (LCS)
Design and Analysis of Algorithms (04 Credits / 4 hours per week)
Major Design Strategies
Edit Distance 張智星 (Roger Jang)
Algorithm Course Dr. Aref Rashad
Presentation transcript:

Dynamic Programming 動態規劃 張智星 (Roger Jang) jang@mirlab.org http://mirlab.org/jang 多媒體資訊檢索實驗室 台灣大學 資訊工程系

Dynamic Programming Dynamic Programming (DP) Applications: NUMEROUS! An effective method for finding the optimum solution to a multi-stage decision problem, based on the principal of optimality Applications: NUMEROUS! Longest common subsequence, edit distance, matrix chain products, all-pair shortest distance, dynamic time warping, hidden Markov models, … Quiz!

Principal of Optimality Richard Bellman, 1952 An optimal policy has the property that whatever the initial state and the initial decisions are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision.

Web Resources about DP Recordings on the web MIT Open Course Ware

Problems Solvable by DP Characteristics of problems solvable by DP Decomposition: The original problem can be expressed in terms of subproblems. Subproblem optimality: the global optimum value of a subproblem can be defined in terms of optimal subproblems of smaller sizes. Quiz!

Three-step Formula of DP DP formulation involves 3 steps Define the optimum-value function for recursion Derive the recurrent formula of the optimum-value function, with boundary conditions Specify the answer to the original task in terms of the optimum-value function. Quiz!

DP Example: Optimal Path Finding Path finding in a feed-forward network p(a,b): transition cost q(a): state cost Goal Find the optimal path from nodes 0 to 7 such that the total cost is minimized. Node index p(3,6)=8 q(3)=1

DP Example: Optimal Path Finding Three steps in DP Optimum-value function t(h): the minimum cost from the start point (node 0) to node h. Recurrent formula Answer: t(7) Optimum-value function Last node

DP Example: Optimal Path Finding Walkthrough of DP Flash Gif

Observations Some observations based on this path finding example Once t(7) is found, t(k), k<7 is also found Multi-stage  Layer-by-layer computation  No loops in the graph In fact Any DP problem can be visualized as this optimal path finding problem!

Principal of Optimality: Example In terms of the min-cost path problem Any sub-path of the min-cost path should itself be a min-cost path given the starting and ending nodes P  Q ^Q  ^P Start End Q P

Bottom-up Approach of DP Usually bottom-up design of DP Start from the bottom (base cases) Solve small sub-problems Store solutions Reuse previous results for solving larger sub-problems Usually it’s reduced to path finding via table filling!

Characteristics of DP Some general characteristics of DP We need to store back-tracking information in order to identify the path efficiently. Once the optimal path is found, all the related sub-problems are also solved. DP can only find the optimal path. To find the second best, we need to invoke a more complicated n-best approach.