I have a function f(x, y) which takes two integers and returns a scalar.
My task is to find the set of (x, y) pairs, 0<x<W, 0<y<H where f(x, y)>0, which maximize the sum f(x_i, y_i) with the constraint that no two pairs shall overlap. Two pairs (x1, y1) and (x2, y2) overlap if (x2 >= x1 and x2 < x1+y1).
I have implemented a practical solution which processes in O(WxH) time with O(W) memory. I'm pretty sure this is optimal. It seems to me that it is a kind of a graph flow algorithm, but I don't know how to formally describe it without pseudo code.
Can anybody tell me what class of problems this problem belongs to?