A Matlab MEX Interface for the GLPK library

GLPK (GNU Linear Programming Kit) is a set of routines written in the ANSI C programming language and organized in the form of a callable library. It is intended for solving linear programming (LP), mixed integer programming (MIP), and other related problems.

is a Matlab MEX interface for the GLPK library which offers the following potentials:

  • Possibility to use GLPK through a simple matlab command, namely glpk.

  • Possibility to solve LP/MILP problems by defining all data and parameters in the Matlab workspace.

  • Easy definition of all GLPK parameters from which you can specify, for instance, which solver to use (simplex or interior point), activate/deactivate presolver, etc...

  • Possibility to save the original model on a file specified by the user with one of the formats supported by GLPK: CPLEX LP, fixed MPS, free MPS, plain text (see GLPK's reference manual for further details).

  • A few Matlab examples to show how simple is to define and solve LP/MILP problems.

  • An automatic script to compile your own mex interface.

  • And more... GLPKMEX includes now a simple Matlab-coded QP solver (still in beta version) developed by the author of GLPKMEX which uses GLPK to solve QP problems. A few examples are included in the distribution.

GLPKMEX is available both as source code and precompiled package at


Author: Nicolo' Giorgetti. Logo