Space-Saving Strategies for Computing Δ-points Kun-Mao Chao (趙坤茂) Department of Computer Science and Information Engineering National Taiwan University, Taiwan E-mail: kmchao@csie. ntu. edu. tw WWW: http: //www. csie. ntu. edu. tw/~kmchao
Δ-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+ 2
Method 1: O(MN) time; O(MN) space S- N S+ M 3
Method 2: O(M 2 N) time; O(M+N) space N S- Each row takes O(MN) time. In total, O(M) x O(MN) = O(M 2 N) S+ M 4
Method 3: O(MN) time; O(M+N) space N S- S+ M 5
Method 4: O(MN log M) time; O(M+N log M) space N S- S+ M 6
Method 5: O(MN log min {M, N}) time; O(M+N) space N M 7
Method 6: O(MN log min {M, N}) time; O(M+N) space Real Size 1/23 1/25 1/210 1/29 1/219 N 1/22 M 8
Method 7: O(1/ε MN) time; O(M+ 1/ε MεN) space Here we use ε= 1/2 to illustrate the idea. N Solve each M 1/2 N problem M 1/2 SS+ M 9
Method 8: O(1/εMN) time; O(1/ε M 1+ε+ N) space Here we use ε= 1/2 to illustrate the idea. M 2 M 3 M N M O(N) M Solve each M 1/2 M problem M 1/2 SS+ M 10
Methods Method 1: O(MN) time; O(MN) space Method 2: O(M 2 N) time; O(M+N) space Method 3: O(MN) time; O(M+N) space Method 4: O(MN log M) time; O(M+N log M) space Method 5: O(MN log min {M, N}) time; O(M+N) space Method 6: O(MN log min {M, N}) time; O(M+N) space Method 7: O(1/εMN) time; O(M+1/ ε MεN) space Method 8: O(1/εMN) time; O(1/ε M 1+ε+ N) space 11
Bonus points • O(MN) time; O(M+N) space • o(MN log min {M, N}) time; O(M+N) space • O(1/εMN) time; o(1/ε M 1+ε+N) space 12