by 终结卡尔斯
天池广东大赛机场停机位资源分配优化
第一阶段
Gurobi/CPLEX/CBC/GLPK.
Python 3.5.1 | Anaconda 4.0.0.
PuLP .
-
在/src/main.py中设置可用的线性规划求解库。
-
运行main.py
-
结果位于output目录
├── README.MD // help
├── src // 源代码
│ ├── main.py // 程序入口
│ ├── Airport.py
│ ├── ReadData.py
│ └── MIPSolver.py
├── input
├── doc // 文档
└── output
5.187410586552217(最优解)
若使用新版Gurobi 7.0,pulp的取sol文件部分的程序需要修改。
pulp/solvers.py 中多加一句next(my_file)
def readsol(self, filename):
"""Read a Gurobi solution file"""
with open(filename) as my_file:
try:
next(my_file)
next(my_file) # skip the objective value