matlab - binary linear programming solver in Python -


i have python script in need solve linear programming problem. catch solution must binary. in other words, need equivalent of matlab's bintprog function. numpy , scipy not seem have such procedure. have suggestions on how 1 of these 3 things:

  • find python library includes such function.

  • constrain problem such can solved more general linear programming solver.

  • interface python matlab make direct use of bintprog.

just rigorous, if problem binary programming problem, not linear program.

you can try cvxopt. has integer programming function (see this). make problem binary program, need add constrain 0 <= x <= 1.

edit: can declare variable binary, don't need add constrain 0 <= x <= 1.

cvxopt.glpk.ilp = ilp(...) solves mixed integer linear program using glpk.  (status, x) = ilp(c, g, h, a, b, i, b)  purpose solves mixed integer linear programming problem      minimize    c'*x     subject  g*x <= h                 a*x = b                 x[i] integer                 x[b] binary 

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -