Basis read/write

View: New views
4 Messages — Rating Filter:   Alert me  

Basis read/write

by prem swaroop :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Team

There #39;s a couple of features documented in 4.34 in the stand-alone solver section (Appendix D):

(Options specifi c to simplex method)

--bas fi lename read initial basis from filename in MPS format

--wbas fi lename write nal basis to fi lename in MPS format

Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39.

Now, documentation for 4.39 does NOT mention these features - so that #39;s at least consistent.

I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here.

I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.

Regards
Prem
 
Team

There's a couple of features documented in 4.34 in the stand-alone solver section (Appendix D):

(Options specifi c to simplex method)

--bas fi lename read initial basis from filename in MPS format

--wbas fi lename write nal basis to fi lename in MPS format

Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39.

Now, documentation for 4.39 does NOT mention these features - so that's at least consistent.

I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here.

I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.

Regards
Prem

_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

Parent Message unknown Re: Basis read/write

by prem swaroop :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Dave.

In the hope of achieving the same, I found and tried -w and -r options documented thus in version 4.39:

   -r filename, --read filename
                     read solution from filename rather to find it with
                     the solver
   -w filename, --write filename
                     write solution to filename in plain text format

However, after -r, the solver does not solve the problem at all (despite my specifying --min just to try).  This is consistent to documentation for sure.

I am unsure how far this can go - but there apparently are APIs that do these jobs, we only need their equivalent command-line versions:

3.3.2 glp read sol—read basic solution from text file
Description
The routine glp_read_sol reads basic solution from a text file whose name
is specified by the parameter fname into the problem object.
For the file format see description of the routine glp_write_sol.

3.3.3 glp write sol—write basic solution to text file
Description
The routine glp_write_sol writes the current basic solution to a text file
whose name is specified by the parameter fname. This file can be read back
with the routine glp_read_sol.

Thanks for a great work!

Regards
Prem

On Sun, Oct 25, 2009 at 12:31 PM, David Posner <dposner@...> wrote:
Hi Prem, I don #39;t have an answer but I asked about a few months ago in connection with a port I was trying to do from a commercial LP solver which supports saving/restoring bases from files and I never got an answer.  Anyway I second your request!

Dave Posner



----- Original Message ----
From: prem swaroop <premswaroop@...>
To: help-glpk@...
Sent: Sunday, October 25, 2009 5:08:46 AM
Subject: [Help-glpk] Basis read/write

Team

There #39;s a couple of features documented in 4.34 in the stand-alone solver section (Appendix D):

(Options specific to simplex method)

--bas filename read initial basis from filename in MPS format

--wbas filename write nal basis to filename in MPS format

Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39.

Now, documentation for 4.39 does NOT mention these features - so that #39;s at least consistent.

I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here.

I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.

Regards
Prem






 
Thanks Dave.

In the hope of achieving the same, I found and tried -w and -r options documented thus in version 4.39:

   -r filename, --read filename
                     read solution from filename rather to find it with
                     the solver
   -w filename, --write filename
                     write solution to filename in plain text format

However, after -r, the solver does not solve the problem at all (despite my specifying --min just to try).  This is consistent to documentation for sure.

I am unsure how far this can go - but there apparently are APIs that do these jobs, we only need their equivalent command-line versions:

3.3.2 glp read sol—read basic solution from text file
Description
The routine glp_read_sol reads basic solution from a text file whose name
is specified by the parameter fname into the problem object.
For the file format see description of the routine glp_write_sol.

3.3.3 glp write sol—write basic solution to text file
Description
The routine glp_write_sol writes the current basic solution to a text file
whose name is specified by the parameter fname. This file can be read back
with the routine glp_read_sol.

Thanks for a great work!

Regards
Prem

On Sun, Oct 25, 2009 at 12:31 PM, David Posner <dposner@...> wrote:
Hi Prem, I don't have an answer but I asked about a few months ago in connection with a port I was trying to do from a commercial LP solver which supports saving/restoring bases from files and I never got an answer.  Anyway I second your request!

Dave Posner



----- Original Message ----
From: prem swaroop <premswaroop@...>
To: help-glpk@...
Sent: Sunday, October 25, 2009 5:08:46 AM
Subject: [Help-glpk] Basis read/write

Team

There #39;s a couple of features documented in 4.34 in the stand-alone solver section (Appendix D):

(Options specific to simplex method)

--bas filename read initial basis from filename in MPS format

--wbas filename write nal basis to filename in MPS format

Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39.

Now, documentation for 4.39 does NOT mention these features - so that #39;s at least consistent.

I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here.

I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.

Regards
Prem



_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

Re: Basis read/write

by xypron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Prem

reading the basis in MPS format is implemented in the stand alone solver
of GLPK 4.26 in file glplpx20.c. You can download it at
ftp://ftp.gnu.org/gnu/glpk/glpk-4.26.tar.gz

Best regards

Xypron
prem swaroop wrote:
Team

There #39;s a couple of features documented in 4.34 in the stand-alone solver section (Appendix D):

(Options specifi c to simplex method)

--bas fi lename read initial basis from filename in MPS format

--wbas fi lename write nal basis to fi lename in MPS format

Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39.

Now, documentation for 4.39 does NOT mention these features - so that #39;s at least consistent.

I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here.

I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.

Regards
Prem
 
Team There's a couple of features documented in 4.34 in the stand-alone solver section (Appendix D): (Options specifi c to simplex method) --bas fi lename read initial basis from filename in MPS format
--wbas fi lename write nal basis to fi lename in MPS format Both are missing from the glpsol that I built on cygwin/Windows Vista, for versions 4.34 as well as 4.39. Now, documentation for 4.39 does NOT mention these features - so that's at least consistent.
I suspect this feature existed earlier on.  I think this could be a useful feature to keep, and I can quote my case here. I am essentially solving a large-ish LP whose parameters are generated by incrementing one parameter value.  And so, I dont expect too many changes in the solution for a large part of my increments, and hence using a final basis for one solution as an initial basis for the next could save a lot in time.
Regards Prem

_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk

Re: Basis read/write

by Andrew Makhorin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> There #39;s a couple of features documented in 4.34 in the
> stand-alone solver section (Appendix D):

> (Options specifi c to simplex method)

> --bas fi lename read initial basis from filename in MPS format

> --wbas fi lename write nal basis to fi lename in MPS format

> Both are missing from the glpsol that I built on cygwin/Windows
> Vista, for versions 4.34 as well as 4.39.

> Now, documentation for 4.39 does NOT mention these features - so that
> #39;s at least consistent.

> I suspect this feature existed earlier on.  I think this could be a
> useful feature to keep, and I can quote my case here.

> I am essentially solving a large-ish LP whose parameters are
> generated by incrementing one parameter value.  And so, I dont expect
> too many changes in the solution for a large part of my increments,
> and hence using a final basis for one solution as an initial basis for
> the next could save a lot in time.

Options --bas and --wbas were temporarily removed from glpsol, since
they supported only fixed mps format. This made them useless in most
cases due to limitation of row/column name length to 8 chars (in
mathprog models the names produced by the translator are, as a rule,
longer).



_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk