# Approximate Dynamic Programming using Halfspace Queries and Multiscale Monge decomposition

We consider the problem of approximating a signal *P* with another signal *F* consisting of a few piecewise constant segments. This problem arises naturally in applications including databases (e.g., histogram construction), speech recognition, computational biology (e.g., denoising aCGH data) and many more. Specifically, let *P* = (P_{1}, *P*_{2}, …, *P _{n}*),

*P*∊ ℝ for all

_{i}*i*, be a signal and let

*C*be a constant. Our goal is to find a function

*F*: [

*n*] → ℝ which optimizes the following objective function:

The above optimization problem reduces to solving the following recurrence, which can be done using dynamic programming in *O*(*n*^{2}) time:

This recurrence arises naturally in several applications where one wants to approximate a given signal *P* with a signal *F* which ideally consists of few piecewise constant segments. Such applications include histogram construction in databases, determining DNA copy numbers in cancer cells from micro-array data, speech recognition, data mining and many others.

In this work we present two new techniques for optimizing dynamic programming that can handle cost functions not treated by other standard methods. The basis of our first algorithm is the definition of a constant-shifted variant of the objective function that can be efficiently approximated using state of the art methods for range searching. Our technique approximates the optimal value of our objective function within additive ∊ error and runs in time, where δ is an arbitrarily small positive constant and . The second algorithm we provide solves a similar recurrence that's within a multiplicative factor of (1+∊) and runs in *O*(*n* log *n*/∊). The new technique introduced by our algorithm is the decomposition of the initial problem into a small (logarithmic) number of Monge optimization subproblems which we can speed up using existing techniques.