Skip to content

Latest commit

 

History

History
100 lines (94 loc) · 4.04 KB

report_henry.md

File metadata and controls

100 lines (94 loc) · 4.04 KB

Python LP Package Report

Henry Robbins (2020) | Based on George Frentzel's Report

Pyomo

Pros

  • Quick installation using terminal in conda
  • Uses AMPL dat file (more or less identical)
  • Abstract methods
  • Syntax most similar to AMPL mod files

Cons

  • Poor syntax - does not read well
  • Lengthy variables
  • Objectives and constraints defined by functions

Installation

PuLP

Pros

  • Quick installation using terminal in conda
  • Better syntax then Pyomo

Cons

  • Does not differentiate between objective and constraints well
  • Does not have abstract models
  • Have to write .lp file before solving

Installation

GurobiPy

Pros

  • World-class solver
  • Similar syntax to open-source PySCIPOpt software
  • Potential advantage to have students manipulating data not using .dat file
  • Great syntax

Cons

  • Not open-source - not as useful after students graduate
  • Trying to obtain academic license as a remote student
  • More steps to the installation process
  • Must update model after declaring variables

Installation

PySCIPOpt

Pros

  • Open-source
  • Potential advantage to have students manipulating data not using .dat file
  • Great syntax

Cons

  • Nightmare to install
  • Less reliable
  • Potential issues with dual values

Installation

Somewhat helpful: Handout from University of Southern Denmark, Odense Lab

  1. Download Homebrew
    1. brew install cmake
    2. brew install gcc
    3. brew install boost
  2. Download SCIP Optimization Suite (scipoptsuite-7.0.0.tgz)
    1. Further instructions in README Change the following lines in CMakeLists.text (double check this)
    2. option(PAPILO "should papilo library be linked" OFF)
      1. option(ZIMPL "should zimpl be linked" OFF)
      2. ption(GMP "should GMP be linked" OFF)
      3. option(GCG "should GCG be included" OFF)
      4. option(SOPLEX "should SOPLEX be included" OFF)
    3. Run the following in terminal from the unzipped scipoptsuite-7.0.0
      1. mkdir build
      2. cd build
      3. cmake ..
      4. make
      5. make check
      6. make install
  3. Install the PySCIPOpt module
    1. export SCIPOPTDIR=<path_to_install_dir>
    2. pip install pyscipopt
  4. Documentation and Classes

OR-Tools (Google)

Pros

  • Easy to download
  • Uses open source LP optimization solver: Glop
  • Uses open source MIP optimization solver: CBC
  • Similar syntax to both GurobiPy and PySCIPOpt
  • Excellent documentation

Cons

  • No abstract models

Installation

  • Instructions
  • python -m pip install --upgrade --user ortools
  • NO LONGER NEED TO INSTALL FROM SOURCE TO USE GUROBI
  • From source (to use third-party solvers): source installation
    • Add to Makefile.local
      • UNIX_GUROBI_DIR = /Library/gurobi902/
      • GUROBI_LIB_VERSION = 90
  • Use solver: OR.Solver.GUROBI_MIXED_INTEGER_PROGRAMMING
  • External solvers