Adding a heuristic for guessing an optimization function when using glpk.