help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] [Fwd: Need help in callback routine for GLP_IBRANCH]


From: Andrew Makhorin
Subject: [Help-glpk] [Fwd: Need help in callback routine for GLP_IBRANCH]
Date: Mon, 04 Jul 2011 12:16:59 +0400

-------- Forwarded Message --------
From: sheetal murkute <address@hidden>
To: address@hidden
Subject: Need help in callback routine for GLP_IBRANCH
Date: Mon, 4 Jul 2011 01:00:04 -0400

Hi,

I am using GLPK callback routine to change the behavior of branch and
bound method.
I use glp_ios_reason to determine the reason for calling the call-back
routine.

In this, for the reason GLP_IBRANCH, I have to change rule to select
next variable to branch on.
For this, I need the values of all the variables for LP relaxation
solution at down branch (when candidate variable is set to 0) and up
branch (when candidate variable is set to 1).
I am using following logic for getting these values, but I get the error
that glp_simplex is not allowed at this step. 
Will you please guide me on this?

[ Note:
here j is the candidate variable index obtained from the routine
glp_ios_can_branch(tree, j). 
'numcol' is the total number of variables in sub-problem obtained from
the routine glp_get_num_cols(glp_ios_get_prob(tree)).
]

glp_set_col_bnds(glp_ios_get_prob(tree), j, GLP_UP, 0.0, 0.0);
glp_simplex(glp_ios_get_prob(tree),NULL);
for(i=1,j=1; j<= numcol ; i++,j++)
xlf[i] = glp_get_col_prim(glp_ios_get_prob(tree),j);
        

glp_set_col_bnds(glp_ios_get_prob(tree), j, GLP_LO, 1.0, 0.0);
glp_simplex(glp_ios_get_prob(tree),NULL);
for(i=1,j=1; j<= numcol ; i++,j++)
xuf[i] = glp_get_col_prim(glp_ios_get_prob(tree),j);

-- 




Thanks with Best Regards,
Sheetal 






reply via email to

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