help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Basis read/write


From: prem swaroop
Subject: Re: [Help-glpk] Basis read/write
Date: Tue, 15 Dec 2009 20:09:42 +0300

Thanks Andrew.  My reason is listed by you as (c).

As I pointed out in the earlier thread, when I use -r, glpsol does not solve, 
it just reads the solution.  I tried to state --min or --dual or --primal in 
the command line option, to no avail; -o works, in which case it just writes 
out the solution it read in the readable -o format.

May be I am missing something, please let me know, thanks, regards
Prem

Sample below:

Step 1: write out (-w):
===============

$ glpsol.exe -m ../LP_MIP/NPMU_relax_mathprog.txt -w p -d ../LP_MIP/10P12U.txt
--primal
GLPSOL: GLPK LP/MIP Solver 4.40
Parameter(s) specified in the command line:
 -m ../LP_MIP/NPMU_relax_mathprog.txt -w p -d ../LP_MIP/10P12U.txt --primal
Reading model section from ../LP_MIP/NPMU_relax_mathprog.txt...
17 lines were read
Reading data section from ../LP_MIP/10P12U.txt...
../LP_MIP/10P12U.txt:69: warning: unexpected end of file; missing end statement
inserted
69 lines were read
Generating cost...
Generating demand...
Generating lbsupp...
Generating ubsupp...
Generating forcey...
Model has been successfully generated
Original LP has 263 rows, 240 columns, 960 non-zeros
Presolved LP has 262 rows, 240 columns, 720 non-zeros
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  1.800e+02  ratio =  1.800e+02
GM: min|aij| =  4.855e-01  max|aij| =  2.060e+00  ratio =  4.243e+00
EQ: min|aij| =  2.357e-01  max|aij| =  1.000e+00  ratio =  4.243e+00
Constructing initial basis...
Size of triangular part = 262
      0: obj =   5.850000000e+02  infeas =  1.231e+03 (0)
*   128: obj =   6.066733405e+02  infeas =  2.793e-14 (0)
*   200: obj =   3.165361472e+02  infeas =  9.715e-15 (0)
*   235: obj =   2.694406385e+02  infeas =  5.550e-31 (0)
OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.5 Mb (563837 bytes)
Writing basic solution to `p #39;...
505 lines were written

Step 2: read in (-r):
===============

$ glpsol.exe -m ../LP_MIP/NPMU_relax_mathprog.txt -r p -d ../LP_MIP/10P12U.txt
--primal
GLPSOL: GLPK LP/MIP Solver 4.40
Parameter(s) specified in the command line:
 -m ../LP_MIP/NPMU_relax_mathprog.txt -r p -d ../LP_MIP/10P12U.txt --primal
Reading model section from ../LP_MIP/NPMU_relax_mathprog.txt...
17 lines were read
Reading data section from ../LP_MIP/10P12U.txt...
../LP_MIP/10P12U.txt:69: warning: unexpected end of file; missing end statement
inserted
69 lines were read
Generating cost...
Generating demand...
Generating lbsupp...
Generating ubsupp...
Generating forcey...
Model has been successfully generated
Reading basic solution from `p #39;...
505 lines were read


On Mon, Dec 14, 2009 at 11:57 PM, Andrew Makhorin <address@hidden> wrote:
> While I understand the reason why these features were removed, I was
> wondering whether these are scheduled to be re-introduced (without the
> limitations listed by Andrew of course) sometime in future.

> The one release post my last mail (4.40) does not have these.



Still not, sorry.

I see three reasons you need to save the basis in a file:

a) you would like to run an LP which has been solved just to
  reproduce results (for example, to debug printing report in
  MathProg model). In this case you can use the options
   #39;-w filename #39; /  #39;-r filename #39;;

b) you would like to process the file with another application.
  Again, you can use the options -w/-r;

c) you would like to solve a similar LP using the basis saved
  as a starting point. Currently it is impossible, because glpk
  has no feature to construct a similar basis. However, if that
  similar LP has *exactly* the same set of rows and columns as
  the original one (for example, only some constraint/objective
  coefficients were changed), you can use the options -w/-r.








 
Thanks Andrew.  My reason is listed by you as (c).

As I pointed out in the earlier thread, when I use -r, glpsol does not solve, it just reads the solution.  I tried to state --min or --dual or --primal in the command line option, to no avail; -o works, in which case it just writes out the solution it read in the readable -o format.

May be I am missing something, please let me know, thanks, regards
Prem

Sample below:

Step 1: write out (-w):
===============

$ glpsol.exe -m ../LP_MIP/NPMU_relax_mathprog.txt -w p -d ../LP_MIP/10P12U.txt
--primal
GLPSOL: GLPK LP/MIP Solver 4.40
Parameter(s) specified in the command line:
 -m ../LP_MIP/NPMU_relax_mathprog.txt -w p -d ../LP_MIP/10P12U.txt --primal
Reading model section from ../LP_MIP/NPMU_relax_mathprog.txt...
17 lines were read
Reading data section from ../LP_MIP/10P12U.txt...
../LP_MIP/10P12U.txt:69: warning: unexpected end of file; missing end statement
inserted
69 lines were read
Generating cost...
Generating demand...
Generating lbsupp...
Generating ubsupp...
Generating forcey...
Model has been successfully generated
Original LP has 263 rows, 240 columns, 960 non-zeros
Presolved LP has 262 rows, 240 columns, 720 non-zeros
Scaling...
 A: min|aij| =  1.000e+00  max|aij| =  1.800e+02  ratio =  1.800e+02
GM: min|aij| =  4.855e-01  max|aij| =  2.060e+00  ratio =  4.243e+00
EQ: min|aij| =  2.357e-01  max|aij| =  1.000e+00  ratio =  4.243e+00
Constructing initial basis...
Size of triangular part = 262
      0: obj =   5.850000000e+02  infeas =  1.231e+03 (0)
*   128: obj =   6.066733405e+02  infeas =  2.793e-14 (0)
*   200: obj =   3.165361472e+02  infeas =  9.715e-15 (0)
*   235: obj =   2.694406385e+02  infeas =  5.550e-31 (0)
OPTIMAL SOLUTION FOUND
Time used:   0.0 secs
Memory used: 0.5 Mb (563837 bytes)
Writing basic solution to `p'...
505 lines were written

Step 2: read in (-r):
===============

$ glpsol.exe -m ../LP_MIP/NPMU_relax_mathprog.txt -r p -d ../LP_MIP/10P12U.txt
--primal
GLPSOL: GLPK LP/MIP Solver 4.40
Parameter(s) specified in the command line:
 -m ../LP_MIP/NPMU_relax_mathprog.txt -r p -d ../LP_MIP/10P12U.txt --primal
Reading model section from ../LP_MIP/NPMU_relax_mathprog.txt...
17 lines were read
Reading data section from ../LP_MIP/10P12U.txt...
../LP_MIP/10P12U.txt:69: warning: unexpected end of file; missing end statement
inserted
69 lines were read
Generating cost...
Generating demand...
Generating lbsupp...
Generating ubsupp...
Generating forcey...
Model has been successfully generated
Reading basic solution from `p'...
505 lines were read


On Mon, Dec 14, 2009 at 11:57 PM, Andrew Makhorin <address@hidden> wrote:
> While I understand the reason why these features were removed, I was
> wondering whether these are scheduled to be re-introduced (without the
> limitations listed by Andrew of course) sometime in future.

> The one release post my last mail (4.40) does not have these.

Still not, sorry.

I see three reasons you need to save the basis in a file:

a) you would like to run an LP which has been solved just to
  reproduce results (for example, to debug printing report in
  MathProg model). In this case you can use the options
  '-w filename' / '-r filename';

b) you would like to process the file with another application.
  Again, you can use the options -w/-r;

c) you would like to solve a similar LP using the basis saved
  as a starting point. Currently it is impossible, because glpk
  has no feature to construct a similar basis. However, if that
  similar LP has *exactly* the same set of rows and columns as
  the original one (for example, only some constraint/objective
  coefficients were changed), you can use the options -w/-r.





reply via email to

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