Dynamic Programming
1 / 18

Dynamic Programming - PowerPoint PPT Presentation

  • Uploaded on

Dynamic Programming. Dynamic Programming. Dynamic Programming is a general algorithm design technique It breaks up a problem into a series of overlapping sub-problems ( sub-problem whose results can be reused several times) Main idea:

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'Dynamic Programming' - roden

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

Dynamic programming
Dynamic Programming

  • Dynamic Programming is a general algorithm design technique

  • It breaks up a problem into a series of overlapping sub-problems ( sub-problem whose results can be reused several times)

  • Main idea:

    • set up a recurrence relating a solution to a larger instance to solutions of some smaller instances

    • - solve smaller instances once

    • record solutions in a table

    • extract solution to the initial instance from that table

Discussed topics
Discussed topics

  • Assembly-line scheduling

  • Partition of Data Sequence

  • Route Segmentation and Classification for GPS data

  • Longest Common Subsequence (LCS)

Assembly line scheduling
Assembly-line scheduling

Recursive equation:

where f1[j] and f2[j] are the accumulated time cost to reach station S1,j and S2,j

a1,j is the time cost for station S1,j

t2,j-1 is the time cost to change station from S2,j-1 to S1,j

Partition of data sequence
Partition of Data Sequence

Partition of the sequence X into to K non-overlappinggroups with given cost functions f(xi, xj) sothat the totalvalue of the cost function is minimal:

Partition of data sequence1
Partition of Data Sequence

G(k,n) is cost function for optimal partition of n points into

k non-overlapping groups:

Recursive equation:

Examples image quantization
Examples: Image Quantization



Here, cost function is:

Square Error

Quantize value

Examples polygonal approximation
Examples: Polygonal Approximation

5004points are approximated by 78 points.

Givenapproximatedpoints M, errorsareminimized.

Givenerrorε, number of approximatedpointsareminimized.

Here, cost function is:

Examples route segmentation
Examples: Route segmentation


Running and Jogging


Divide the routes into severalsegmentsby


Here, cost function is:


Time duration

Examples route classification
Examples: Route classification

Determine the moving type only by speed will cause mis-classification.

Frequent Moving type dependency of 1st order HMM

Examples route classification cont
Examples: Route classification (cont.)

1st order HMM, maximize:

mi : moving type of segment i

Xi : feature vector (e.g. speed)

Solve by dynamic programming similar with the Assembly-line scheduling problem

Longest common subsequence lcs
Longest Common Subsequence (LCS)

Find a maximum length common subsequence between two sequences.

For instance,

Sequence 1: president

Sequence 2: providence

Its LCS is priden.



How to compute lcs
How to compute LCS?

Let A=a1a2…am and B=b1b2…bn .

len(i, j): the length of an LCS between a1a2…aiand b1b2…bj

With proper initializations, len(i, j) can be computed as follows.

Time Series Matching using Longest Common Subsequence

delta = time matching region (left & right)

epsilon = spatial matching region (up & down)

Recursive equation:

Spatial Data Matching using Longest Common Subsequence

epsilon = spatial matching distance

Recursive equation:


  • Main idea:

    • Divide into sub-problems

    • Design cost function and recursive function

    • Optimization (fill in the table)

    • Backtracking