It's been a few years since I wrote that but here is what I recall:
D0 is a constant cutoff that represents the upper bound of dissimilarity for the difference of two distance matrices A_i and B_j, rooted at subsequences i to i+8 and j to j+8, respectively. Raising this value allows for sloppier fragments being considered.
D1 is a constant cutoff that represents the upper bound of dissimilarity for the entire path being considered. In fact, it's equal to path_score / (window_size * path_length).
So, D0 ensure that incoming fragments are still good. D1 ensures that as we extend the current alignment the total quality of the current alignment remains good.
After this, all N top scoring paths are stored in the path cache and the best path is returned.