How can I get integer solutions with scipy.optimize.linprog?

前端 未结 1 1286
长发绾君心
长发绾君心 2020-12-17 23:13

When I solve the problem of Linear Programming, like in the following formula, I want the result of x all to be int type

Consider the following prob

1条回答
  •  萌比男神i
    2020-12-17 23:48

    From the docs:

    method : str, optional Type of solver. At this time only ‘simplex’ is supported.

    Simplex cannot handle integrality constraints so you cannot solve integer programming problems with scipy.optimize.linprog yet. You can try other libraries like PuLP, Pyomo or CVXOPT.

    0 讨论(0)
提交回复
热议问题