space-saving strategies for computing Δ -points
DESCRIPTION
Space-Saving Strategies for Computing Δ -points. Kun-Mao Chao ( 趙坤茂 ) Department of Computer Science and Information Engineering National Taiwan University, Taiwan E-mail: [email protected] WWW: http://www.csie.ntu.edu.tw/~kmchao. Δ -points. - PowerPoint PPT PresentationTRANSCRIPT
Space-Saving Strategies for Computing Δ-points
Kun-Mao Chao (趙坤茂 )Department of Computer Science an
d Information EngineeringNational Taiwan University, Taiwan
E-mail: [email protected]
WWW: http://www.csie.ntu.edu.tw/~kmchao
2
Δ-points• S-(i, j): the best score of a path from (0, 0) to (i, j).• S+(i, j): the best score of a path from (i, j) to (m, n).• Δ-points: S-(i, j) + S+( i, j) >= Δ
S -
S +
3
Method 1: O(MN) time; O(MN) space
S - S +
M
N
4
Method 2: O(M2N) time; O(M+N) space
S -
S +
Each row takes O(MN) time. In total, O(M) x O(MN) = O(M2N)
M
N
5
Method 3: O(MN) time; O(M+N) space
S -
S +
M
N
6
Method 4: O(MN log M) time; O(M+N log M) space
S -
S +
M
N
7
Method 5: O(MN log min {M, N}) time; O(M+N) space
M
N
8
Method 6: O(MN log log min {M, N}) time; O(M+N) space
M
N
1/22
1/23
1/25
1/29
1/25
1/210
1/219
Real Size
9
Method 7: O(1/ε MN) time; O(M+ 1/ε MεN) space
Here we use ε= 1/2 to illustrate the idea.
S -
S +
M
N
M1/2 Solve each M1/2N problem
10
Method 8: O(1/εMN) time; O(1/ε M1+ε+ N) space
Here we use ε= 1/2 to illustrate the idea.
M
NM 2M 3M
S -
S +
M
M
M1/2 Solve each M1/2M problem
O(N)
11
Methods
Method 1: O(MN) time; O(MN) spaceMethod 2: O(M2N) time; O(M+N) spaceMethod 3: O(MN) time; O(M+N) spaceMethod 4: O(MN log M) time; O(M+N log M) spaceMethod 5: O(MN log min {M, N}) time; O(M+N) sp
aceMethod 6: O(MN log log min {M, N}) time; O(M+
N) spaceMethod 7: O(1/εMN) time; O(M+1/ ε MεN) spaceMethod 8: O(1/εMN) time; O(1/ε M1+ε+ N) space
12
Bonus points
• O(MN) time; O(M+N) space
• o(MN log log min {M, N}) time; O(M+N) space
• O(1/εMN) time; o(1/ε M1+ε+N) space