Sri*_*han 6 python linear-programming pulp
按照http://www.coin-or.org/PuLP/main/installing_pulp_at_home.html#installation的说明,我使用"从源安装的Windows安装"安装了PuLP
当我尝试在页面上运行测试时(页面上的说明:"为了测试你的纸浆安装是否正常工作,请在python解释器中键入以下内容并注意输出应该类似.下面的输出就是你的如果你没有安装任何其他求解器和与纸浆捆绑在一起的CoinMP求解器,我们会期待.")
我的结果:
import pulp pulp.pulpTestAll()Solver pulp.solvers.CPLEX_DLL不可用.Solver pulp.solvers.CPLEX_CMD不可用.Solver pulp.solvers.COIN_CMD不可用.Solver pulp.solvers.COINMP_DLL不可用.Solver pulp.solvers.GLPK_CMD不可用.Solver pulp.solvers.XPRESS不可用.Solver pulp.solvers.GUROBI不可用.
根据网页,这应该是我的输出:
import pulp pulp.pulpTestAll()
Solver pulp.pulp.COIN_MEM不可用.Solver pulp.pulp.COIN_CMD不可用.测试连续LP解决方案测试最大化连续LP解决方案测试无界连续LP解决方案测试MIP解决方案测试MIP松弛测试可行性问题(无客观)测试不可行问题测试整数不可行问题(要修复的错误)测试基于列的建模测试基于列的建模空约束测试双变量和松弛报告测试解决问题测试顺序求解测试分数约束测试弹性约束(无变化)测试弹性约束(freebound)测试弹性约束(惩罚不变)测试弹性约束(惩罚无界)*求解器纸浆. pulp.COINMP_DLL通过.Solver pulp.pulp.GLPK_MEM不可用.Solver pulp.pulp.GLPK_CMD不可用.Solver pulp.pulp.XPRESS无法使用.
我在Windows 7 64位上使用Python 2.7.1,PuLP 1.4.7.
我想这是因为与PuLP捆绑在一起的CoinMP求解器无效.一周前我刚刚开始研究Python,我只是编程方面的业余爱好者.
Afaik 你需要安装任何支持的解算器,例如
sudo aptitude install glpk
Run Code Online (Sandbox Code Playgroud)
或者
sudo aptitude install coinor-libcbc0
Run Code Online (Sandbox Code Playgroud)
刚刚在 (K)ubuntu 11.10 上进行了测试并得到了
Solver pulp.solvers.PULP_CBC_CMD unavailable.
Solver pulp.solvers.CPLEX_DLL unavailable.
Solver pulp.solvers.CPLEX_CMD unavailable.
Testing zero subtraction
Testing continuous LP solution
Testing maximize continuous LP solution
Testing unbounded continuous LP solution
Testing Long Names
Testing repeated Names
Testing MIP solution
Testing MIP relaxation
Testing feasibility problem (no objective)
Testing an infeasible problem
Testing an integer infeasible problem
Testing column based modelling
Testing fractional constraints
Testing elastic constraints (no change)
Testing elastic constraints (freebound)
Testing elastic constraints (penalty unchanged)
Testing elastic constraints (penalty unbounded)
* Solver pulp.solvers.COIN_CMD passed.
Solver pulp.solvers.COINMP_DLL unavailable.
Testing zero subtraction
Testing continuous LP solution
Testing maximize continuous LP solution
Testing unbounded continuous LP solution
Testing Long Names
Testing repeated Names
Testing MIP solution
Testing MIP relaxation
Testing feasibility problem (no objective)
Testing an infeasible problem
Testing an integer infeasible problem
Testing column based modelling
Testing fractional constraints
Testing elastic constraints (no change)
Testing elastic constraints (freebound)
Testing elastic constraints (penalty unchanged)
Testing elastic constraints (penalty unbounded)
* Solver pulp.solvers.GLPK_CMD passed.
Solver pulp.solvers.XPRESS unavailable.
Solver pulp.solvers.GUROBI unavailable.
Solver pulp.solvers.PYGLPK unavailable.
Solver pulp.solvers.YAPOSIB unavailable.
Run Code Online (Sandbox Code Playgroud)
哈