Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-18 Thread Michael Hennebry

On Sat, 16 Jan 2016, Chris Matrakidis wrote:


On 16 January 2016 at 17:17, Sascha Brügmann 
wrote:



Michael Hennebry  web.cs.ndsu.nodak.edu> writes:

Perhaps it would be a good idea to make the presolving and
scaling transformation available to the user program.
It could just be a matter of documentation.
The information must already be somewhere,
otherwise glpsol could not invert it.

Yes, thats what I'm talking about!



Unfortunately it's not just a matter of documentation: internally, only the
transformations to convert solutions of the preprocessed problem back to
the original problem are available.


That might be sufficient.
I'd be surprised if the transformation were not effectively invertible,
i.e. a feasible solution in the original variables could not
be transformed to a solution for the proprocessed problem.

--
Michael   henne...@web.cs.ndsu.nodak.edu
"Sorry but your password must contain an uppercase letter, a number,
a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
 --  someeecards___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-17 Thread Sascha Brügmann

Am 16.01.2016 um 18:24 schrieb Chris Matrakidis:

glp_read_mip(mip, "solution_file");
parm.use_sol = GLP_ON;
glp_intopt(mip, );

Mh, I use GLPK via API from a bigger Java application using java-glpk 
and SCPSolver.
First writing the problem/solution to disk and instantly reading it 
seems a bit weird. But if this is the only way to provide an inital 
solution...


Overall 'provide initial solution(s)' looks like a currently not 
supported usecase.


___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-17 Thread Chris Matrakidis
On 17 January 2016 at 15:57, Sascha Brügmann <
sascha.bruegm...@googlemail.com> wrote:
>
> First writing the problem/solution to disk and instantly reading it seems
> a bit weird. But if this is the only way to provide an inital solution...
>

The only other way I know to provide an initial solution I find even more
awkward... You call glp_intopt(), with presolving disabled, with a callback
that calls glp_ios_heur_sol() followed by glp_ios_terminate(). Then you can
call glp_intopt() a second time with presolving enabled and the use_sol
parameter set.


Best Regards,

Chris Matrakidis
___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-16 Thread Sascha Brügmann
Heinrich Schuchardt  gmx.de> writes: 
> When presolving and scaling is switched off you could use
> glp_create_index and glp_find_col
> to identify the column numbers to be used when specifying the solution.
As presolving reduces calculation time it is not an option to deactivate 
it. Using simplex instead of the presolver is also kindof senseless when I 
already have some solution if my understanding is correct.


Michael Hennebry  web.cs.ndsu.nodak.edu> writes:
> Perhaps it would be a good idea to make the presolving and
> scaling transformation available to the user program.
> It could just be a matter of documentation.
> The information must already be somewhere,
> otherwise glpsol could not invert it.
Yes, thats what I'm talking about!


___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-16 Thread Chris Matrakidis
On 16 January 2016 at 17:17, Sascha Brügmann 
wrote:


> Michael Hennebry  web.cs.ndsu.nodak.edu> writes:
> > Perhaps it would be a good idea to make the presolving and
> > scaling transformation available to the user program.
> > It could just be a matter of documentation.
> > The information must already be somewhere,
> > otherwise glpsol could not invert it.
> Yes, thats what I'm talking about!


Unfortunately it's not just a matter of documentation: internally, only the
transformations to convert solutions of the preprocessed problem back to
the original problem are available.

Presumably, you want to use the solution you have to accelerate the
solution process. There is a way to do that, but it involves using an
undocumented option, so there may be some side effects. You have to set the
mip solution values and status for the original problem, which can be done
using a file and glp_read_mip() and then set the undocumented option
use_sol before calling glp_intopt(), like in this C example:

glp_read_mip(mip, "solution_file");
parm.use_sol = GLP_ON;
glp_intopt(mip, );

Beware: the solution will not be correct for the preprocessed problem until
a new one is found.


Best Regards,

Chris Matrakidis
___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-15 Thread Heinrich Schuchardt
Hello Sascha,

your mail had to be forwarded manually because you are not subscribed to
the GLPK help list, cf.
https://lists.gnu.org/mailman/listinfo/help-glpk

Looking at the code in src/glpkapi09.c and glpapi13.c the documentation
is wrong.

The problem accessible in the MIP callback is the presolved and scaled
problem. So if you have a heuristic solution expressed in your original
variables you should switch off presolving and scaling.

When presolving and scaling is switched off you could use
glp_create_index and glp_find_col
to identify the column numbers to be used when specifying the solution.

Best regards

Heinrich Schuchardt

On 01/12/2016 01:12 PM, Andrew Makhorin wrote:
>  Forwarded Message 
> From: Sascha Brügmann 
> To: help-glpk@gnu.org
> Subject: glp_intopt conversion of solutions via callback
> Date: Mon, 11 Jan 2016 22:05:35 +0100
> 
> Hi,
> I use GLPKs glp_intopt. As I always have an (mostly non-optimal)
> feasible solution to all of my problem-LPs I need a way to inject these
> initial solutions. I've tried the callback-way like described
> here https://lists.gnu.org/archive/html/help-glpk/2012-02/msg00031.html.
> 
> 
> Question 1: Documentation for GLPK 4.57 chapter "5.2.7 glp_ios_heur_sol"
> talks about 'original problem' such that one can think
> that glp_ios_heur_sol accepts a solution for the non-preprocessed-mip
> which is then converted to preprocessed-mip automatically. This
> contrasts to what has been written on the upper link i've posted. Who is
> right?
> 
> 
> Question 2: If glp_ios_heur_sol requires the provided solution in
> presolved-mip-format, how can I convert a solution from
> non-presolved-mip-format (the original LP-problem)
> to presolved-mip-format?
> 
> 
> Thanks
> 
> 
> 
> ___
> Help-glpk mailing list
> Help-glpk@gnu.org
> https://lists.gnu.org/mailman/listinfo/help-glpk
> 


___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk


Re: [Help-glpk] [Fwd: glp_intopt conversion of solutions via callback]

2016-01-15 Thread Michael Hennebry

On Fri, 15 Jan 2016, Heinrich Schuchardt wrote:


Looking at the code in src/glpkapi09.c and glpapi13.c the documentation
is wrong.

The problem accessible in the MIP callback is the presolved and scaled
problem. So if you have a heuristic solution expressed in your original
variables you should switch off presolving and scaling.


Perhaps it would be a good idea to make the presolving and
scaling transformation available to the user program.
It could just be a matter of documentation.
The information must already be somewhere,
otherwise glpsol could not invert it.

--
Michael   henne...@web.cs.ndsu.nodak.edu
"Sorry but your password must contain an uppercase letter, a number,
a haiku, a gang sign, a heiroglyph, and the blood of a virgin."
 --  someeecards

___
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk