[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Converting solutions between CPlex and GLPK

From: Andrew Makhorin
Subject: Re: [Help-glpk] Converting solutions between CPlex and GLPK
Date: Thu, 01 Sep 2011 05:27:06 +0400

> I have a hard mixed integer problem. Due to the size of the problem, I 
> like to specify it using Mathprog. But I have CPlex to do the number 
> crunching, leading to the following setup:
> 1) Use GLPK to output the problem into LP format
> 2) Use CPlex to solve the problem
> 3) Use conversion script to translate the CPlex XML solution file into
>     a GLPK solution file format
> 4) Use GLPK to 'solve' the problem with a precomputed (by CPlex)
>     solution, and use the nice Mathprog features again.
> The problem is step 3. I though I had cooked up something, but GLPK is 
> complaining. The following is the case.
> CPlex gives a list of constraints and variable values. The number of 
> constraints is however 1 short of the amount of rows GLPK expects. The 
> number of variables corresponds precisely with the amount of columns 
> GLPK expects. When I add an extra line (i.e. a '0') to the converted 
> solution file, then the whole setup works, but at times the 'solution'
> becomes inconsistent.
> Note that currently I am only looking at mixed integer problems (mip).
> In the GLPK source code 'glp_read_mip' and 'glp_write_mip' are of interest.
> What am I missing in mapping the CPlex output to the GLPK solution format?

You may use 'glpsol -o filename --tmlim 1' to produce a listing that
contains all rows and columns in the same order as glpsol expects them
to appear on reading the solution file. Then compare that listing and
the cplex output to find which row is missing. I guess it is the
objective function row, which is free and therefore not processed by

reply via email to

[Prev in Thread] Current Thread [Next in Thread]