Re: Transfer solution file between clp and glpsol
Andrew Makhorin <[email protected]>
| Newsgroups | gmane.comp.gnu.glpk |
|---|---|
| Message-ID | <1516506674.4837.13.camel@corvax> |
On Sat, 2018-01-20 at 21:36 -0500, Greg Gruber wrote: > Hello, > > > I have a problem which is solving much faster in clp than with glpsol. > I would like to continue to use GMPL for my formulation and > post-processing. If I run just using glpsol, it takes far too long; > if I run with clp (compiled for GMPL support), I get a solution > quickly, however clp then crashes. If i do the following: > > > glpsol --check --wfreemps foo.mps -m mymod.mod -d mydat.dat > clp foo.mps > > > It solves quickly. > > > My problem is that I want to use GMPL scrip for some post-processing > as well. Is there any way to > 1. use glpsol to generate an mps (or lp) file > 2. use clp to solve the underlying problem > 3. SAVE the solution to a file First, you need to save the solution found by clp in the glpk format. If it is a basic solution found by a simplex-like solver, it should be saved in the glpk basic solution format (see glpk 4.64 reference manual, subsection 3.3.2 glp_read_sol — read basic solution in GLPK format). If it is a mip solution, it should be saved in the glpk mip solution format (ibid., subsection 3.3.8 glp_read_mip — read MIP solution in GLPK format). > 4. use glpsol to READ the solution and do post-processing using > GMPL ? Then you may use the following command: glpsol -m mymod.mod -d mydat.dat -r SOLUTION where SOLUTION is the name of a solution file in glpk format. In this case glpsol just takes the known solution to perform model statements specified below the solve statement in mathprog model. > > > Thanks, > Greg > > > _______________________________________________ > Help-glpk mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/help-glpk _______________________________________________ Help-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-glpk