Monday, June 29, 2009

Cbc/glpk

There is an option in Coin-or’s CBC to include the modeling language from glpk. This is a reasonable subset of AMPL. I tried to compile this quickly but it took me longer than expected, mainly because the CBC sources are not updated for the latest glpk versions which have a different API.

Some observations:

  • The configure script is very time consuming: it is checking for the C++ compiler again and again (for each subsystem).
  • It was a little bit trial and error to convince the system to include glpk. I looked briefly (may be too briefly) for documentation.
  • The glpk system is considered just another input format. The sources of the glpk integration are actually embedded in the source file for reading MPS files. This means that the output (solution) is not brought back to glpk so no report writing in glpk is available.
  • I suspect the solution file has no names but only numbers (I tried different things without avail but may be there is a way). How to map names to numbers? Don’t know.
  • May be cbc should be called from glpk instead of the other way around. That would deal with a number of the issues mentioned here.
  • To process the file use xxx.mod%xxx.dat or xxx.mod% on the command line (see screen dump below).

cbcglpk

1 comment:

  1. Run GLPK seperately and save the problem to free mps format with --wfreemps [filename] --check. Then run CBC with [filename] as input. The resulting solution has corresponding variable names.

    ReplyDelete