我想比较Gurobi和Scipy的线性编程工具,比如linprog。 SciPy的要求来指定一个问题,同时Gurobi就像here这样Scipy.linprog的Gurobi风格模型构建?
m = Model()
m.addVar(...) %for variables
m.addConstr(..>) %for constraints
m.update() %for updating the model
m.optimize % for optimizing the model
m.params %for getting parameters
m._vars %for getting variables
比较
Minimize: c^T * x
Subject to: A_ub * x <= b_ub
A_eq * x == b_eq
c : array_like
Coefficients of the linear objective function to be minimized.
A_ub : array_like, optional
2-D array which, when matrix-multiplied by x, gives the values of the upper-bound inequality constraints at x.
b_ub : array_like, optional
1-D array of values representing the upper-bound of each inequality constraint (row) in A_ub.
A_eq : array_like, optional
2-D array which, when matrix-multiplied by x, gives the values of the equality constraints at x.
b_eq : array_like, optional
1-D array of values representing the RHS of each equality constraint (row) in A_eq.
bounds : sequence, optional
我的目标是把代码写在只有一个方法,仍然基准与两个结果求解。为了加快比较求解器:
是否存在用于Scipy的LP问题的Gurobi式模型构造?
是否存在一些包使两种方法可以互换(我可以为Gurobi编写scipy风格,或者为Scipy编写Gurobi风格)?
scipy会提供任何其他接口来指定线性编程问题吗?
你见过[this](https://stackoverflow.com/questions/22767608/sparse-matrix-lp-problems-in-gurobi-python)回答? – Ioannis
loannis:谢谢,但它是关于稀疏矩阵,这里没有真正的相关性。 – hhh