[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: testing for optimal solution
From: |
Andrew Makhorin |
Subject: |
[Help-glpk] Re: testing for optimal solution |
Date: |
Sat, 20 May 2006 19:43:09 +0400 |
> I'm converting some PLI models from XPress/Mosel to GNU Mathprog using
> the glpsol tool provided with GLPK as part of an academic work. Until
> now, I found success with all issues, but one:
> The model I received is able to do tests for the optimal solution with
> something (pseudo) like this:
>
> if var_that_holds_the_optiomal_solution = SOME_THING
> {
> print all the results found
> }
> else
> {
> print "no solution found"
> }
>
> I found nowhere a description saying that such variables that hold
> internal value of the solver are available from the model. Can I do
> that ? If I do, is there a list of all kinds of variables like this
> that might help me in the future?
>
> I do need that, because theses programs will be run on a testsuite
> together with the old Mosel ones, and they both are expected to return
> an unified output.
Unfortunately this feature is not implemented yet. If it is vital,
you can change the glpsol source code. Just replace line 871, file
glpsol.c
if (mpl != NULL && mpl_has_solve_stmt(mpl))
by the following
if (mpl != NULL && mpl_has_solve_stmt(mpl) &&
lpx_get_status(lp) == LPX_OPT)
Then, if optimal solution does not exist or was not found, glpsol will
not call the mathprog postsolver.
Andrew Makhorin