Scipy.optimize.minimize using a design vector x that contains integers only


I'd like to minimize some objective function f(x1,x2,x3) in Python. Its quite a simple function but the problem is that the design vector x=[x1,x2,x3] constains integers only.

So for example I'd like to get the result:

"f is minimum for x=[1, 3, 2]" and not: "f is minimum for x=[1.12, 3.36, 2.24]" since this would not make any sense for my problem.

Is there any way to rig scipy.minimize to solve this kind of problem? Or is there any other Python library capable of doing this?

Show source
| python   | integer   | optimization   | scipy   | minimum   2017-01-03 16:01 1 Answers

Answers ( 1 )

  1. 2017-01-03 16:01

    That is actually a way harder problem speaking math, the same algorithm will not be capable! This problem is np-hard. Maybe check out pyglpk... And check out mixed integer programming.

◀ Go back