Suppose that $f(x_1, x_2, ... x_K)$ is convex nonincreasing, and we only consider its values for integer $x_1, x_2, ..., x_K$. Furthermore, consider the problem: \begin{align} \min_{x_k \in \mathbb{Z}^+} & \, f(x_1, x_2, ..., x_K) \\ \text{s.t. } &\sum_{k=1}^K x_k = B \\ &x_k \le b_k, \, \, k = 1, ..., K. \end{align} Would a simple greedy algorithm be guaranteed to find the optimal solution to this problem? Any comments and references are very much appreciated.
Greedy algorithm: Start at the point where $x_k = 0$ for all $k$; Increase by 1 the $x_k$ that would result in the greatest improvement in the objective; Repeat the previous step (without violating the last constraint) until we use up the budget B.