--- main.c.org 2015-10-15 10:00:00.000000000 +0300 +++ main.c 2015-10-19 00:46:37.500000000 +0300 @@ -417,12 +417,28 @@ * the branch-and-cut algorithm. */ void cb_func(glp_tree *T, void *info) -{ xassert(info == info); +{ static int j, k; + if (k == 0) + k = glp_get_num_cols(P); + xassert(info == info); switch (glp_ios_reason(T)) { case GLP_IROWGEN: /* generate one violated subtour elimination constraint */ gen_subt(T); break; + case GLP_IHEUR: + for (j = 1; j <= k; j++) + { if (glp_get_col_kind(P, j) == GLP_BV) + { glp_set_col_kind(P, j, GLP_CV); + break; + } + } + break; + case GLP_ICUTGEN: + if (j > 0 && j <= glp_get_num_cols(P)) + glp_set_col_kind(P, j, GLP_BV); + j = 0; + break; } return; }