The Quadrangle Inequality

State the quadrangle inequality and what it buys.

A

w(a,c)+w(b,d)≤w(a,d)+w(b,c)w(a,c) + w(b,d) \le w(a,d) + w(b,c) for all a≤b≤c≤da \le b \le c \le d: crossing costs no more than containing. With interval monotonicity it narrows the split range by a constant factor, cutting interval DP from O(n3)O(n^3) to O(n2log⁡n)O(n^2 \log n).

B

w(a,c)+w(b,d)≤w(a,d)+w(b,c)w(a,c) + w(b,d) \le w(a,d) + w(b,c) for all a≤b≤c≤da \le b \le c \le d: crossing costs no more than containing. With interval monotonicity it forces the optimal split point to be monotone, cutting interval DP from O(n3)O(n^3) to O(n2)O(n^2).

C

w(a,c)+w(b,d)≥w(a,d)+w(b,c)w(a,c) + w(b,d) \ge w(a,d) + w(b,c) for all a≤b≤c≤da \le b \le c \le d: containing costs no more than crossing. With interval monotonicity it forces the optimal split point to be monotone, cutting interval DP from O(n3)O(n^3) to O(n2)O(n^2).

D

w(a,b)+w(c,d)≤w(a,c)+w(b,d)w(a,b) + w(c,d) \le w(a,c) + w(b,d) for all a≤b≤c≤da \le b \le c \le d: disjoint costs no more than overlapping. With interval monotonicity it forces the optimal split point to be monotone, cutting interval DP from O(n3)O(n^3) to O(n2)O(n^2).