简体   繁体   中英

How to specify which method you use in PuLP python?

I'm new to optimisation and python so sorry if answer to my question is obvious.

I wanted to use Revised Simplex Method in PuLP and i read in the documentation that there is an option to specify which method the solver uses but i could not find how to do it.

link to the documentation : https://pythonhosted.org/PuLP/main/optimisation_concepts.html

Using the solver COIN-CBC, you can do:

 prob.solve(pulp.COIN_CMD(msg=1, options=['primalSimplex']))

or

 prob.solve(pulp.COIN_CMD(msg=1, options=['dualSimplex']))

Notes:

  • You should observe somewhat different iteration counts.
  • Dual simplex is the default.
  • I assume you mean by "revised simplex" the primal simplex method (CBC has no full-tableau simplex so in that sense all Simplex methods in CBC are "revised").
  • The interior point method can be selected with options=['barrier'] .
  • For large LPs it may make sense to try out these three methods. I am not sure what these options do for MIP models (it is probably better to trust LP defaults in this case)

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