Machine Learning, Linear Programming, Data Science.
optimal dual LP solution works as follows: maintain the breakpoints as m sorted lists, and iterate through the entire set of breakpoints in a descending order, computing the current total slope, until the first point at which the slope switches sign. Note that iterating the breakpoints in a