Presentation is loading. Please wait.

Presentation is loading. Please wait.

Revisit Dynamic Programming

Similar presentations


Presentation on theme: "Revisit Dynamic Programming"— Presentation transcript:

1 Revisit Dynamic Programming

2

3 Technique 1 Find a related optimization problem with self-reducibility. Solve the related problem by dynamic programming. Solve original problem.

4 A problem on strip: outside weighted disks cover
Inside points with minimum total weight. L p2 p1 pi Ti(D,D’) : minimum weight set with D, D’, dominating p1, …, pi such that (1) D (lowest intersection point on L) among disks above the strip (2) D’(highest intersection point on L) among disks below the strip

5 D1 (lowest intersection point on L)
among disks above the strip, in Ti(D,D’) L p2 p1 pi-1 D2 (highest intersection point on L) among disks below the strip, in Ti(D,D’)

6 Dynamic Programming

7 Dynamic Programming

8 D1 pi-1 pi pj D

9 Pseudo Polynomial-time Algorithm for Knapsack

10 DP-type Algorithm

11 Initially,

12

13

14 Time outside loop: O(n) Inside loop: O(nM) where M=max ci
Core: O(n log (MS)) Total O(n M log (MS)) Since input size is O(n log (MS)), this is a pseudo-polynomial-time due to M=2 3 log M

15 Running time (1) Time for computing one element with recursive formula. (2) Size of the table. Running time = (1) x (2)

16 Technique 2 Speed Up


Download ppt "Revisit Dynamic Programming"

Similar presentations


Ads by Google