Download presentation
Presentation is loading. Please wait.
1
Revisit Dynamic Programming
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,
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.