Presuming $k_i$ are constrained to be positive (which I'm assuming to be the case), this can be solved as a Mixed-Integer Second Order Cone Program (MISOCP). Specifically, the reciprocal in the objective function can be handled by use of a rotated Second Order Cone constraint for each term in the objective function.
I will assume that the "k" in the first constraint is either extraneous (i.e., a typo), or is a constant - in either case, that constraint would be linear. Presumably the "constraint" $N \le n$ isn't really a constraint, but a statement about the input values $N$ and $n$; but $N$ doesn't even appear. So I'll handle the essence of what I think the problem is, and assume the rest can be handled by fixing typos in the problem statement.
If a convex optimization modeling tool, such as CVX, CVXPY, or CVXR is used, handling of the reciprocal can be accomplished with a high level function (such as CVX's inv_pos
), resulting in an under the hood transformation to SOCP formulation.
Here is CVX code (assume w
is a column vector whose ith element is $w_i$), and let kk
take the role of k
in the 1st constraint, because I am using k
as a (column) vector whose ith element is $k_i$.
cvx_begin
variable k(n) integer
minimize(w'*inv_pos(k)) % inv_pos(k) is vector of 1/k_i
subject to
kk*sum(k) == K
(1:n)'.^eta.*w <= k % this is a vector of n constraints
cvx_end
This requires an MISOCP solver, such as Gurobi or Mosek, or if using CVXPY, also CPLEX. Depending on the the input data, it may take a while for the solver to solve it (it is NP-hard, but only because of the integer constraint).
Here is how the reformulation to SOCP constraint works. The term $w_i/k_i$ is handled by introducing a new variable $t_i$, changing the term $w_i/k_i$ to $w_it_i$, and introducing the rotated second order cone constraint (to enforce $t_i = w_i/k_i$, accomp0lished via epigraph formulation due to minimization driving the inequality to be satisfied with equality at the optimum): $$\|1\|_2 \le \sqrt{k_it_i}, t_i \ge 0, k_i \ge 0$$