0

Currently, I'm working a string alignment comparison. I'm confused on how to optimize DP by pruning.

DP can be represented as a matrix/table. The start point is (0, 0). For example, element at (3, 4) is pruned and its value marked as -1 or null. But when I compute location (4, 4), (3, 5) and (4, 5), I still need a if-statement to check whether the value of (3, 4) is invalid(pruned) or valid(not pruned). Can this implementation save time because pruning function brings extra running time???

XiaoChuan Yu
  • 3,951
  • 1
  • 32
  • 44

0 Answers0