I have a convex non-linear integer program of the following form:
K is a fixed integer greater than 0. Betas are real numbers greater than zero.
Note that x is a positive integer and the function to be optimized as well as the constraint are convex.
I have found that this problem falls under the umbrella of Mixed-Integer Non-linear programming (MINLP), except that there are no real part in the variable to be optimized so it is not really "mixed".
I have found a lot of references to python solvers for MINLP but it looks like they all work by alternating between solving for the integer and real part. Among them Pyomo's mindt solver which I managed to run on my problem.
from pyomo.environ import *
import numpy as np
N = 50000
K = N * 2
beta = np.absolute(np.random.randn(N) * 1000)
model = ConcreteModel()
for i in range(N):
model.__setattr__(f"x{i}", Var(within=RangeSet(K), bounds=(1, K), initialize=1))
model.c = Constraint(expr=sum([model.__getattribute__(f"x{i}") for i in range(N)]) <= K)
model.objective = Objective(expr=sum([beta[i]/sqrt(model.__getattribute__(f"x{i}")) for i in range(N)]), sense=minimize)
SolverFactory('mindtpy').solve(model, strategy="OA", mip_solver='glpk', nlp_solver='ipopt')
res = np.array([model.__getattribute__(f"x{i}").value for i in range(N)])
However, this is extremely slow and runtime seems to scale exponentially with N. Duration is tractable for small N but not for N as big as 50000.
I wonder if the solver doesn't loose time trying to optimize on the real variables even though there are not? Isn't there an open-source python solver specialized in Convex Integer Non-Linear Programs? It is ok if the solver is not available in python, but it must be open-source.