Derrick Stolee
J. L. Doob Research Assistant Professor
Department of Mathematics
University of Illinois at Urbana-Champaign

Home

Teaching

Papers

Presentations

Software

Other

MATH 482 - Linear Programming

Linear Programming Software

When attempting to solve large-scale linear programs, it is best to use software. This page lists a few options, along with links to tutorials and examples.

Sage (with GLPK or LAPACK)

Sage (www.sagemath.org) is an open-source math software library, and can be used as a Maple or Mathematica replacement. Sage works on all platforms: Windows, Mac, and Linux. If you download the standard version, you will have GLPK and LAPACK packages installed.

Example from Class and the PDF Printout.

Follow the links below for tutorials for using Sage to solve linear programs. Mac Users: If you are downloading sage, the app version has a problem if you have not installed the non-app version. So, I recommend you download the non-app version, and copy the "sage/" folder into your "/Applications/" folder. You can then run Sage using two options:
  1. Open Terminal, run "/Applications/sage/sage", and after it starts up, type "notebook()".
  2. Download the app version as well, when it runs, select "/Applications/sage/sage" as the location of the executable, or use the Sage menu to select "Preferences" and use "/Applications/sage/sage" as a custom executable location.


If you wish to use Sage for your homework problem, please include a printout of your Sage worksheet, including your data input, the code to run the linear program, and your output solution.

GLPK: the GNU Linear Programming Kit

GLPK (www.gnu.org/software/glpk/) is an open-source software library for solving linear programs. GLPK is built for Linux, but will also work on OS X (if you have the XCode development software [registration required], required for compiling) or Windows if you have cygwin installed. Since GLPK requires a compilation step, it is not recommended if you are not familiar with C compiling commands, such as make, gcc, or ./configure.

To use GLPK as a standalone executable, first download the software, type ./configure, then make all install to compile. Then, go to the examples/ directory and type make. Now, the executable glpsol is ready to go in the examples/ directory. There are several examples in that directory.

To execute, run ./glpsol --model INPUTFILE --output OUTPUTFILE.

LP Example from Class and Transport Example from Class

Follow the links below for more information. If you wish to use GLPK for your homework problem, please include a printout of your input file and a printout of the program output (including the command you ran to execute GLPK).

COIN-OR: COmputational INfrastructure for Operations Research

COIN-OR (www.coin-or.org) is an open-source library, similar in spirit to GLPK but much larger. Instead of focusing solely on linear programming, COIN-OR also has solvers for integer linear programs, quadratically-constriant linear programs, and many others. Since COIN-OR is larger than GLPK, I typically do not recommend it, but consider the How Run COIN-OR Solvers Without Compiling Code section of CoinEasy. If you with to use COIN-OR for your homework problem, please include a printout of your input file and a printout of the program output (including the command you ran to execute GLPK).

Other Software

The following links are for linear programming software not supported by the instructor. If you find one of these (or some other software) more useful for you, then go ahead and use it. Consult with the instructor for how to present your homework solution.