Flatten the curve between all points (with an optional constant)

45 Views Asked by At

I've been given a series of points equidistant from one another, where each point can be raised (incremented) by a maximum value of a common constant c (each point can be incremented anywhere from 0 to c units) in order to help flatten the curve of the graph of these points as much as possible.

I was wondering if anyone could help point me in the right direction as to what kind of formulas or functions would help flatten the curve as much as possible given the conditions above. I believe this is an optimization problem but I could be wrong and I would greatly appreciate a nudge in the right direction. (I believe I am trying to optimize for the flattest possible slope between each point)

For example, Given the initial list of 10 equidistant points [75, 110, 115, 105, 95, 85, 75, 65, 45, 50] where each point can be incremented anywhere from 0 <= c <= 6, return a new list of 10 equidistant points where the slope between each point in the graph has been minimized by adding a c value to any/all of the points in the initial list.

This is not school related so there is no need to solve the above problem if you don't want to. Any explanation as to how I may get a result is greatly appreciated.

1

There are 1 best solutions below

1
On

Here's a "nudge" as requested.

  • Draw the original graph.

  • Draw a new graph where every point is $c$ units above. I.e. this will be an exact copy of the original graph but with the whole thing raised by $c$ units.

  • Now imagine the two graphs defining a sort of "pipe". Pass a thread through it and pull it tight on both ends. That should define most of the necessary segments, touching the necessary "peaks" of the lower graph and the necessary "valleys" of the upper graph. There will be some leeway for the first and last segments.

Your exact optimality criterion is not very well defined, but you can season the above to taste. Hope this helps!