3 Programming Languages

Python seems to be a very popular programming language for implementing optimization models at the present time. There exists many packages that facilitate the formulation of problems and the interface to solvers. Python is free and can be implemented from download python. Another Python distribution with many packages already installed is Anaconda. It is especially interesting when using Jupyter Notebook (see below). With the packages NumPy, Panda, SciPy, etc. Python is an ideal tool for scientific computation and data management. To solve models with the various packages – explained there after, the user need also install several solvers using the pip command (or the conda command for anaconda). A first impression comparing three Python packages is given in the article Compares Python interface Pulp-Gurobi-Cplex.

For the purpose of this paper the free solver glpk (linear models), ipopt (non-linear models) and the commercial solver cplex and gurobi are used. Note that a licence is needed for the commercial solvers and separate installation of the solvers is needed too. To install the packages, which installs an interface to the solvers, one need the type on the command line (or the Python command line) :

   pip install glpk
   pip install ipopt
   pip install cplex
   pip install gurobipy

  3.1 Gurobipy (Python – commercial)
   3.1.1 Multi-commodity Flow (netflow)
   3.1.2 3d Tic-Tac-Toe (3d-tic-tac-toe)
   3.1.3 Non-negative Regression (regression1)
  3.2 OR-tools (Google)
   3.2.1 A Simple Nurse Scheduling (nurses)
  3.3 Pyomo (Python – open source)
   3.3.1 Warehouse Location (wl1)
   3.3.2 Warehouse Location (wl2)
   3.3.3 Rosenbrock Function (rosenbrock)
  3.4 Gecco/APMonitor (Python – open source)
   3.4.1 A Hock/Schittkowski model (hs71)
   3.4.2 Problem 8 from APMonitor (prob8)
  3.5 PuLP (Python – open source)
   3.5.1 A Sudoku Instance (sudokuP)
  3.6 Python-MIP (Python – open source)
   3.6.1 The n-Queens Problem (queens)
  3.7 JuMP (Julia – open source)
   3.7.1 Facility Location (facilityLoc)
   3.7.2 Urban Planning: A Puzzle (uplanning)
   3.7.3 The Passport Problem (passport)
  3.8 Other Programming Languages
   3.8.1 A small MIP model (mip1-c)