I have this very general problem (for $n>2$):
$$ \begin{align} & \max Z = f(x_1,\ldots ,x_n) \\[10pt] \text{s.t. } & \sum_{i=1}^{n} x_i = B \\[10pt] & x_i \geq 0 \end{align} $$
Assume that the function $f(x_1,\ldots,x_n)$ is not a "nice" function, non-linear, non-convex, hardly differentiable. Therefore, in general I cannot use the Lagrangian multipliers method. For finding the $x_i$'s, I am thinking to numerical optimization approaches.
My questions are:
1) Is there a common, smart and effective way to deal with such an equality constraint in numerical optimization?
2) Am I missing something? Do you have any other direction to suggest?
Thanks