Dynamic Programming Chapter 15 Highlights Charles Tappert Seidenberg School of CSIS, Pace University.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms 6.046J/18.401J/SMA5503
Advertisements

Rod cutting Decide where to cut steel rods:
Dynamic Programming.
Algorithm Design Methodologies Divide & Conquer Dynamic Programming Backtracking.
Types of Algorithms.
UMass Lowell Computer Science Analysis of Algorithms Prof. Giampiero Pecelli Fall, 2010 Paradigms for Optimization Problems Dynamic Programming.
15.Dynamic Programming Hsu, Lih-Hsing. Computer Theory Lab. Chapter 15P.2 Dynamic programming Dynamic programming is typically applied to optimization.
Overview What is Dynamic Programming? A Sequence of 4 Steps
CS Section 600 CS Section 002 Dr. Angela Guercio Spring 2010.
Dynamic Programming.
For Monday Read 10.3 Homework: –Chapter 10, exercise 10.
Comp 122, Fall 2004 Dynamic Programming. dynprog - 2 Lin / Devi Comp 122, Spring 2004 Longest Common Subsequence  Problem: Given 2 sequences, X =  x.
1 Dynamic Programming (DP) Like divide-and-conquer, solve problem by combining the solutions to sub-problems. Differences between divide-and-conquer and.
Dynamic Programming Part 1: intro and the assembly-line scheduling problem.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 1 (Part 3) Design Patterns for Optimization Problems.
Dynamic Programming CIS 606 Spring 2010.
Dynamic Programming Code
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 1 (Part 3) Tuesday, 9/3/02 Design Patterns for Optimization.
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 4. Dynamic Programming - 1 Dynamic.
Dynamic Programming1. 2 Outline and Reading Matrix Chain-Product (§5.3.1) The General Technique (§5.3.2) 0-1 Knapsack Problem (§5.3.3)
Analysis of Algorithms CS 477/677
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2008 Design Patterns for Optimization Problems Dynamic Programming.
November 7, 2005Copyright © by Erik D. Demaine and Charles E. Leiserson Dynamic programming Design technique, like divide-and-conquer. Example:
© 2004 Goodrich, Tamassia Dynamic Programming1. © 2004 Goodrich, Tamassia Dynamic Programming2 Matrix Chain-Products (not in book) Dynamic Programming.
Analysis of Algorithms
Dynamic Time Warping Applications and Derivation
Lecture 7 Topics Dynamic Programming
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2005 Design Patterns for Optimization Problems Dynamic Programming.
Dynamic Programming Introduction to Algorithms Dynamic Programming CSE 680 Prof. Roger Crawfis.
First Ingredient of Dynamic Programming
Instructor: Dr. Sahar Shabanah Fall Lectures ST, 9:30 pm-11:00 pm Text book: M. T. Goodrich and R. Tamassia, “Data Structures and Algorithms in.
Lecture 5 Dynamic Programming. Dynamic Programming Self-reducibility.
Dynamic Programming UNC Chapel Hill Z. Guo.
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
1 Summary: Design Methods for Algorithms Andreas Klappenecker.
COSC 3101A - Design and Analysis of Algorithms 7 Dynamic Programming Assembly-Line Scheduling Matrix-Chain Multiplication Elements of DP Many of these.
Algorithm Paradigms High Level Approach To solving a Class of Problems.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
CS 8833 Algorithms Algorithms Dynamic Programming.
Lecture21: Dynamic Programming Bohyung Han CSE, POSTECH CSED233: Data Structures (2014F)
Greedy Methods and Backtracking Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Dynamic Programming (Ch. 15) Not a specific algorithm, but a technique (like divide- and-conquer). Developed back in the day when “programming” meant “tabular.
Dynamic Programming David Kauchak cs302 Spring 2013.
Provinci summer training 2010 June 17: Recursion and recursive decent parser June 24: Greedy algorithms and stable marriage July 1: Holiday July 8: Math.
Types of Algorithms. 2 Algorithm classification Algorithms that use a similar problem-solving approach can be grouped together We’ll talk about a classification.
Computer Sciences Department1.  Property 1: each node can have up to two successor nodes (children)  The predecessor node of a node is called its.
CSC5101 Advanced Algorithms Analysis
Dynamic Programming David Kauchak cs161 Summer 2009.
1Computer Sciences Department. 2 Advanced Design and Analysis Techniques TUTORIAL 7.
Chapter 15 Dynamic Programming Lee, Hsiu-Hui Ack: This presentation is based on the lecture slides from Hsu, Lih-Hsing, as well as various materials from.
Greedy Algorithms Chapter 16 Highlights
Dynamic Programming academy.zariba.com 1. Lecture Content 1.Fibonacci Numbers Revisited 2.Dynamic Programming 3.Examples 4.Homework 2.
9/27/10 A. Smith; based on slides by E. Demaine, C. Leiserson, S. Raskhodnikova, K. Wayne Adam Smith Algorithm Design and Analysis L ECTURE 16 Dynamic.
TU/e Algorithms (2IL15) – Lecture 4 1 DYNAMIC PROGRAMMING II
D ESIGN & A NALYSIS OF A LGORITHM 13 – D YNAMIC P ROGRAMMING Informatics Department Parahyangan Catholic University.
1 Chapter 15-2: Dynamic Programming II. 2 Matrix Multiplication Let A be a matrix of dimension p x q and B be a matrix of dimension q x r Then, if we.
Dynamic Programming Csc 487/687 Computing for Bioinformatics.
Rod cutting Decide where to cut steel rods:
Lecture 5 Dynamic Programming
Advanced Design and Analysis Techniques
Lecture 5 Dynamic Programming
Unit-4: Dynamic Programming
Searching: linear & binary
Ch. 15: Dynamic Programming Ming-Te Chi
Dynamic Programming-- Longest Common Subsequence
Introduction to Algorithms: Dynamic Programming
Longest Common Subsequence
Longest Common Subsequence
Data Structures and Algorithms Dynamic Programming
Presentation transcript:

Dynamic Programming Chapter 15 Highlights Charles Tappert Seidenberg School of CSIS, Pace University

What is dynamic programming? Dynamic programming is a method of solving optimization problems by combining the solutions of subproblems Developing these algorithms follows four steps: 1. Characterize the structure of an optimal solution 2. Recursively define the value of an optimal solution 3. Compute the optimal solution, typically bottom-up 4. Construct the path of an optimal solution (if desired)

Example – Rod Cutting Problem: Given a rod of length n inches and a table of prices, determine the maximum revenue obtainable by cutting up the rod and selling the pieces Rod cuts are an integral number of inches, cuts are free Price table for rods

Example – Rod Cutting Eight possible ways to cut a rod of length 4 (prices shown on top)

Example – Rod Cutting The recursion tree for a rod of length 4 The subproblem graph (collapsed tree)

Example – Rod Cutting Recursive equation: Bottom-up algorithm – O(n 2 ) from double nesting

Example – Rod Cutting Extended bottom-up algorithm obtains path Print solution

Example Longest Common Subsequence A string over a finite set S is a sequence of elements of S (Appendix C, p 1184) Given two sequences X and Y, a sequence Z is a common subsequence of X and Y if Z is a subsequence of both X and Y Problem: Find the maximum length common subsequence of X and Y

Example Longest Common Subsequence

Other Examples from Textbook Matrix-chain multiplication Optimal binary search trees

Two key ingredients for dynamic programming to apply to an optimization problem: 1. Optimal substructure (also for greedy algorithms) 2. Overlapping subproblems Bottom-up algorithms usually outperform top- down ones by a constant factor due to less overhead Elements of Dynamic Programming

1. Optimal substructure Occurs when the optimal solution contains within it optimal solutions to subproblems We build an optimal solution to the problem from optimal solutions to subproblems Rod-cutting a rod of size n uses just one subproblem of size n-i Matrix-chain multiplication uses two subproblems, the two sub-chains Elements of Dynamic Programming

2. Overlapping subproblems This occurs when a recursive algorithm revisits the same problem repeatedly The dynamic programming algorithm typically solves each subproblem only once and stores the result The rod-cutting dynamic programming solution reduced an exponential-time recursive algorithm down to quadratic time Elements of Dynamic Programming

Longest-common-subsequence (LCS) problem, used in biological applications to compare the DNA of two different organisms In-class exercise solve problem (p 396) finding the string length and the string String matching – LCS

Online handwriting recognition (journal article) String matching – handwriting In-class Exercise

Textbook chapter-end problem 5 (p 406) See Speech and Language book chapter In-class exercise (time permitting) String matching – spell checking

Various applications Speech production models Speech recognition systems Speech sound alignment for speaker verification (voiceprint) systems String matching – speech & language

Speaker Verification: “My name is …”

by two different speakers

“My name is” divided into seven sound units. Speaker Verification Alignment Problem: DTW locates the seven sounds

Paper (1-3 pages) due last session See link to assignment on Syllabus page String matching – assignment