heur_setcover.c
Go to the documentation of this file.
35/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
47#define HEUR_DESC "set covering primal heuristic according to Caprara, Fischetti, and Toth (1999)"
56#define DEF_CORE_TENT_SIZE 10 /**< number of columns covering each row that are added to the tentative core at the beginning */
60#define DEF_STOP_CRIT_ITER 300 /**< number of iterations of the subgradient phase after which the stopping criterion is tested again */
61#define DEF_STOP_CRIT_DIFF 1.0 /**< stop if absolute difference between best lower and upper bound is less than SCP_STOP_CRIT_DIFF, and */
62#define DEF_STOP_CRIT_RATIO 0.99 /**< the relative ratio between best lower and upper bound is less than DEF_STOP_CRIT_RATIO */
64#define DEF_PI_ALPHA 1.1 /**< increase of pi when no improvement was made, i.e. more columns will be fixed */
65#define DEF_BETA 1.025 /**< allowed gap between lowerbound and upper bound during the subgradient phase */
67#define DEF_MAX_ITER_NO_IMP 1 /**< stop of no improvements during the last X iterations of three-phase */
69#define DEF_GREEDY_MAX_ITER 100 /**< number of multipliers that are used for computing greedy solutions during each iteration */
70#define DEF_MIN_PROB_SIZE 1000 /**< minimum number of variables the problem has to contain for the heuristic to start */
92 SCIP_Bool* rowscovered; /**< boolean array that indicates which rows are covered by the fixed variables */
102 SCIP_HASHMAP* mapvariables; /**< maps variables-indices to [0, nvariables) in array 'variables' */
104 int* nvarconss; /**< array that contains for each variable the number of constraints it is part of */
106 SCIP_Bool columnsavailable; /**< if set then 'columns' contains the columns for all core variables */
112 int nactiveconss; /**< total number of active constraints for which the variables can be retrieved */
124 SCIP_Bool* xgreedylocal; /**< contains variables that are part of a greedy solution, this is not necessarily a global solution */
127 SCIP_Real* lagrangiancostslocal; /**< lagrangian costs (for a certain instance) when only uncovered rows are considered */
128 SCIP_Real* lagrangiancostsglobal; /**< lagrangian costs for the whole instance when all rows and columns are considered */
129 SCIP_Real ubgreedylocal; /**< bound computed by the greedy set cover algorithm for the restricted instance */
130 SCIP_Real lblagrangelocal; /**< lower bound by lagrange relaxation for the restricted instance */
131 SCIP_Real lblagrangeglobal; /**< lower bound by lagrange relaxation for the unrestricted instance */
137 int param_core_tent_size; /**< number of columns covering each row that are added to the tentative core at the beginning */
141 int param_stop_crit_iter; /**< number of iterations of the subgradient phase after which the stopping criterion is tested again */
142 SCIP_Real param_stop_crit_diff; /**< stop if absolute difference between best lower and upper bound is less than SCP_STOP_CRIT_DIFF, and */
143 SCIP_Real param_stop_crit_ratio; /**< the relative gap between best lower and upper bound is less than (1 - SCP_STOP_CRIT_PER */
145 SCIP_Real param_pi_alpha; /**< increase of pi when no improvement was made, i.e. more columns will be fixed */
146 SCIP_Real param_beta; /**< allowed a gap between lowerbound and upper bound during the subgradient phase */
148 int param_max_iter_no_imp; /**< stop of no improvements during the last X iterations of three-phase */
150 int param_greedy_max_iter; /**< number of multipliers that are used for computing greedy solutions during each iteration */
151 int param_min_prob_size; /**< minimum number of variables the master problem needs to contain before the heuristic starts at all */
154 SCP_INSTANCE inst; /**< reduced instance where some variables may be fixed and some rows be covered */
157 SCP_Lagrange_Sol multbestlbtotal; /**< lagrange multiplier that gives the best lower bound for the complete problem */
163 SCIP_Real bestubinst; /**< best upper bound for the reduced instance 'inst' (including fixed costs) */
164 SCIP_Bool* bestubinst_sol; /**< actual solution for the instance 'inst' (including fixed variables) */
165 SCIP_Real bestubsubinst; /**< best upper bound for the reduced instance 'subinst' (including fixed costs) */
166 SCIP_Bool* bestubsubinstsol; /**< actual solution for the instance 'subinst' (including fixed variables) */
173 SCIP_Bool useinitialmultiplier; /**< compute an own initial lagrange multiplier instead of using the best known */
236 * If 'position' is not NULL, the referenced memory location will always contain the internal position of the element
712 *pos = (int) (size_t) SCIPhashmapGetImage(core->mapvariables, (void *) ((size_t) (varidx + 1))); /*lint !e507*/
717/** get all variables that are part of the constraint at position 'pos' (within SCIP) and saves them into 'vars' */
738 SCIP_CALL( SCIPgetConsVars(scip, core->conss[pos], vars, core->maxconstraintvariables, success) );
757/** creates a set covering solution. Adds all fixed variables of 'inst' and all variables of 'source' to 'dest'.
805 memcpy(dest->lagrangiancostslocal, source->lagrangiancostslocal, sizeof(*dest->lagrangiancostslocal) * core->nvariables);
806 memcpy(dest->lagrangiancostsglobal, source->lagrangiancostsglobal, sizeof(*dest->lagrangiancostsglobal) * core->nvariables);
837/** copies the fixed variables from 'source' to 'dest', but not the set of covered rows. this must be done separately. */
877/** initializes a tentative core: for each row the first few columns covering this row are added to the core */
919 SCIP_CALL( SCIPhashmapInsert(core->mapvariables, (void *) ((size_t) (varidx + 1)), (void *) (size_t) i) );
945 SCIPdebugMessage("constraint %i (%s): can't get number of variables\n", i, SCIPconsGetName(core->conss[i]));
952 SCIPdebugMessage("constraint %i (%s): can't get variables\n", i, SCIPconsGetName(core->conss[i]));
1123 /* only allocate memory of it is part of any constraints at all (this should always be the case for core variables) */
1127 SCIP_CALL( SCIPallocBufferArray(scip, &(core->columns[i]), core->nvarconss[i]) ); /*lint !e866*/
1168/** releases memory that is used by the core, including rows and columns, if they were computed */
1230 /* assumption: delta values were already computed and are sorted in increasing order, this happens in computeDelta */
1243 /* release memory that is used for the core rows and columns. it will be allocated again later on */
1293 /* then add the first 'SCP_CORE_TENT_SIZE' columns covering each row in increasing order of their delta values */
1310 /* iterate through list of variables that are part of this constraint, and find the 'param_core_tent_size' variables with lowest delta values */
1380/** for all rows that are covered by the variables in inst->varsfixed, this function adds their indices to inst->rowscovered */
1423 /* if the core columns are not available, iterate through list of constraints and test which conss are covered */
1476 /* iterate through all constraints and check whether each of them contains a variable that is part of the cover */
1507/** computes delta values for variables and fixes new variables within inst, see formula (9) of the paper */
1596 delta[i] += lagrangiancosts[rowpos] * (nvarcovering[rowpos] - 1) / ((SCIP_Real) nvarcovering[rowpos]);
1600 /* sort the variables in increasing order of their delta values, delta_pos is used to track the variables within the array */
1635/* removes redundant columns from 'solution' by removing them one by one (in the order of decreasing costs),
1719 * We use negative costs because we only sort them in increasing order and want to remove the ones with highest costs first.
1720 * The 'varpos' array is used to track which variable is where within the sorted array (it is permutated in the same way as 'costs') */
1735 /* for each variable of the solution: try to remove it and check whether it is still a set cover */
1741 /* we can only remove this variable if every column it covers is covered by another variable */
1810 /* this is actually necessary because there exist constraints where this fails, and we simply need to ignore them */
1828 colpos = heurdata->greedycolpos; /* this array contains the position of the element within the queue and is needed to update the costs */
1829 colmu = heurdata->greedycolmu; /* for each column this contains the number of uncovered rows that it covers */
1830 colgamma = heurdata->greedycolgamma; /* for each column this contains the lagrangian costs of uncovered rows that it covers */
1837 /* compute initial scores for all unfixed columns, see "3. Heuristic Phase" of the paper, and add them to the priority queue */
1891 /* mark all rows covered by this variable as covered and update scores of variables that are affected by this */
1929 colscore[varpos] = (colgamma[varpos] > 0) ? (colgamma[varpos] / ((SCIP_Real) colmu[varpos])) : (colgamma[varpos] * colmu[varpos]);
1944/** computes lagrangian costs for all columns, only considering rows that are uncovered by fixed variables in 'inst' */
1950 SCP_Lagrange_Sol* mult, /**< lagrange multiplier that is used to compute the lagrangian costs*/
2012/** computes lagrangian costs for all columns of the unrestricted instance and a global lower bound. */
2017 SCP_Lagrange_Sol* mult, /**< lagrange multiplier that is used to compute the lagrangian costs*/
2063/** computes an optimal solution to the lagrangian relaxation, see formulae (4), (5) in the paper */
2086 /* also, compute costs for the unrestricted instance. This even computes mult->lblagrangeglobal */
2128 /* to get a lower bound from the multiplier we still need to subtract sum_i u[i] from lblagrangelocal */
2176 SCP_Lagrange_Sol* best_mult_lb, /**< lagrange multiplier that gives the best lower bound for 'inst' */
2200 /* permutate best u by multiplying each entry with a uniformly random value in the range [0.9, 1.1] */
2220 norm = norm + last_mult.subgradient[i] * last_mult.subgradient[i]; /* we have subgradient[i] = 0.0 if row i is not to be considered */
2229 SCIP_Real hk = last_mult.u[i] + lambda * (bestub - last_mult.lblagrangelocal) * last_mult.subgradient[i] / norm; /*lint !e795*/
2288 /* we test how the current best lower bound compares to the best lower bound that was known 'stop_crit_iter' iterations ago:
2292 if( (iter > 0) && (best_mult_lb->lblagrangelocal - stop_crit_lb <= heurdata->param_stop_crit_diff )
2314 SCP_Lagrange_Sol* mult, /**< initialized lagrange multiplier were the new one will be stored */
2564 SCIP_Real hk = mult.u[i] + heurdata->param_lambda * (bestub - mult.lblagrangelocal) * mult.subgradient[i] / norm; /*lint !e795*/
2582 /* apply the greedy algorithm and extend it to a solution of the unrestricted instance by adding fixed variables */
2591 copySetCoverSolution(scip, core, subinst, heurdata->bestubsubinstsol, &heurdata->bestubsubinst, mult.xgreedylocal);
2626 else if( (isFixedVariable(inst, solvars[i]) == TRUE) && (SCIPisZero(scip, SCIPvarGetObj(solvars[i])) == FALSE) )
2634 /* test all constraints and check if the activity is correct, adjust some free variable if necessary */
2661 SCIPerrorMessage("constraint is '%s', can't handle this\n", SCIPconshdlrGetName(SCIPconsGetHdlr(conss[i])));
2729/** the three-phase procedure from the paper. It tries to find near-optimal lagrange multipliers and
2730 * reduces the size of an instance by fixing variables that are likely to be in an optimal solution. */
2751 /* we first create our own copy of the instance, as we need to mark variables as fixed until all variables are fixed */
2755 /* if this function is called for the first time, no multiplier is available and we need to compute one to start with */
2768 /* computeOptimalSolution computes an optimal solution to the lagrange relaxation. Also, it computes the subgradient */
2772 /* we now have a lower and upper bound in mult_lb_local for the instance 'inst' and take these as our starting values */
2773 copySetCoverSolution(scip, core, inst, heurdata->bestubinst_sol, &heurdata->bestubinst, mult_lb_subinst->xgreedylocal);
2774 copySetCoverSolution(scip, core, subinst, heurdata->bestubsubinstsol, &heurdata->bestubsubinst, mult_lb_subinst->xgreedylocal);
2785 /* in the first call of this proceduce there is no best upper bound for the unrestricted instance */
2788 copySetCoverSolution(scip, core, inst, heurdata->bestubsol, &heurdata->bestub, heurdata->bestubinst_sol);
2799 * 1. Derive the subinstance 'subinst' by marking all rows as covered that are covered by fixed variables of 'subinst'. If all rows are covered by fixed variables, stop.
2800 * 2. Perform subgradient optimization to find a lagrange multiplier that gives a better lower bound for 'subinst'.
2801 * 3. Explore the neighborhood of this best multiplier by doing additional subgradient steps and calling the greedy algorithm with each multiplier as argument.
2806 /* stop if all rows are covered by fixed variables or a maximum number of iterations has been reached */
2807 for( niter = 0; niter < heurdata->param_threephase_max_iter && core->nactiveconss > subinst->nrowscovered; ++niter )
2809 /* we mark all rows covered by fixed variables, in addition to the ones that were already covered */
2811 SCIP_CALL( subgradientOptimization(scip, core, subinst, mult_lb_subinst, heurdata->bestubsubinst, heurdata) );
2813 /* explore neighborhood of the best lower bound multiplier by applying the held-karp update again.
2820 copySetCoverSolution(scip, core, subinst, heurdata->bestubinst_sol, &heurdata->bestubinst, heurdata->bestubsubinstsol);
2822 /* extend a solution of 'inst' to a solution of the whole instance and check whether this gives a better global upper bound */
2825 copySetCoverSolution(scip, core, inst, heurdata->bestubsol, &heurdata->bestub, heurdata->bestubinst_sol);
2866 int niternoimp = 0; /* number of iterations for how long no improvement on the upper bound was made */
2881 SCIP_CALL( SCIPallocBufferArray(scip, &heurdata->rccoldelta, heurdata->param_core_tent_size) );
2886 /* we always consider core variables (columns) only to cover rows, so we need to define the first core.
2887 * This is done by choosing for each row the first five columns covering it and adding them to the core. */
2891 * 'maxconstraintvariables' is the maximum number of variables any constraint of the problem contains. */
2892 SCIP_CALL( SCIPallocBufferArray(scip, &heurdata->vars, heurdata->core.maxconstraintvariables) );
2942 SCIPdebugMessage("%d variables are fixed, %d rows are covered\n", inst->nvarsfixed, inst->nrowscovered);
2965 /* increase pi if no better solution was found, i.e. fix more variables in order to cover more rows */
2985 /* compute delta fixes variables of 'bestubsol' within the core that are likely to be part of an optimal solution */
2987 SCIP_CALL( computeDelta(scip, core, inst, heurdata->multbestlbtotal.lagrangiancostsglobal, heurdata->bestubsol, pi, heurdata) );
3007 SCIPdebugMessage("iteration %i: best lower bound: %f, best upper bound: %f\n", niter, heurdata->multbestlbtotal.lblagrangeglobal, heurdata->bestub);
3138 SCIPdebugMessage("not running set covering heuristic because instance is too small (only %i variables)\n", SCIPgetNVars(scip));
3213 "maximum absolute difference between lower and upper bound that is allowed for the stopping criterion",
3217 "minimum ratio between lower and upper bound that is allowed that is allowed for the stopping criterion",
3238 &heurdata->param_threephase_max_iter, FALSE, DEF_THREEPHASE_MAX_ITER, 1, INT_MAX, NULL, NULL) );
#define SCIP_REAL_MAX
#define SCIP_Bool
#define SCIP_Real
#define SCIPABORT()
#define SCIP_REAL_MIN
#define SCIP_CALL(x)
#define TRUE
#define FALSE
GCG interface methods.
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetActivityLinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
GCG_EXPORT SCIP_Bool GCGisMasterSetCovering(GCG *gcg)
Definition: relax_gcg.c:4347
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPgetConsNVars(SCIP *scip, SCIP_CONS *cons, int *nvars, SCIP_Bool *success)
int SCIPconsGetPos(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetConsVars(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int varssize, SCIP_Bool *success)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPallocClearBufferArray(scip, ptr, num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPallocMemory(scip, ptr)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
SCIP_RETCODE SCIPsetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPtrySolFree(SCIP *scip, SCIP_SOL **sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
int SCIPvarGetProbindex(SCIP_VAR *var)
void SCIPfreeRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen)
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randnumgen, SCIP_Real minrandval, SCIP_Real maxrandval)
unsigned int SCIPinitializeRandomSeed(SCIP *scip, unsigned int initialseedvalue)
SCIP_RETCODE SCIPcreateRandom(SCIP *scip, SCIP_RANDNUMGEN **randnumgen, unsigned int initialseed, SCIP_Bool useglobalseed)
void SCIPsortRealInt(SCIP_Real *realarray, int *intarray, int len)
static SCIP_RETCODE allocateMemoryForSolution(SCIP *scip, SCP_CORE *core, SCP_Lagrange_Sol *mult)
Definition: heur_setcover.c:472
static void removeVarsFromCore(SCIP *scip, SCP_CORE *core)
Definition: heur_setcover.c:620
static SCIP_Bool isCoreVariable(SCP_CORE *core, SCIP_VAR *var)
Definition: heur_setcover.c:507
static SCIP_RETCODE computeOptimalSolution(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCP_Lagrange_Sol *mult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2065
static SCIP_RETCODE computeDelta(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCIP_Real *lagrangiancosts, SCIP_Bool *solution, SCIP_Real pi, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1509
static void copySolution(SCIP *scip, SCP_CORE *core, SCP_Lagrange_Sol *dest, SCP_Lagrange_Sol *source)
Definition: heur_setcover.c:794
static void addVarToSolution(SCIP_Bool *solution, SCIP_VAR *var)
Definition: heur_setcover.c:601
static SCIP_Bool isRowCovered(SCP_INSTANCE *inst, int rowpos)
Definition: heur_setcover.c:671
static SCIP_RETCODE exploreNeighborhood(SCIP *scip, SCP_Lagrange_Sol *startmult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2465
static SCIP_RETCODE pqueue_insert(SCIP *scip, PQUEUE *queue, SCIP_Real key, int elem, int *position)
Definition: heur_setcover.c:239
static SCIP_RETCODE computeInitialLagrangeMultiplier(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCP_Lagrange_Sol *mult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2310
static SCIP_RETCODE computeCoreRows(SCIP *scip, SCP_CORE *core, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1018
static void pqueue_get_min(SCIP *scip, PQUEUE *queue, int *elem)
Definition: heur_setcover.c:441
static void freeMemoryForSolution(SCIP *scip, SCP_Lagrange_Sol *mult)
Definition: heur_setcover.c:745
static SCIP_RETCODE pqueue_init(SCIP *scip, PQUEUE *queue)
Definition: heur_setcover.c:198
static void markRowAsCovered(SCP_INSTANCE *inst, int rowpos)
Definition: heur_setcover.c:683
static SCIP_RETCODE computeCoreColumns(SCIP *scip, SCP_CORE *core)
Definition: heur_setcover.c:1094
static SCIP_RETCODE getConsVars(SCIP *scip, SCP_CORE *core, int pos, SCIP_VAR **vars, int *nvars, SCIP_Bool *success)
Definition: heur_setcover.c:719
static SCIP_RETCODE markRowsCoveredByFixedVariables(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1382
static SCIP_RETCODE subgradientOptimization(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCP_Lagrange_Sol *best_mult_lb, SCIP_Real bestub, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2172
static SCIP_RETCODE computeGlobalLagrangianCosts(SCIP *scip, SCP_CORE *core, SCP_Lagrange_Sol *mult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2014
static void pqueue_decrease_key(SCIP *scip, PQUEUE *queue, int pos, SCIP_Real key)
Definition: heur_setcover.c:292
static SCIP_RETCODE checkSetCover(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCIP_Bool *solution, SCIP_Bool *issetcover, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1450
static SCIP_RETCODE reportSolution(SCIP *scip, SCP_INSTANCE *inst, SCIP_Bool *solution, SCIP_HEUR *heur)
Definition: heur_setcover.c:2601
static SCIP_RETCODE getVarIndex(SCIP *scip, SCP_CORE *core, SCIP_VAR *variable, int *pos)
Definition: heur_setcover.c:697
static void pqueue_increase_key(SCIP *scip, PQUEUE *queue, int pos, SCIP_Real key)
Definition: heur_setcover.c:335
static void copySetCoverSolution(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCIP_Bool *dest, SCIP_Real *destcosts, SCIP_Bool *source)
Definition: heur_setcover.c:761
static SCIP_RETCODE initInstance(SCIP *scip, SCP_INSTANCE *inst)
Definition: heur_setcover.c:823
static void fixVariable(SCP_INSTANCE *inst, SCIP_VAR *var)
Definition: heur_setcover.c:581
static void removeVarFromSolution(SCIP_Bool *solution, SCIP_VAR *var)
Definition: heur_setcover.c:636
static SCIP_RETCODE greedySetCover(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCP_Lagrange_Sol *mult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1772
static SCIP_RETCODE removeRedundantColumns(SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_Bool *solution, SCIP_Real *solcosts)
Definition: heur_setcover.c:1638
static void copyInstance(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *dest, SCP_INSTANCE *source)
Definition: heur_setcover.c:839
static SCIP_RETCODE redefineCore(SCIP *scip, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1215
static void clearSolution(SCIP *scip, SCIP_Bool *solution)
Definition: heur_setcover.c:655
static void extendSolution(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCIP_Bool *solution)
Definition: heur_setcover.c:996
static SCIP_RETCODE initTentativeCore(SCIP *scip, SCP_CORE *core, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:879
static SCIP_RETCODE computeLocalLagrangianCosts(SCIP *scip, SCP_CORE *core, SCP_INSTANCE *inst, SCP_Lagrange_Sol *mult, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:1946
static SCIP_RETCODE threePhase(SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
Definition: heur_setcover.c:2732
static SCIP_RETCODE setCoveringHeuristic(SCIP *scip, SCIP_HEUR *heur)
Definition: heur_setcover.c:2857
static SCIP_Bool isVarInSolution(SCIP_Bool *solution, SCIP_VAR *var)
Definition: heur_setcover.c:543
static SCIP_Bool isFixedVariable(SCP_INSTANCE *inst, SCIP_VAR *var)
Definition: heur_setcover.c:525
set covering primal heuristic according to Caprara, Fischetti, and Toth (1999)
#define NULL
Definition: class_conspartition.cpp:44
GCG variable pricer.
#define SCIPerrorMessage
#define SCIPdebugMessage
Definition: struct_gcg.h:55
Definition: heur_setcover.c:80
Definition: heur_gcgdins.c:77
SCIP_Bool param_lambda_adjustments
Definition: heur_setcover.c:138
int param_threephase_max_iter
Definition: heur_setcover.c:149
Definition: heur_setcover.c:98
Definition: heur_setcover.c:89
Definition: heur_setcover.c:123
SCIP_Real * lagrangiancostsglobal
Definition: heur_setcover.c:128
SCIP_Real * lagrangiancostslocal
Definition: heur_setcover.c:127
SCIP_DIDNOTRUN
SCIP_FOUNDSOL
SCIP_OKAY
enum SCIP_Retcode SCIP_RETCODE