GLPK/Known issues

From Wikibooks, open books for an open world
Jump to navigation Jump to search

The page lists known issues with GLPK. Most apply to the underlying library and can therefore affect GLPSOL users and API programmers alike. At the risk of being trite, issues require "work arounds" and bugs require "fixes". If you find a bug, please report it to the [bug-glpk] mailing list.

Unbounded integer variables[edit | edit source]

This issue may arise when a MIP problem instance has an LP relaxation with no finite maximum and an integer feasible region which is empty. In such circumstances, the MIP preprocessor can fall into an infinite loop. This issue was present in version 4.45 and is essentially innate.

One work-around is to specify some extra bounds so that the preprocessor can successfully detect that the instance has no integer feasible solution. Another is to disable the MIP preprocessor. The issue is discussed more fully in this posting and this posting.

MIP gap reporting[edit | edit source]

As of version 4.47, the function ios_relative_gap computes the relative gap as follows:

 gap = |best_mip - best_bnd| / (|best_mip| + DBL_EPSILON)

This means that the gap may rise as you solution improves! It is nonetheless the same formula used by CPLEX function CPXgetmiprelgap. See here for a mid-2012 discussion on alternative formulations.

Solution time limits[edit | edit source]

The GLPSOL option --tmlim nnn limits the solution time to nnn seconds. The timer however is not always active during all phases of a solution. See here for a mid-2012 discussion on the topic.

Those on Linux can use the timeout utility from GNU coreutils to limit the elapse time. In this example, the GLPSOL call will terminate after two hours if it is still running:

timeout 2.0h glpsol --model problem.mod