[Top][All Lists]

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

[Help-glpk] Setting initial integer solution in GLPSOL

From: xypron
Subject: [Help-glpk] Setting initial integer solution in GLPSOL
Date: Sun, 14 Dec 2008 14:50:40 -0800 (PST)

Hello Andrew,

I would like to set the integer values of a possible solution in glpsol such
that this solution is used as a starting point for the branch and cut
solver. I do not want to preset the non integer values.

I have patched glpk-4.34 such that variable values can be preset, e.g.
var x := 4;

The changed files and diffs can be downloaded from

Changes (including changes for outputting dual values) are in
src/glpapi16.c (only changes for output of dual values)
src/glpmpl04.c (only changes for output of dual values)

What is missing, are the necessary changes to glpsol (glpapi17.c).

Would this be a correct implementation:

Create a callback routine. Pass it as parm.cb_func to glp_intopt.
In the callback routine react to the first call
with reason GLP_IHEUR as follows:
- Preset the integer variables in tree->mip.
- Initialize parameters: glp_init_smcp(&parm);
- Set parameters: parm.meth = GLP_DUALP;
- Solve the LP: ret = glp_simplex(tree->mip, &parm);
- Pass all variables with a call to glp_ios_heur_sol.

Is this a feature you would be willing to integrate into the distribution?

Best regards


View this message in context:
Sent from the Gnu - GLPK - Help mailing list archive at

reply via email to

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