DM515 – Introduction to linear and integer programming

GLPK

Installation

  • Windows: GUSEK
  • Linux and Mac: download GLPK, untar and execute:

    mkdir ~/usr

    ./configure –prefix=/home/yourid/usr

    make

    make install

    The exectuable is then ~/usr/bin/glpsol, or you can add the path in your bash config file:

    echo "export PATH=PATH:~/usr/bin" >> ~/.bashrc

    or tcsh config file (check echo $SHELL to know which shell you are using)

    echo "setenv PATH PATH:~/usr/bin" >> ~/.tcshrc

    As text editor you can use emacs that offers syntax highlighting, provided the extension of the model file is .mod.

Documentation

The main reference is the documentation file gmpl.pdf (70 pages) from doc/ directory in the installation directory. Moreover check the files .mod in the directory examples/.

These might also be worth skimming through:

Usage

  • To solve with GLPK solver:

    glpsol -m plan.mod -o plan.sol

  • To solve with Gurobi:

    glpsol –check –model plan.mod –wlp plan.lp

    gurobi.sh

    gurobi> m=read("plan.lp")

    gurobi> m.optimize()

  • To solve with SCIP from ZIBOPT

    glpsol –check –model plan.mod –wlp plan.lp

    scip -f plan.lp

  • To solve with CPLEX

    glpsol –check –model plan.mod –wlp plan.lp

    cplex plan.lp > read plan.lp > optimize > help

Why GLPK?

Date: 2012-05-01 14:58:08 CEST

Author: Marco Chiarandini

Org version 7.6 with Emacs version 23

Validate XHTML 1.0