Consider the problem of minimizing $f : D \to \mathbb{R}$, over its domain, being $$ f(\lambda) = -\lambda \alpha + \sum_{i=1}^n \beta_i \vert u_i - \lambda \vert, $$ where $\alpha \in \mathbb{R}$, $\{\beta_i\}_{i=1}^n \subset \mathbb{R}_{\geq 0}$ and $\{u_i\}_{i=1}^n \subset \mathbb{R}$ are given. Note that the factors $\beta_i$ are nonnegative. I'm only interested in either $D = \mathbb{R}$ or the half-line $D = \mathbb{R}_{\geq 0}$.
I know that this problem can be reformulated as a linear programming (LP) problem and I can solve it with a generic LP solver. But is there an alternative, more direct solution? (in terms of computational efficiency). For instance, if $\alpha = 0$ and $\beta_i = 1$ for all $i$, the solution (at least for $D = \mathbb{R}$) is the median of the $u_i$'s as shown here.