I have this problem:
\begin{align} \min_{\mathbf{w}} & \sum_{i=1}^N c_i P_i(w_i)\\ s.t & \notag\\ & \sum_{i =1 }^N w_i = w \\ & 0 \leq w_i \leq w_{max},~~\forall i \in 1, ..., N \end{align}
where $P_i(w)$ is a piecewise linear convex function. Is there a closed formula to solve this? If not, what is the most relevant algorithm?