简体   繁体   中英

Installing COIN-OR for PuLP

I have solved simple MILP problems with PuLP and I believe 'model.solve()' without any parameters refers to the default solver. But for harder problems, it keeps running and and I can't get a result. I'm wondering how I can install and add free solvers (ie not CPLEX or Gurobi) as a solver. I found COIN-OR but I couldn't find the right structure and documentation to use it. Any help would be greatly appreciated. Regards, Behrouz

  1. Install the solver. This will depend on solver and your operating system, but should be fairly googleable.

  2. Check its installed and pulp can access it by running:

    import pulp

    pulp.pulpTestAll()

This will try all solvers and confirm which available.

  1. Solve your model using model.solve(solver) . For example model.solve(pulp.COIN_CMD())

More here: https://scaron.info/blog/linear-programming-in-python-with-pulp.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM