(Sum of absolute values)$f(x)=\sum w_i|x-a_i|$ with positive weights is piecewise linear and convex. Its minimum is attained exactly at the weighted medians of the points $a_i$: the numbers $m$ such that the total weight of the points strictly left of $m$ and the total weight of the points strictly right of $m$ are each at most half of the total weight.
← 返回第 1220 题