glp_ios_heur_sol

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

glp_ios_heur_sol

by Anne-Laurence Putz :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear support,

I would like to fix all variables of a MILP problem before launching  
optimization (to help the branch&cut solver with an upper bound, for  
instance).
Those values are taken either from a custom heuristic of my own or  
from a previously launched MIP optimization.

Anyway, I don?t understand how to do such a thing with GLPK 4.38.

I would like to use glp_ios_heur_sol(), but it doesn?t seem to be the  
method I?m searching for (I don?t understand what is the ?primal  
heuristic? that we have to launch before using glp_ios_heur_sol()).

But I don?t know how to do it differently.
You gave an answer on thread Setting initial integer solution in  
GLPSOL (see  
http://www.nabble.com/Setting-initial-integer-solution-in-GLPSOL-to21005682.html#a21008418).

If I?ve correctly understood, you said that one have to patch GLPK to  
do so ? Because there isn?t any parameter in glp_iocp structure  
indicating that the current solution stored comes from a heuristically  
found solution.

In fact, I want to call a glp_initial_sol(lpProb* prob, const double  
values[]) which would fix all the MILP variables with the ?values?  
array and check for feasibility. Is there any way to do it with GLPK  
4.38 ?

Thank you very much.
Best regards,

Anne-Laurence Putz


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



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

Re: glp_ios_heur_sol

by Andrew Makhorin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> I would like to fix all variables of a MILP problem before launching
> optimization (to help the branch&cut solver with an upper bound, for  
> instance).
> Those values are taken either from a custom heuristic of my own or  
> from a previously launched MIP optimization.

> Anyway, I don?t understand how to do such a thing with GLPK 4.38.

> I would like to use glp_ios_heur_sol(), but it doesn?t seem to be the
> method I?m searching for (I don?t understand what is the ?primal  
> heuristic? that we have to launch before using glp_ios_heur_sol()).

Primal heuristic is a heuristic, which is able to determine an integer
feasible solution as a set of primal values of all variables (columns).

> But I don?t know how to do it differently.
> You gave an answer on thread Setting initial integer solution in  
> GLPSOL (see  
> http://www.nabble.com/Setting-initial-integer-solution-in-GLPSOL-to21005682.html#a21008418).

> If I?ve correctly understood, you said that one have to patch GLPK to
> do so ? Because there isn?t any parameter in glp_iocp structure  
> indicating that the current solution stored comes from a heuristically
> found solution.

> In fact, I want to call a glp_initial_sol(lpProb* prob, const double  
> values[]) which would fix all the MILP variables with the ?values?  
> array and check for feasibility. Is there any way to do it with GLPK  
> 4.38 ?

If you have an integer feasible solution, which you would like to
pass to the mip solver to provide an initial upper bound, you could
use the following code:

void foo(glp_tree *tree, void *info)
{  if (glp_ios_reason(tree) == GLP_IHEUR &&
       glp_ios_curr_node(tree) = 1)
   {   /* lp relaxation to the root subproblem has been just
          solved */
       glp_ios_heur_sol(tree, <array of x[j] found by heuristic>);
   }
   return;
}

int main(...)
{  glp_prob *mip;
   glp_iocp parm;
   . . .
   <apply your own heuristic to find all x[j], j = 1,...,n>
   . . .
   glp_init_iocp(&parm);
   parm.cb_func = foo;
   parm.cb_info = ... ;
   ret = glp_intopt(mip, &parm);
   . . .
}

For more details about glpk api routines used here please see the
reference manual.



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