I am trying to figure out an algorithm for finding the maximum weight of a schedule in which one overlap is allowed.

I can solve this with no overlaps using a fairly simple dynamic programming algorithm, however when one overlap is allowed I am not sure how figure the max weight out.

Is it possible to solve this using dynamic programming?

What about extending it to n overlaps?

any ideas?