|
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sepa_flowcover.c
Go to the documentation of this file.
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
38 #define SEPA_DELAY FALSE /**< should separation method be delayed, if other separators found cuts? */
41 #define DEFAULT_MAXROUNDSROOT 15 /**< maximal number of separation rounds in the root node (-1: unlimited) */
42 #define DEFAULT_MAXTRIES 100 /**< maximal number of rows to separate flow cover cuts for per separation round
44 #define DEFAULT_MAXTRIESROOT -1 /**< maximal number of rows to separate flow cover cuts for per separation round
46 #define DEFAULT_MAXFAILS 50 /**< maximal number of consecutive fails to generate a cut per separation round
48 #define DEFAULT_MAXFAILSROOT 100 /**< maximal number of consecutive fails to generate a cut per separation round
50 #define DEFAULT_MAXSEPACUTS 100 /**< maximal number of flow cover cuts separated per separation round */
51 #define DEFAULT_MAXSEPACUTSROOT 200 /**< maximal number of flow cover cuts separated per separation round in the root */
52 #define DEFAULT_MAXSLACK SCIP_REAL_MAX /**< maximal slack of rows to separate flow cover cuts for */
53 #define DEFAULT_MAXSLACKROOT SCIP_REAL_MAX /**< maximal slack of rows to separate flow cover cuts for in the root */
55 #define DEFAULT_MAXROWDENSITY 1.0 /**< maximal density of rows to separate flow cover cuts for */
56 #define DEFAULT_DYNAMICCUTS TRUE /**< should generated cuts be removed from the LP if they are no longer tight? */
57 #define DEFAULT_MAXTESTDELTA 10 /**< cut generation heuristic: maximal number of different deltas to try */
58 #define DEFAULT_MULTBYMINUSONE TRUE /**< should flow cover cuts be separated for 0-1 single node flow set with reversed arcs in addition? */
74 #define MAXABSVBCOEF 1e+5 /**< maximal absolute coefficient in variable bounds used for snf relaxation */
89 int maxtriesroot; /**< maximal number of rows to separate flow cover cuts for per separation round
93 int maxfailsroot; /**< maximal number of consecutive fails to generate a cut per separation round
96 int maxsepacutsroot; /**< maximal number of flow cover cuts separated per separation round in the root */
98 SCIP_Real maxslackroot; /**< maximal slack of rows to separate flow cover cuts for in the root */
101 SCIP_Bool dynamiccuts; /**< should generated cuts be removed from the LP if they are no longer tight? */
102 SCIP_Bool multbyminusone; /**< should flow cover cuts be separated for 0-1 single node flow set with reversed arcs in addition? */
111 /** get LP solution value and index of variable lower bound (with binary variable) which is closest to the current LP
112 * solution value of a given variable; candidates have to meet certain criteria in order to ensure the nonnegativity
113 * of the variable upper bound imposed on the real variable in the 0-1 single node flow relaxation associated with the
124 int* assoctransvars, /**< associated var in relaxed set for all vars of row; construction is not finished yet */
125 SCIP_Real* closestvlb, /**< pointer to store the LP sol value of the closest variable lower bound */
126 int* closestvlbidx /**< pointer to store the index of the closest vlb; -1 if no vlb was found */
170 /* check if current variable lower bound l~_i * x_i + d_i imposed on y_j meets the following criteria:
174 * 0. no other non-binary variable y_k has used a variable bound with x_i to get transformed variable y'_k yet
229 /** get LP solution value and index of variable upper bound (with binary variable) which is closest to the current LP
230 * solution value of a given variable; candidates have to meet certain criteria in order to ensure the nonnegativity
231 * of the variable upper bound imposed on the real variable in the 0-1 single node flow relaxation associated with the
242 int* assoctransvars, /**< associated var in relaxed set for all vars of row; construction is not finished yet */
243 SCIP_Real* closestvub, /**< pointer to store the LP sol value of the closest variable upper bound */
244 int* closestvubidx /**< pointer to store the index of the closest vub; -1 if no vub was found */
292 * 0. no other non-binary variable y_k has used a variable bound with x_i to get transformed variable y'_k
346 /** return global or local lower bound of given variable whichever is closer to the variables current LP solution value */
351 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
353 int* closestlbtype /**< pointer to store type of closest bound; -1 if global lb, -2 otherwise */
372 /* due to numerical reasons, huge bounds are relaxed to infinite bounds; this way the bounds are not used for
379 /** return global or local upper bound of given variable whichever is closer to the variables current LP solution value */
384 SCIP_Bool allowlocal, /**< should local information allowed to be used, resulting in a local cut? */
386 int* closestubtype /**< pointer to store type of closest bound; -1 if global ub, -2 otherwise */
405 /* due to numerical reasons, huge bounds are relaxed to infinite bounds; this way the bounds are not used for
412 /** construct a 0-1 single node flow relaxation (with some additional simple constraints) of a mixed integer set
413 * corresponding to the given row lhs <= a * x + const <= rhs; depending on the given values rowweight and scale
415 * a * (x,y) <= rhs - const if (rowweight = 1, scale = 1) or (rowweight = -1, scale = -1, rhs < infinity)
416 * - a * (x,y) <= - (lhs - const) if (rowweight = -1, scale = 1) or (rowweight = 1, scale = -1, lhs > -infinity)
430 SCIP_BOUNDTYPE* boundtypesfortrans, /**< pointer to store type of bound used for all non-binary vars of row */
433 SCIP_Real* transbinvarsolvals, /**< pointer to store sol val of bin var in vub of all vars in relaxed set */
435 SCIP_Real* transvarvubcoefs, /**< pointer to store coefficient in vub of all vars in relaxed set */
473 SCIPdebugMessage("--------------------- construction of SNF relaxation ------------------------------------\n");
486 /* store nonzero columns representing binary and non-binary variables, and get active binary problem variables the
547 * 2. decide which bound is used to define the real variable y'_j in the 0-1 single node flow relaxation
549 * 4. store for y_j and x_j (if x_j is a binary variable in the row) that y'_j is the associated real variable
552 * for each binary variable x_j in the row which has not been handled with a non-binary variable perform
554 * 2. store for x_j that y'_j is the associated real variable in the 0-1 single node flow relaxation.
556 * start with non-binary variables because a binary variable x_j which is involved in a used variable bound
557 * imposed on a non-binary variable y_j has to be handled together with the non-binary variable y_j.
559 SCIPdebugMessage("transformation for NONBINARY variables (nnonbinvars=%d):\n", nnonzcolsnonbinary);
594 SCIPdebugMessage(" %d: %g <%s, idx=%d, lp=%g, [%g(%d),%g(%d)]>:\n", c, rowcoef, SCIPvarGetName(var), probidx,
597 /* mixed integer set cannot be relaxed to 0-1 single node flow set because both simple bounds are -infinity
606 /* get closest lower bound that can be used to define the real variable y'_j in the 0-1 single node flow
619 SCIP_CALL( getClosestVlb(scip, var, bestsub, rowcoef, rowcoefsbinary, varsolvals, assoctransvars, &bestvlb, &bestvlbidx) );
627 /* get closest upper bound that can be used to define the real variable y'_j in the 0-1 single node flow
640 SCIP_CALL( getClosestVub(scip, var, bestslb, rowcoef, rowcoefsbinary, varsolvals, assoctransvars, &bestvub, &bestvubidx) );
650 /* mixed integer set cannot be relaxed to 0-1 single node flow set because there are no suitable bounds
659 /* select best upper bound if it is closer to the LP value of y_j and best lower bound otherwise and use this bound
660 * to define the real variable y'_j with 0 <= y'_j <= u'_j x_j in the 0-1 single node flow relaxation;
663 if( SCIPisEQ(scip, varsolvals[probidx], (1.0 - BOUNDSWITCH) * bestlb + BOUNDSWITCH * bestub) && bestlbtype >= 0 )
665 else if( SCIPisEQ(scip, varsolvals[probidx], (1.0 - BOUNDSWITCH) * bestlb + BOUNDSWITCH * bestub)
668 else if( SCIPisLE(scip, varsolvals[probidx], (1.0 - BOUNDSWITCH) * bestlb + BOUNDSWITCH * bestub) )
672 assert(SCIPisGT(scip, varsolvals[probidx], (1.0 - BOUNDSWITCH) * bestlb + BOUNDSWITCH * bestub));
684 /* store for y_j that bestlb is the bound used to define y'_j and that y'_j is the associated real variable
724 SCIPdebugMessage(" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
725 transvarcoefs[*ntransvars] == 1 ? "+" : "-", *ntransvars, *ntransvars, transvarvubcoefs[*ntransvars],
739 * y'_j = - ( a_j ( y_j - d_j ) + c_j x_j ) with 0 <= y'_j <= - ( a_j l~_j + c_j ) x_j if a_j > 0
753 contsolval = (rowcoef * (varsolvals[probidx] - vlbconsts[bestlbtype])) + (rowcoefbinary * varsolvalbinary);
772 /* store for x_j that y'_j is the associated real variable in the 0-1 single node flow relaxation */
775 SCIPdebugMessage(" --> bestlb used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
776 transvarcoefs[*ntransvars] == 1 ? "+" : "-", *ntransvars, *ntransvars, transvarvubcoefs[*ntransvars],
777 *ntransvars, SCIPvarGetName(vlbvars[bestlbtype]), *transrhs + (rowcoef * vlbconsts[bestlbtype]), rowcoef,
790 /* store for y_j that bestub is the bound used to define y'_j and that y'_j is the associated real variable
830 SCIPdebugMessage(" --> bestub used for trans: ... %s y'_%d + ..., Y'_%d <= %g x_%d (=1), rhs=%g-(%g*%g)=%g\n",
831 transvarcoefs[*ntransvars] == 1 ? "+" : "-", *ntransvars, *ntransvars, transvarvubcoefs[*ntransvars],
847 * y'_j = - ( a_j ( y_j - d_j ) + c_j x_j ) with 0 <= y'_j <= - ( a_j u~_j + c_j ) x_j if a_j < 0,
860 contsolval = (rowcoef * (varsolvals[probidx] - vubconsts[bestubtype])) + (rowcoefbinary * varsolvalbinary);
879 /* store for x_j that y'_j is the associated real variable in the 0-1 single node flow relaxation */
882 SCIPdebugMessage(" --> bestub used for trans: ... %s y'_%d + ..., y'_%d <= %g x_%d (=%s), rhs=%g-(%g*%g)=%g\n",
883 transvarcoefs[*ntransvars] == 1 ? "+" : "-", *ntransvars, *ntransvars, transvarvubcoefs[*ntransvars],
884 *ntransvars, SCIPvarGetName(vubvars[bestubtype]), *transrhs + (rowcoef * vubconsts[bestubtype]), rowcoef,
889 /* relaxing the mixed integer set to a 0-1 single node flow set was not successful because coefficient of y_j and
890 * the bounds selected for the transformation together result in an infinite variable upper bound in the 0-1 single
930 SCIPdebugMessage(" %d: %g <%s, idx=%d, lp=%g, [%g, %g]>:\n", c, rowcoef, SCIPvarGetName(var), probidx, varsolvals[probidx],
945 /* store for x_j that y'_j is the associated real variable in the 0-1 single node flow relaxation */
1009 /** solve knapsack problem in maximization form with "<" constraint approximately by greedy; if needed, one can provide
1047 /* allocate memory for temporary array used for sorting; array should contain profits divided by corresponding weights (p_1 / w_1 ... p_n / w_n )*/
1055 /* sort tempsort, items, weights and profits such that p_1 / w_1 >= p_2 / w_2 >= ... >= p_n / w_n */
1083 /** checks, whether the given scalar scales the given value to an integral number with error in the given bounds */
1088 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1089 SCIP_Real maxdelta /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1106 /** get integral number with error in the bounds which corresponds to given value scaled by a given scalar;
1113 SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1114 SCIP_Real maxdelta /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1135 /** build the flow cover which corresponds to the given exact or approximate solution of KP^SNF; given unfinished
1150 int* flowcoverstatus, /**< pointer to store whether variable is in flow cover (+1) or not (-1) */
1212 * i.e., get sets C1 subset N1 and C2 subset N2 with sum_{j in C1} u_j - sum_{j in C2} u_j = b + lambda and lambda > 0
1218 SCIP_Real* solvals, /**< LP solution value of binary variable in vub of all real vars in N1&N2 */
1224 int* flowcoverstatus, /**< pointer to store whether variable is in flow cover (+1) or not (-1) */
1268 SCIPdebugMessage("--------------------- get flow cover ----------------------------------------------------\n");
1372 * 1. to a knapsack problem in maximization form, such that all variables in the knapsack constraint have
1373 * positive weights and the constraint is a "<" constraint, by complementing all variables in N1
1381 * 2. to a knapsack problem in maximization form, such that all variables in the knapsack constraint have
1382 * positive integer weights and the constraint is a "<=" constraint, by complementing all variables in N1
1395 /* get weight and profit of variables in KP^SNF_rat and check, whether all weights are already integral */
1407 SCIPdebugMessage(" <%d>: j in N1: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
1408 items[j], transprofitsreal[j], SCIPisIntegral(scip, transweightsreal[j]) ? "" : " ----> NOT integral");
1413 SCIPdebugMessage(" <%d>: j in N2: w_%d = %g, p_%d = %g %s\n", items[j], items[j], transweightsreal[j],
1414 items[j], transprofitsreal[j], SCIPisIntegral(scip, transweightsreal[j]) ? "" : " ----> NOT integral");
1422 /* there exists no flow cover if the capacity of knapsack constraint in KP^SNF_rat after fixing
1442 * solve KP^SNF_int exactly, if a suitable factor C is found and (nitems*capacity) <= MAXDYNPROGSPACE,
1456 SCIP_CALL( SCIPcalcIntegralScalar(transweightsreal, nitems, -MINDELTA, MAXDELTA, MAXDNOM, MAXSCALE, &scalar,
1460 /* initialize number of (non-)solution items, should be changed to a nonnegative number in all possible paths below */
1495 SCIP_CALL(SCIPsolveKnapsackExactly(scip, nitems, transweightsint, transprofitsint, transcapacityint,
1512 SCIP_CALL(SCIPsolveKnapsackApproximatelyLT(scip, nitems, transweightsreal, transprofitsreal, transcapacityreal,
1520 SCIP_CALL(SCIPsolveKnapsackApproximatelyLT(scip, nitems, transweightsreal, transprofitsreal, transcapacityreal,
1528 /* build the flow cover from the solution of KP^SNF_rat and KP^SNF_int, respectively and the fixing */
1530 buildFlowCover(scip, coefs, vubcoefs, rhs, solitems, nonsolitems, nsolitems, nnonsolitems, nflowcovervars,
1534 /* if the found structure is not a flow cover, because of scaling, solve KP^SNF_rat approximately */
1540 SCIP_CALL(SCIPsolveKnapsackApproximatelyLT(scip, nitems, transweightsreal, transprofitsreal, transcapacityreal,
1542 #ifdef SCIP_DEBUG /* this time only for SCIP_DEBUG, because only then, the variable is used again */
1552 buildFlowCover(scip, coefs, vubcoefs, rhs, solitems, nonsolitems, nsolitems, nnonsolitems, nflowcovervars,
1575 SCIPdebugMessage(" flowcoverweight(%g) = rhs(%g) + lambda(%g)\n", flowcoverweight, rhs, *lambda);
1592 /** for a given flow cover and a given value of delta, choose L1 subset N1 \ C1 and L2 subset N2 \ C2 by comparison such that
1600 SCIP_Real* transbinvarsolvals, /**< LP solution value of bin var in vub of all continuous vars in N1 & N2 */
1603 int* transvarflowcoverstatus,/**< pointer to store whether non-binary var is in L2 (2) or not (-1 or 1) */
1629 SCIPdebugMessage(" --------------------- get L1 and L2 -----------------------------------------------------\n");
1630 SCIPdebugMessage(" L1 = { j in N1-C1 : y*_j >= ( u_j - lambda F_{f_beta}( u_j/delta) ) x*_j }\n");
1633 /* set flowcover status of continuous variable x_j to 2, i.e., put j intp L1 and L2, respectively
1646 assert(SCIPisFeasGE(scip, transbinvarsolvals[j], 0.0) && SCIPisFeasLE(scip, transbinvarsolvals[j], 1.0));
1664 if( SCIPisFeasGE(scip, transcontvarsolvals[j], ( transvarvubcoefs[j] - ( lambda * mirval ) ) * transbinvarsolvals[j]) )
1667 SCIPdebugMessage(" <%d>: in N1-C1: %g ?>=? ( %g - %g F_{f_beta}(%g)(%g) ) %g = %g ---> fcstatus = %d\n",
1669 ( transvarvubcoefs[j] - ( lambda * mirval ) ) * transbinvarsolvals[j], transvarflowcoverstatus[j]);
1688 if( SCIPisFeasGE(scip, transcontvarsolvals[j], - ( lambda * mirval ) * transbinvarsolvals[j]) )
1691 SCIPdebugMessage(" <%d>: in N2-C2: %g ?>=? - %g F_{f_beta}(-%g)(%g) %g = %g ---> fcstatus = %d\n",
1698 /** get for all problem variables with nonzero coefficient in current row the bound which should be used for the
1699 * substitution routine in the c-MIR routine; this bound depends on the bound used for each variable to get associated
1707 int* boundsfortrans, /**< bound used for transformation for all non-binary vars of current row */
1708 SCIP_BOUNDTYPE* boundtypesfortrans, /**< type of bound used for transform. for all non-binary vars of current row */
1714 int* boundsforsubst, /**< pointer to store bounds that should be used for substitution in c-mir for vars */
1715 SCIP_BOUNDTYPE* boundtypesforsubst /**< pointer to store types of bounds that should be used for substitution in c-mir */
1805 /** stores nonzero elements of dense coefficient vector as sparse vector, and calculates activity and norm */
1948 SCIPdebugMessage("--------------------- found cut ---------------------------------------------------------\n");
1972 SCIPdebugMessage(" -> found potential flowcover cut <%s>: activity=%f, rhs=%f, norm=%f, eff=%f\n",
1981 SCIPdebugMessage(" -> flowcover cut <%s> no longer efficacious: act=%f, rhs=%f, norm=%f, eff=%f\n",
1993 SCIPdebugMessage(" -> found flowcover cut <%s>: act=%f, rhs=%f, norm=%f, eff=%f, rank=%d, min=%f, max=%f (range=%g)\n",
2055 SCIP_Real* transbinvarsolvals, /**< LP solution value of binary variable in vub of all real vars in N1&N2 */
2058 int* transvarflowcoverstatus, /**< pointer to store whether non-binary var is in L2 (2) or not (-1 or 1) */
2103 SCIPdebugMessage("--------------------- cut generation heuristic ------------------------------------------\n");
2116 * N* = { u_j : j in N and u_j > lambda} & { max{ u_j : j in N and u_j >= lambda } + 1, lambda + 1 };
2143 if( transvarcoefs[j] == -1 && transvarflowcoverstatus[j] == -1 && SCIPisFeasLE(scip, val, transcontvarsolvals[j])
2176 /* store max{ u_j : j in C1 and u_j > lambda } and max{ u_j : j in C1 & L~2 and u_j > lambda } */
2177 if( !SCIPisInfinity(scip, -l2tmpvubcoefsmax) && SCIPisFeasGT(scip, l2tmpvubcoefsmax, c1vubcoefsmax) )
2200 /* for each value of delta choose L1 subset N1\C1 and L2 subset N2\C2 by comparison, generate the
2206 for( j = startidx; j < startidx + ncandsetdelta && ntesteddeltas < sepadata->maxtestdelta; j++ )
2217 /* do not use scaling factors (1/delta) which are too small, since this max cause numerical problems;
2218 * besides for relatively small lambda and large scaling factors (delta), we get f_beta = 1 - lambda/delta > MINFRAC
2234 /* work on copy of transvarflowcoverstatus because current choice of sets L1 and L2 will change
2240 getL1L2(scip, ntransvars, transvarcoefs, transbinvarsolvals, transcontvarsolvals, transvarvubcoefs,
2244 * note that the scalar has already been considered in the constructed 0-1 single node flow relaxation
2246 SCIP_CALL( getBoundsForSubstitution(scip, vars, nvars, boundsfortrans, boundtypesfortrans, assoctransvars,
2250 SCIP_CALL( SCIPcalcMIR(scip, sol, BOUNDSWITCH, TRUE, ALLOWLOCAL, FIXINTEGRALRHS, boundsforsubst, boundtypesforsubst,
2251 (int) MAXAGGRLEN(nvars), 1.0, MINFRAC, MAXFRAC, rowweights, NULL, scalar * onedivdelta, NULL, NULL, cutcoefs,
2288 getL1L2(scip, ntransvars, transvarcoefs, transbinvarsolvals, transcontvarsolvals, transvarvubcoefs,
2291 /* for best value of delta: get bounds for substitution in c-MIR routine for original mixed integer set
2292 * note that the scalar has already been considered in the constructed 0-1 single node flow relaxation
2294 SCIP_CALL( getBoundsForSubstitution(scip, vars, nvars, boundsfortrans, boundtypesfortrans, assoctransvars,
2297 /* generate c-MIRFCI for flow cover (C1,C2), L1 subset N1\C1 and L2 subset N2\C2 and bestdelta */
2298 SCIP_CALL( SCIPcalcMIR(scip, sol, BOUNDSWITCH, TRUE, ALLOWLOCAL, FIXINTEGRALRHS, boundsforsubst, boundtypesforsubst,
2299 (int) MAXAGGRLEN(nvars), 1.0, MINFRAC, MAXFRAC, rowweights, NULL, scalar * onedivbestdelta, NULL, NULL, cutcoefs,
2310 SCIP_CALL( addCut(scip, sepa, sepadata, vars, nvars, sol, varsolvals, cutcoefs, cutrhs, cutislocal, cutrank, normtype, cutoff, ncuts) );
2474 /* calculate row scores for both sides of all rows, and sort rows by nonincreasing maximal score */
2516 rowlhsscores[r] = dualscore + DENSSCORE * rowdensity + sepadata->slackscore * MAX(1.0 - slack, 0.0);
2528 rowrhsscores[r] = dualscore + DENSSCORE * rowdensity + sepadata->slackscore * MAX(1.0 - slack, 0.0);
2555 maxfails += maxfails - 2*SCIPgetNSepaRounds(scip); /* allow up to double as many fails in early separounds of root node */
2558 for( r = 0; r < nrows && ntries < maxtries && ncuts < maxsepacuts && rowscores[roworder[r]] > 0.0
2569 /* update weight of rows for aggregation in c-MIR routine; all rows but current one have weight 0.0 */
2572 assert(rowweights[roworder[r-1]] == 1.0 || rowweights[roworder[r-1]] == -1.0 || rowweights[roworder[r-1]] == 0.0);
2590 SCIPdebugMessage("===================== flow cover separation for row <%s> (%d of %d) ===================== \n",
2601 /* construct 0-1 single node flow relaxation (with some additional simple constraints) of the mixed integer set
2607 SCIP_CALL( constructSNFRelaxation(scip, vars, nvars, varsolvals, rows[roworder[r]], rowweights[roworder[r]],
2620 SCIP_CALL( getFlowCover(scip, transvarcoefs, transbinvarsolvals, transvarvubcoefs, ntransvars, transcapacity,
2630 /* generate most violated c-MIRFCI for different sets L1 and L2 and different values of delta and add it to the LP */
2631 SCIP_CALL( cutGenerationHeuristic(scip, sepa, sepadata, vars, nvars, sol, varsolvals, rowweights, mult, boundsfortrans,
2632 boundtypesfortrans, assoctransvars, ntransvars, transvarcoefs, transbinvarsolvals, transcontvarsolvals,
2777 SCIP_CALL( SCIPincludeSepaBasic(scip, &sepa, SEPA_NAME, SEPA_DESC, SEPA_PRIORITY, SEPA_FREQ, SEPA_MAXBOUNDDIST,
2803 "maximal number of rows to separate flow cover cuts for per separation round in the root (-1: unlimited)",
2811 "maximal number of consecutive fails to generate a cut per separation round in the root (-1: unlimited)",
2843 "should flow cover cuts be separated for 0-1 single node flow set with reversed arcs in addition?",
static SCIP_Bool isIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta) Definition: sepa_flowcover.c:1089 Definition: type_result.h:33 SCIP_Real SCIPgetRowSolActivity(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol) Definition: scip.c:25961 static SCIP_RETCODE addCut(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_VAR **vars, int nvars, SCIP_SOL *sol, SCIP_Real *varsolvals, SCIP_Real *cutcoefs, SCIP_Real cutrhs, SCIP_Bool cutislocal, int cutrank, char normtype, SCIP_Bool *cutoff, int *ncuts) Definition: sepa_flowcover.c:1919 SCIP_RETCODE SCIPincludeSepaFlowcover(SCIP *scip) Definition: sepa_flowcover.c:2770 Definition: struct_scip.h:52 void SCIPsortInd(int *indarray, SCIP_DECL_SORTINDCOMP((*indcomp)), void *dataptr, int len) SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38667 SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy) Definition: scip.c:28166 SCIP_Bool SCIPisCutEfficacious(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut) Definition: scip.c:28148 Definition: struct_var.h:196 static SCIP_RETCODE getClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_Real bestsub, SCIP_Real rowcoef, SCIP_Real *rowcoefsbinary, SCIP_Real *varsolvals, int *assoctransvars, SCIP_Real *closestvlb, int *closestvlbidx) Definition: sepa_flowcover.c:121 SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals) Definition: scip.c:25564 Definition: type_result.h:40 flowcover separator Definition: struct_sepa.h:36 SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible) Definition: scip.c:28256 SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree))) Definition: scip.c:6440 Definition: struct_lp.h:123 Definition: struct_sol.h:50 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) Definition: scip.c:3388 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) Definition: scip.c:3414 Constraint handler for knapsack constraints of the form , x binary and . static SCIP_RETCODE getClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_Real bestslb, SCIP_Real rowcoef, SCIP_Real *rowcoefsbinary, SCIP_Real *varsolvals, int *assoctransvars, SCIP_Real *closestvub, int *closestvubidx) Definition: sepa_flowcover.c:239 static SCIP_Real calcEfficacy(int nvars, SCIP_Real *cutcoefs, SCIP_Real cutrhs, SCIP_Real cutact) Definition: sepa_flowcover.c:2023 SCIP_Bool SCIPisSumLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38556 Definition: type_result.h:35 static SCIP_DECL_SEPAEXECLP(sepaExeclpFlowcover) Definition: sepa_flowcover.c:2729 SCIP_RETCODE SCIPcalcMIR(SCIP *scip, SCIP_SOL *sol, SCIP_Real boundswitch, SCIP_Bool usevbds, SCIP_Bool allowlocal, SCIP_Bool fixintegralrhs, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int maxmksetcoefs, SCIP_Real maxweightrange, SCIP_Real minfrac, SCIP_Real maxfrac, SCIP_Real *weights, int *sidetypes, SCIP_Real scale, SCIP_Real *mksetcoefs, SCIP_Bool *mksetcoefsvalid, SCIP_Real *mircoef, SCIP_Real *mirrhs, SCIP_Real *cutactivity, SCIP_Bool *success, SCIP_Bool *cutislocal, int *cutrank) Definition: scip.c:24743 Definition: type_lp.h:47 static SCIP_RETCODE getBoundsForSubstitution(SCIP *scip, SCIP_VAR **vars, int nvars, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int *assoctransvars, int *transvarcoefs, int *flowcoverstatus, int ntransvars, int *boundsforsubst, SCIP_BOUNDTYPE *boundtypesforsubst) Definition: sepa_flowcover.c:1707 static SCIP_DECL_SEPAEXECSOL(sepaExecsolFlowcover) Definition: sepa_flowcover.c:2754 static SCIP_RETCODE storeCutInArrays(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_Real *cutcoefs, SCIP_Real *varsolvals, char normtype, SCIP_VAR **cutvars, SCIP_Real *cutvals, int *cutlen, SCIP_Real *cutact, SCIP_Real *cutnorm) Definition: sepa_flowcover.c:1811 SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38648 static SCIP_RETCODE cutGenerationHeuristic(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_VAR **vars, int nvars, SCIP_SOL *sol, SCIP_Real *varsolvals, SCIP_Real *rowweights, SCIP_Real scalar, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int *assoctransvars, int ntransvars, int *transvarcoefs, SCIP_Real *transbinvarsolvals, SCIP_Real *transcontvarsolvals, SCIP_Real *transvarvubcoefs, int *transvarflowcoverstatus, SCIP_Real lambda, char normtype, SCIP_Bool *cutoff, int *ncuts) Definition: sepa_flowcover.c:2044 static void getClosestLb(SCIP *scip, SCIP_VAR *var, SCIP_Bool allowlocal, SCIP_Real *closestlb, int *closestlbtype) Definition: sepa_flowcover.c:352 static void buildFlowCover(SCIP *scip, int *coefs, SCIP_Real *vubcoefs, SCIP_Real rhs, int *solitems, int *nonsolitems, int nsolitems, int nnonsolitems, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, SCIP_Real *flowcoverweight, SCIP_Real *lambda) Definition: sepa_flowcover.c:1143 SCIP_RETCODE SCIPgetCharParam(SCIP *scip, const char *name, char *value) Definition: scip.c:3657 Definition: type_retcode.h:33 SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows) Definition: scip.c:24447 SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals) Definition: scip.c:31809 static SCIP_Longint getIntegralVal(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta) Definition: sepa_flowcover.c:1114 SCIP_RETCODE SCIPsolveKnapsackExactly(SCIP *scip, int nitems, SCIP_Longint *weights, SCIP_Real *profits, SCIP_Longint capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval, SCIP_Bool *success) Definition: cons_knapsack.c:949 SCIP_RETCODE SCIPmakeRowIntegral(SCIP *scip, SCIP_ROW *row, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Bool usecontvars, SCIP_Bool *success) Definition: scip.c:25679 SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable) Definition: scip.c:25305 SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38705 static SCIP_RETCODE getFlowCover(SCIP *scip, int *coefs, SCIP_Real *solvals, SCIP_Real *vubcoefs, int nvars, SCIP_Real rhs, int *nflowcovervars, int *nnonflowcovervars, int *flowcoverstatus, SCIP_Real *lambda, SCIP_Bool *found) Definition: sepa_flowcover.c:1219 static void getClosestUb(SCIP *scip, SCIP_VAR *var, SCIP_Bool allowlocal, SCIP_Real *closestub, int *closestubtype) Definition: sepa_flowcover.c:385 Definition: type_lp.h:34 public data structures and miscellaneous methods static void getL1L2(SCIP *scip, int ntransvars, int *transvarcoefs, SCIP_Real *transbinvarsolvals, SCIP_Real *transcontvarsolvals, SCIP_Real *transvarvubcoefs, int *transvarflowcoverstatus, SCIP_Real delta, SCIP_Real lambda) Definition: sepa_flowcover.c:1600 SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy))) Definition: scip.c:6424 void SCIPsortDownRealRealRealInt(SCIP_Real *realarray1, SCIP_Real *realarray2, SCIP_Real *realarray3, int *intarray, int len) Definition: struct_lp.h:188 static SCIP_RETCODE separateCuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result) Definition: sepa_flowcover.c:2350 static SCIP_RETCODE constructSNFRelaxation(SCIP *scip, SCIP_VAR **vars, int nvars, SCIP_Real *varsolvals, SCIP_ROW *row, SCIP_Real rowweight, SCIP_Real scale, int *boundsfortrans, SCIP_BOUNDTYPE *boundtypesfortrans, int *assoctransvars, int *transvarcoefs, SCIP_Real *transbinvarsolvals, SCIP_Real *transcontvarsolvals, SCIP_Real *transvarvubcoefs, int *ntransvars, SCIP_Real *transrhs, SCIP_Bool *success) Definition: sepa_flowcover.c:425 Definition: type_lp.h:48 SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38686 static SCIP_RETCODE SCIPsolveKnapsackApproximatelyLT(SCIP *scip, int nitems, SCIP_Real *weights, SCIP_Real *profits, SCIP_Real capacity, int *items, int *solitems, int *nonsolitems, int *nsolitems, int *nnonsolitems, SCIP_Real *solval) Definition: sepa_flowcover.c:1017 SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file) Definition: scip.c:26010 SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2) Definition: scip.c:38724 SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success) Definition: misc.c:6887 SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata) Definition: scip.c:6382 Definition: type_retcode.h:43 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) Definition: scip.c:3470 SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut) Definition: scip.c:28125 Definition: type_result.h:39 Definition: type_var.h:56 |