|
|
@ -124,7 +124,12 @@ int add_comb_cut(
|
|
|
|
|
|
|
|
|
|
|
|
log_debug("Violation: %.4lf >= %.4lf\n", lhs, rhs);
|
|
|
|
log_debug("Violation: %.4lf >= %.4lf\n", lhs, rhs);
|
|
|
|
|
|
|
|
|
|
|
|
if (lhs + LP_EPSILON > rhs) goto CLEANUP;
|
|
|
|
if (lhs + LP_EPSILON > rhs)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
free(rmatind);
|
|
|
|
|
|
|
|
free(rmatval);
|
|
|
|
|
|
|
|
goto CLEANUP;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
cut = (struct Row *) malloc(sizeof(struct Row));
|
|
|
|
cut = (struct Row *) malloc(sizeof(struct Row));
|
|
|
|
abort_if(!cut, "could not allocate cut");
|
|
|
|
abort_if(!cut, "could not allocate cut");
|
|
|
@ -139,8 +144,6 @@ int add_comb_cut(
|
|
|
|
abort_if(rval, "LP_add_cut failed");
|
|
|
|
abort_if(rval, "LP_add_cut failed");
|
|
|
|
|
|
|
|
|
|
|
|
CLEANUP:
|
|
|
|
CLEANUP:
|
|
|
|
if (rmatind) free(rmatind);
|
|
|
|
|
|
|
|
if (rmatval) free(rmatval);
|
|
|
|
|
|
|
|
return rval;
|
|
|
|
return rval;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -429,8 +432,8 @@ int find_comb_cuts(struct LP *lp, struct GTSP *data)
|
|
|
|
|
|
|
|
|
|
|
|
if (tooth_count % 2 == 0) continue;
|
|
|
|
if (tooth_count % 2 == 0) continue;
|
|
|
|
|
|
|
|
|
|
|
|
rval = add_comb_cut(lp, data->graph, i, data->node_to_cluster, components,
|
|
|
|
rval = add_comb_cut(lp, data->graph, i, data->node_to_cluster,
|
|
|
|
component_sizes, teeth, tooth_count, x);
|
|
|
|
components, component_sizes, teeth, tooth_count, x);
|
|
|
|
abort_if(rval, "add_comb_cut failed");
|
|
|
|
abort_if(rval, "add_comb_cut failed");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|