If I have a nested absolute value equation such as:
y = |||3x-2|-|8-7x|| -2|x+3||
where all terms in absolute values are linear, what is the complexity (Big -O) of the upper bound on the amount of "pieces" in the equivalent piecewise equation, in terms of the amount of absolute values, or nesting depth of absolute values?
Edit: I found a similar problem and solution here: Minimizing the sum of absolute values with a linear solver I'm wondering how the introduction of nested absolute values changes the answer. Edit2: I was planning on doing this to solve an optimization question where I minimize the max over n linear terms, like in the link, but polynomial time is required, so since my method is turning my optimization problem into exponentially many linear programming problems, I can't do this. Does the method in the link apply to nested absolute values?
Let's define the "complexity" of a piecewise linear function as the number of intervals on which we need to give it separate definitions.
Suppose that $f(x)$ and $g(x)$ are piecewise linear functions with complexity $c_f$ and $c_g$ respectively.
So we can inductively argue that an expression with $k$ absolute values has complexity at most $2^k$. This is tight, for example for an expression like $$ |||||x-16|-8|-4|-2|-1|. $$ We can give better bounds with some assumptions on the "shape" of the expression, since nesting absolute values doubles the complexity at each step, but adding together two expressions is only additive. For example, if we add together two expressions with $5$ absolute values in each, that has complexity at most $2^5 + 2^5 - 1 = 63$, rather than the $2^{10} = 1024$ we could get from a single expression with $10$ absolute values in it.