58 #define SEPA_NAME "closecuts" 59 #define SEPA_DESC "closecuts meta separator" 60 #define SEPA_PRIORITY 1000000 62 #define SEPA_MAXBOUNDDIST 1.0 63 #define SEPA_USESSUBSCIP FALSE 64 #define SEPA_DELAY FALSE 68 #define SCIP_DEFAULT_SEPARELINT TRUE 69 #define SCIP_DEFAULT_SEPACOMBVALUE 0.30 70 #define SCIP_DEFAULT_SEPATHRESHOLD 50 71 #define SCIP_DEFAULT_INCLOBJCUTOFF FALSE 72 #define SCIP_DEFAULT_RECOMPUTERELINT FALSE 73 #define SCIP_DEFAULT_MAXUNSUCCESSFUL 0 74 #define SCIP_DEFAULT_MAXLPITERFACTOR 10.0 76 #define SCIP_MIN_LPITERS 100 119 assert( scip !=
NULL );
120 assert( point !=
NULL );
123 if ( sepadata->sepasol ==
NULL )
126 alpha = sepadata->sepacombvalue;
129 onealpha = 1.0 - alpha;
137 for (i = 0; i < nvars; ++i)
170 assert( sepa !=
NULL );
185 assert( sepa !=
NULL );
190 assert( sepadata !=
NULL );
206 assert( sepa !=
NULL );
210 assert( sepadata !=
NULL );
212 if ( sepadata->separelint && sepadata->sepasol !=
NULL )
215 sepadata->triedRelint =
FALSE;
231 assert( sepa !=
NULL );
233 assert( result !=
NULL );
251 assert( sepadata !=
NULL );
255 if ( sepadata->discardnode == currentnodenumber )
261 if ( sepadata->separelint )
263 if ( sepadata->recomputerelint )
267 if ( sepadata->sepasol !=
NULL )
270 sepadata->triedRelint =
FALSE;
276 if ( sepadata->sepasol ==
NULL && sepadata->triedRelint )
281 if ( sepadata->sepasol ==
NULL )
292 if ( timelimit <= 0.0 )
296 if ( sepadata->maxlpiterfactor < 0.0 ||
SCIPisInfinity(
scip, sepadata->maxlpiterfactor) )
306 iterlimit = (int)(sepadata->maxlpiterfactor * nlpiters);
308 if ( iterlimit <= 0 )
314 sepadata->triedRelint =
TRUE;
324 if ( sepadata->sepasol !=
NULL )
326 SCIPdebugMsg(
scip,
"Generating close cuts ... (combination value: %f)\n", sepadata->sepacombvalue);
346 assert( point ==
NULL );
357 sepadata->nunsuccessful = 0;
364 sepadata->nunsuccessful = 0;
368 ++sepadata->nunsuccessful;
373 SCIPgetNCuts(
scip) - noldcuts > sepadata->sepathreshold, sepadata->nunsuccessful);
375 if ( sepadata->maxunsuccessful >= 0 && sepadata->nunsuccessful > sepadata->maxunsuccessful )
377 SCIPdebugMsg(
scip,
"Turn off close cut separation, because of %d unsuccessful calls.\n", sepadata->nunsuccessful);
378 sepadata->discardnode = currentnodenumber;
379 sepadata->nunsuccessful = 0;
402 sepadata->sepasol =
NULL;
403 sepadata->discardnode = -1;
404 sepadata->nunsuccessful = 0;
405 sepadata->triedRelint =
FALSE;
409 sepaExeclpClosecuts,
NULL, sepadata) );
411 assert(sepa !=
NULL);
420 "separating/closecuts/separelint",
421 "generate close cuts w.r.t. relative interior point (best solution otherwise)?",
425 "separating/closecuts/sepacombvalue",
426 "convex combination value for close cuts",
431 "separating/closecuts/closethres",
432 "threshold on number of generated cuts below which the ordinary separation is started",
436 "separating/closecuts/inclobjcutoff",
437 "include an objective cutoff when computing the relative interior?",
441 "separating/closecuts/recomputerelint",
442 "recompute relative interior point in each separation call?",
446 "separating/closecuts/maxunsuccessful",
447 "turn off separation in current node after unsuccessful calls (-1 never turn off)",
451 "separating/closecuts/maxlpiterfactor",
452 "factor for maximal LP iterations in relative interior computation compared to node LP iterations (negative for no limit)",
470 assert( scip !=
NULL );
483 assert( sepadata !=
NULL );
486 if ( sepadata->separelint )
489 if ( sepadata->sepasol !=
NULL )
496 sepadata->triedRelint =
TRUE;
#define SCIP_DEFAULT_INCLOBJCUTOFF
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
SCIP_Longint SCIPgetNRootLPIterations(SCIP *scip)
SCIP_RETCODE SCIPcomputeLPRelIntPoint(SCIP *scip, SCIP_Bool relaxrows, SCIP_Bool inclobjcutoff, SCIP_Real timelimit, int iterlimit, SCIP_SOL **point)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_Longint SCIPgetNLPIterations(SCIP *scip)
SCIP_RETCODE SCIPgetRealParam(SCIP *scip, const char *name, SCIP_Real *value)
SCIP_SEPA * SCIPfindSepa(SCIP *scip, const char *name)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
enum SCIP_Retcode SCIP_RETCODE
static SCIP_DECL_SEPACOPY(sepaCopyClosecuts)
SCIP_RETCODE SCIPsetBasePointClosecuts(SCIP *scip, SCIP_SOL *sol)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
int SCIPgetNLPBranchCands(SCIP *scip)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
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_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
#define SCIP_DEFAULT_RECOMPUTERELINT
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
SCIP_Real SCIPvarGetLPSol(SCIP_VAR *var)
SCIP_RETCODE SCIPremoveInefficaciousCuts(SCIP *scip)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
static SCIP_RETCODE generateCloseCutPoint(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_SOL **point)
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)
static SCIP_DECL_SEPAEXITSOL(sepaExitsolClosecuts)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
#define SCIP_DEFAULT_MAXLPITERFACTOR
#define SCIP_DEFAULT_SEPATHRESHOLD
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAEXITSOL((*sepaexitsol)))
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_RETCODE SCIPseparateSol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool pretendroot, SCIP_Bool onlydelayed, SCIP_Bool *delayed, SCIP_Bool *cutoff)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
#define SCIP_DEFAULT_SEPARELINT
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPincludeSepaClosecuts(SCIP *scip)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
int SCIPgetNCuts(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
#define SCIP_DEFAULT_MAXUNSUCCESSFUL
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_DECL_SEPAFREE(sepaFreeClosecuts)
#define SEPA_MAXBOUNDDIST
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
#define SCIP_DEFAULT_SEPACOMBVALUE
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)
struct SCIP_SepaData SCIP_SEPADATA
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)
static SCIP_DECL_SEPAEXECLP(sepaExeclpClosecuts)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)