Skip to content
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur.h
* @ingroup INTERNALAPI
* @brief internal methods for primal heuristics
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_H__
#define __SCIP_HEUR_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_result.h"
#include "scip/type_set.h"
#include "scip/type_primal.h"
#include "scip/type_heur.h"
#include "scip/pub_heur.h"
#include "scip/stat.h"
#ifdef __cplusplus
extern "C" {
#endif
/** create a set of diving heuristic settings */
SCIP_RETCODE SCIPdivesetCreate(
SCIP_DIVESET** divesetptr, /**< pointer to the freshly created diveset */
SCIP_HEUR* heur, /**< the heuristic to which this dive setting belongs */
const char* name, /**< name for the diveset, or NULL if the name of the heuristic should be used */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
SCIP_Real minreldepth, /**< minimal relative depth to start diving */
SCIP_Real maxreldepth, /**< maximal relative depth to start diving */
SCIP_Real maxlpiterquot, /**< maximal fraction of diving LP iterations compared to node LP iterations */
SCIP_Real maxdiveubquot, /**< maximal quotient (curlowerbound - lowerbound)/(cutoffbound - lowerbound)
* where diving is performed (0.0: no limit) */
SCIP_Real maxdiveavgquot, /**< maximal quotient (curlowerbound - lowerbound)/(avglowerbound - lowerbound)
* where diving is performed (0.0: no limit) */
SCIP_Real maxdiveubquotnosol, /**< maximal UBQUOT when no solution was found yet (0.0: no limit) */
SCIP_Real maxdiveavgquotnosol,/**< maximal AVGQUOT when no solution was found yet (0.0: no limit) */
SCIP_Real lpresolvedomchgquot,/**< percentage of immediate domain changes during probing to trigger LP resolve */
int lpsolvefreq, /**< LP solve frequency for (0: only if enough domain reductions are found by propagation)*/
int maxlpiterofs, /**< additional number of allowed LP iterations */
unsigned int initialseed, /**< initial seed for random number generation */
SCIP_Bool backtrack, /**< use one level of backtracking if infeasibility is encountered? */
SCIP_Bool onlylpbranchcands, /**< should only LP branching candidates be considered instead of the slower but
* more general constraint handler diving variable selection? */
SCIP_Bool ispublic, /**< is this dive set publicly available (ie., can be used by other primal heuristics?) */
SCIP_DIVETYPE divetypemask, /**< bit mask that represents the supported dive types by this dive set */
SCIP_DECL_DIVESETGETSCORE((*divesetgetscore)), /**< method for candidate score and rounding direction */
SCIP_DECL_DIVESETAVAILABLE((*divesetavailable)) /**< callback to check availability of dive set at the current stage, or NULL if always available */
);
/** resets diving settings counters */
SCIP_RETCODE SCIPdivesetReset(
SCIP_DIVESET* diveset, /**< diveset to be reset */
SCIP_SET* set /**< global SCIP settings */
);
/** update diveset statistics and global diveset statistics */
void SCIPdivesetUpdateStats(
SCIP_DIVESET* diveset, /**< diveset to be reset */
SCIP_STAT* stat, /**< global SCIP statistics */
int depth, /**< the depth reached this time */
int nprobingnodes, /**< the number of probing nodes explored this time */
int nbacktracks, /**< the number of backtracks during probing this time */
SCIP_Longint nsolsfound, /**< number of new solutions found this time */
SCIP_Longint nbestsolsfound, /**< number of new best solutions found this time */
SCIP_Longint nconflictsfound, /**< number of new conflicts found this time */
SCIP_Bool leavesol, /**< has the diving heuristic reached a feasible leaf */
SCIP_DIVECONTEXT divecontext /**< context for diving statistics */
);
/** get the candidate score and preferred rounding direction for a candidate variable */
SCIP_RETCODE SCIPdivesetGetScore(
SCIP_DIVESET* diveset, /**< general diving settings */
SCIP_SET* set, /**< SCIP settings */
SCIP_DIVETYPE divetype, /**< the type of diving that should be applied */
SCIP_VAR* divecand, /**< the candidate for which the branching direction is requested */
SCIP_Real divecandsol, /**< LP solution value of the candidate */
SCIP_Real divecandfrac, /**< fractionality of the candidate */
SCIP_Real* candscore, /**< pointer to store the candidate score */
SCIP_Bool* roundup /**< pointer to store whether preferred direction for diving is upwards */
);
/** check specific preconditions for diving, e.g., if an incumbent solution is available */
SCIP_RETCODE SCIPdivesetIsAvailable(
SCIP_DIVESET* diveset, /**< diving heuristic settings */
SCIP_SET* set, /**< SCIP settings */
SCIP_Bool* available /**< pointer to store if the diving can run at the current solving stage */
);
/** update diveset LP statistics, should be called after every LP solved by this diving heuristic */
void SCIPdivesetUpdateLPStats(
SCIP_DIVESET* diveset, /**< diving settings */
SCIP_STAT* stat, /**< global SCIP statistics */
SCIP_Longint niterstoadd, /**< additional number of LP iterations to be added */
SCIP_DIVECONTEXT divecontext /**< context for diving statistics */
);
/** copies the given primal heuristic to a new scip */
SCIP_RETCODE SCIPheurCopyInclude(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a primal heuristic */
SCIP_RETCODE SCIPheurCreate(
SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
BMS_BLKMEM* blkmem, /**< block memory for parameter settings */
const char* name, /**< name of primal heuristic */
const char* desc, /**< description of primal heuristic */
char dispchar, /**< display character of primal heuristic */
int priority, /**< priority of the primal heuristic */
int freq, /**< frequency for calling primal heuristic */
int freqofs, /**< frequency offset for calling primal heuristic */
int maxdepth, /**< maximal depth level to call heuristic at (-1: no limit) */
SCIP_HEURTIMING timingmask, /**< positions in the node solving loop where heuristic should be executed */
SCIP_Bool usessubscip, /**< does the heuristic use a secondary SCIP instance? */
SCIP_DECL_HEURCOPY ((*heurcopy)), /**< copy method of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_HEURFREE ((*heurfree)), /**< destructor of primal heuristic */
SCIP_DECL_HEURINIT ((*heurinit)), /**< initialize primal heuristic */
SCIP_DECL_HEUREXIT ((*heurexit)), /**< deinitialize primal heuristic */
SCIP_DECL_HEURINITSOL ((*heurinitsol)), /**< solving process initialization method of primal heuristic */
SCIP_DECL_HEUREXITSOL ((*heurexitsol)), /**< solving process deinitialization method of primal heuristic */
SCIP_DECL_HEUREXEC ((*heurexec)), /**< execution method of primal heuristic */
SCIP_HEURDATA* heurdata /**< primal heuristic data */
);
/** calls destructor and frees memory of primal heuristic */
SCIP_RETCODE SCIPheurFree(
SCIP_HEUR** heur, /**< pointer to primal heuristic data structure */
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem /**< block memory */
);
/** initializes primal heuristic */
SCIP_RETCODE SCIPheurInit(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set /**< global SCIP settings */
);
/** calls exit method of primal heuristic */
SCIP_RETCODE SCIPheurExit(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set /**< global SCIP settings */
);
/** informs primal heuristic that the branch and bound process is being started */
SCIP_RETCODE SCIPheurInitsol(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set /**< global SCIP settings */
);
/** informs primal heuristic that the branch and bound process data is being freed */
SCIP_RETCODE SCIPheurExitsol(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set /**< global SCIP settings */
);
/** should the heuristic be executed at the given depth, frequency, timing, ... */
SCIP_Bool SCIPheurShouldBeExecuted(
SCIP_HEUR* heur, /**< primal heuristic */
int depth, /**< depth of current node */
int lpstateforkdepth, /**< depth of the last node with solved LP */
SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
SCIP_Bool* delayed /**< pointer to store whether the heuristic should be delayed */
);
/** calls execution method of primal heuristic */
SCIP_RETCODE SCIPheurExec(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PRIMAL* primal, /**< primal data */
int depth, /**< depth of current node */
int lpstateforkdepth, /**< depth of the last node with solved LP */
SCIP_HEURTIMING heurtiming, /**< current point in the node solving process */
SCIP_Bool nodeinfeasible, /**< was the current node already detected to be infeasible? */
int* ndelayedheurs, /**< pointer to count the number of delayed heuristics */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** sets priority of primal heuristic */
void SCIPheurSetPriority(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the primal heuristic */
);
/** sets copy callback of primal heuristic */
void SCIPheurSetCopy(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEURCOPY ((*heurcopy)) /**< copy callback of primal heuristic or NULL if you don't want to copy your plugin into sub-SCIPs */
);
/** sets destructor callback of primal heuristic */
void SCIPheurSetFree(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEURFREE ((*heurfree)) /**< destructor of primal heuristic */
);
/** sets initialization callback of primal heuristic */
void SCIPheurSetInit(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEURINIT ((*heurinit)) /**< initialize primal heuristic */
);
/** sets deinitialization callback of primal heuristic */
void SCIPheurSetExit(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEUREXIT ((*heurexit)) /**< deinitialize primal heuristic */
);
/** sets solving process initialization callback of primal heuristic */
void SCIPheurSetInitsol(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEURINITSOL ((*heurinitsol)) /**< solving process initialization callback of primal heuristic */
);
/** sets solving process deinitialization callback of primal heuristic */
void SCIPheurSetExitsol(
SCIP_HEUR* heur, /**< primal heuristic */
SCIP_DECL_HEUREXITSOL ((*heurexitsol)) /**< solving process deinitialization callback of primal heuristic */
);
/** enables or disables all clocks of \p heur, depending on the value of the flag */
void SCIPheurEnableOrDisableClocks(
SCIP_HEUR* heur, /**< the heuristic for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the heuristic be enabled? */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_actconsdiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that chooses fixings w.r.t. the active constraints the variable appear in
* @author Tobias Achterberg
*
* Diving heuristic: Iteratively fixes some fractional variable and resolves the LP-relaxation, thereby simulating a
* depth-first-search in the tree. Active Constraint Diving chooses a variable based on the active LP rows (equations
* are counted twice here). The variable score is calculated as a convex combination of the number of constraints the
* variable appears in, the sum of all positive coefficients and the absolute sum of all negative coefficients. The
* chosen variable is then rounded to the closest integer. One-level backtracking is applied: If the LP gets infeasible,
* the last fixings is undone, and the opposite fixing is tried. If this is infeasible, too, the procedure aborts.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_ACTCONSDIVING_H__
#define __SCIP_HEUR_ACTCONSDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the actconsdiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurActconsdiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not email to scip@zib.de. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_adaptivediving.h
* @ingroup PRIMALHEURISTICS
* @brief diving heuristic that selects adaptively between the existing, public dive sets
* @author Gregor Hendel
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_ADAPTIVEDIVING_H__
#define __SCIP_HEUR_ADAPTIVEDIVING_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the adaptivediving heuristic and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurAdaptivediving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_alns.h
* @ingroup PRIMALHEURISTICS
* @brief Adaptive large neighborhood search heuristic that orchestrates popular LNS heuristics
* @author Gregor Hendel
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_ALNS_H__
#define __SCIP_HEUR_ALNS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the alns primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurAlns(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_bound.h
* @ingroup PRIMALHEURISTICS
* @brief heuristic which fixes all integer variables to a bound (lower/upper) and solves the remaining LP
* @author Gerald Gamrath
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_BOUND_H__
#define __SCIP_HEUR_BOUND_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the bound primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurBound(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_clique.h
* @ingroup PRIMALHEURISTICS
* @brief LNS heuristic using a clique partition to restrict the search neighborhood
* @brief clique primal heuristic
* @author Stefan Heinz
* @author Michael Winkler
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_CLIQUE_H__
#define __SCIP_HEUR_CLIQUE_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the clique primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurClique(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_coefdiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that chooses fixings w.r.t. the matrix coefficients
* @author Tobias Achterberg
*
* Diving heuristic: Iteratively fixes some fractional variable and resolves the LP-relaxation, thereby simulating a
* depth-first-search in the tree. Coefficient Diving chooses the variable with the fewest locking number in any
* direction and rounds it into this direction. One-level backtracking is applied: If the LP gets infeasible, the last
* fixing is undone, and the opposite fixing is tried. If this is infeasible, too, the procedure aborts.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_COEFDIVING_H__
#define __SCIP_HEUR_COEFDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the coefdiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurCoefdiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_completesol.h
* @ingroup PRIMALHEURISTICS
* @brief primal heuristic trying to complete given partial solutions
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_COMPLETESOL_H__
#define __SCIP_HEUR_COMPLETESOL_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the completesol primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurCompletesol(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_conflictdiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that chooses fixings w.r.t. conflict locks
* @author Jakob Witzig
*
* Diving heuristic: Iteratively fixes some fractional variable and resolves the LP-relaxation, thereby simulating a
* depth-first-search in the tree. Conflict Diving chooses the variable with the fewest conflict locking number in any
* direction and rounds it into this direction.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_CONFLICTDIVING_H__
#define __SCIP_HEUR_CONFLICTDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the conflictdiving heuristic and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurConflictdiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_crossover.h
* @ingroup PRIMALHEURISTICS
* @brief LNS heuristic that tries to combine several feasible solutions
* @author Timo Berthold
*
* Crossover is a large neighborhood search improvement heuristic that is inspired by genetic algorithms and requires
* more than one feasible solution. For a set of feasible solutions, e.g., the three best found so far, it fixes
* variables that take identical values in all of them and solves a corresponding sub-SCIP. See also @ref
* heur_mutation.h
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_CROSSOVER_H__
#define __SCIP_HEUR_CROSSOVER_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the crossover primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurCrossover(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_dins.h
* @ingroup PRIMALHEURISTICS
* @brief DINS primal heuristic
* @author Robert Waniek
*
* DINS combines the ideas of RINS (see @ref heur_rins.h) and Local Branching (see @ref heur_localbranching.h). It
* defines the neighborhood by introducing a distance function between the incumbent solution and the optimum of the LP
* relaxation. When applied during a branch-and-bound search, it further takes into account how variables change their
* values at different nodes of the tree.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_DINS_H__
#define __SCIP_HEUR_DINS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the DINS primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurDins(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_distributiondiving.h
* @ingroup PRIMALHEURISTICS
* @brief Diving heuristic that chooses fixings w.r.t. changes in the solution density after Pryor and Chinneck.
* @author Gregor Hendel
*
* @see branch_distribution.h for further explanations of probability based branching schemes and references.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_DISTRIBUTIONDIVING_H__
#define __SCIP_HEUR_DISTRIBUTIONDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the distributiondiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurDistributiondiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_dualval.h
* @ingroup PRIMALHEURISTICS
* @brief primal heuristic that uses dualvalues for successive switching variable values
* @author Tobias Buchwald
*
* This heuristic tries to find solutions by taking the LP or NLP, rounding solution values, fixing the variables to the
* rounded values and then changing some of the values.To determine which variable is changed we give each variable a
* ranking dependent on its dualvalue. We work with a transformed problem that is always feasible and has objective = 0
* iff the original problem is also feasible. Thus we cannot expect to find really good solutions.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_DUALVAL_H__
#define __SCIP_HEUR_DUALVAL_H__
#include "scip/def.h"
#include "scip/type_heur.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_sol.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the dualVal primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurDualval(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup PRIMALHEURISTICS
*
* @{
*/
/** main procedure of the dualval heuristic */
SCIP_EXPORT
SCIP_RETCODE SCIPapplyHeurDualval(
SCIP* scip, /**< original SCIP data structure */
SCIP_HEUR* heur, /**< heuristic data structure */
SCIP_RESULT* result, /**< pointer to store result of: did not run, solution found, no solution
* found, or fixing is infeasible (cutoff) */
SCIP_SOL* refpoint /**< point to take fixation of discrete variables from; if NULL, then LP
* solution is used */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_farkasdiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that tries to construct a Farkas-proof
* @author Jakob Witzig
*
* The heuristic dives into the direction of the pseudosolution, i.e., variables get rounded
* towards their best bound w.r.t there objective coefficient. This strategy is twofold, if
* a feasible solution is found the solution has potentially a very good objective value; on the other
* hand, the left-hand side of a potential Farkas-proof \f$y^Tb - y^TA{l',u'} > 0\f$ (i.e., infeasibility proof)
* gets increased, where \f$l',u'\f$ are the local bounds. The contribution of each variable \f$x_i\f$ to the
* Farkas-proof can be approximated by \f$c_i = y^TA_i\f$ because we only dive on basic variables with
* reduced costs \f$c_i - y^TA_i = 0\f$.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_FARKASDIVING_H__
#define __SCIP_HEUR_FARKASDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the farkasdiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurFarkasdiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_feaspump.h
* @ingroup PRIMALHEURISTICS
* @brief Objective Feasibility Pump 2.0
* @author Timo Berthold
* @author Domenico Salvagnin
*
* The fundamental idea of the Feasibility Pump is to construct two sequences of points which hopefully converge to a
* feasible solution. One sequence consists of LP-feasiblepoints, the other one of integer feasible points. They are
* produced by alternately rounding an LP-feasible point and solvng an LP that finds a point on the LP polyhedron which
* is closest to the rounded, integral point (w.r.t. Manhattan distance).
*
* The version implemented in SCIP supports using an Objective Feasibility Pump that uses a convex combination of the
* Manhattan distance and the original LP objective for reoptimization. It further features Feasibility Pump 2.0
* capabilities, hence propagating the fixings for a faster convergence.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_FEASPUMP_H__
#define __SCIP_HEUR_FEASPUMP_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the feaspump primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurFeaspump(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_fixandinfer.h
* @ingroup PRIMALHEURISTICS
* @brief fix-and-infer primal heuristic
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_FIXANDINFER_H__
#define __SCIP_HEUR_FIXANDINFER_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the fix-and-infer primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurFixandinfer(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_fracdiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that chooses fixings w.r.t. the fractionalities
* @author Tobias Achterberg
*
* Diving heuristic: Iteratively fixes some fractional variable and resolves the LP-relaxation, thereby simulating a
* depth-first-search in the tree. Fractional Diving chooses the variable with the highest fractionality and rounds it to the
* nearest integer. One-level backtracking is applied: If the LP gets infeasible, the last fixing is undone, and the
* opposite fixing is tried. If this is infeasible, too, the procedure aborts.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_FRACDIVING_H__
#define __SCIP_HEUR_FRACDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the fracdiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurFracdiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_gins.h
* @ingroup PRIMALHEURISTICS
* @brief LNS heuristic that tries to delimit the search region to a neighborhood in the constraint graph
* @author Gregor Hendel
*
*
* Graph Induced Neighborhood Search (GINS) is a Large Neighborhood Search Heuristic that attempts to improve
* an incumbent solution by fixing a suitable percentage of integer variables to the incumbent and
* solving the resulting, smaller and presumably easier sub-MIP.
*
* Its search neighborhoods are based on distances in a bipartite graph \f$G\f$ with the variables and constraints as nodes and
* an edge between a variable and a constraint, if the variable is part of the constraint.
* Given an integer \f$k\f$, the \f$k\f$-neighborhood of a variable \f$v\f$ in \f$G\f$ is the set of variables, whose nodes
* are connected to \f$v\f$ by a path not longer than \f$2 \cdot k\f$. Intuitively, a judiciously chosen neighborhood size
* allows to consider a local portion of the overall problem.
*
* An initial variable selection is made by randomly sampling different neighborhoods across the whole main problem.
* The neighborhood that offers the largest potential for improvement is selected to become the local search neighborhood,
* while all variables outside the neighborhood are fixed to their incumbent solution values.
*
* GINS also supports a rolling horizon approach, during which several local neighborhoods are considered
* with increasing distance to the variable selected for the initial sub-problem. The rolling horizon approach ends
* if no improvement could be found or a sufficient part of the problem component variables has been part of
* at least one neighborhood.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_GINS_H__
#define __SCIP_HEUR_GINS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the gins primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurGins(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_guideddiving.h
* @ingroup PRIMALHEURISTICS
* @brief LP diving heuristic that chooses fixings in direction of incumbent solutions
* @author Tobias Achterberg
*
* Diving heuristic: Iteratively fixes some fractional variable and resolves the LP-relaxation, thereby simulating a
* depth-first-search in the tree. Guided Diving chooses the fractional variable which is closest to that variable's
* value in the incumbent solution and rounds it to the incumbent's value. One-level backtracking is applied: If the LP
* gets infeasible, the last fixing is undone, and the opposite fixing is tried. If this is infeasible, too, the
* procedure aborts.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_GUIDEDDIVING_H__
#define __SCIP_HEUR_GUIDEDDIVING_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the guideddiving heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurGuideddiving(
SCIP* scip /**< SCIP data structure */
);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* */
/* This file is part of the program and library */
/* SCIP --- Solving Constraint Integer Programs */
/* */
/* Copyright (C) 2002-2020 Konrad-Zuse-Zentrum */
/* fuer Informationstechnik Berlin */
/* */
/* SCIP is distributed under the terms of the ZIB Academic License. */
/* */
/* You should have received a copy of the ZIB Academic License */
/* along with SCIP; see the file COPYING. If not visit scipopt.org. */
/* */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/**@file heur_indicator.h
* @ingroup PRIMALHEURISTICS
* @brief handle partial solutions for linear problems with indicators and otherwise continuous variables
* @author Marc Pfetsch
*
* For linear problems with indicators and otherwise continuous variables, the indicator constraint handler can produce
* partial solutions, i.e., values for the indicator variables. This partial solution can be passed to this heuristic,
* which then fixes these values and solves an LP. Additionally a local search for a better solution is added.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_HEUR_INDICATOR_H__
#define __SCIP_HEUR_INDICATOR_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_heur.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the indicator primal heuristic and includes it in SCIP
*
* @ingroup PrimalHeuristicIncludes
*/
SCIP_EXPORT
SCIP_RETCODE SCIPincludeHeurIndicator(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup PRIMALHEURISTICS
*
* @{
*/
/** pass partial solution for indicator variables to heuristic */
SCIP_EXPORT
SCIP_RETCODE SCIPheurPassIndicator(
SCIP* scip, /**< SCIP data structure */
SCIP_HEUR* heur, /**< indicator heuristic */
int nindconss, /**< number of indicator constraints */
SCIP_CONS** indconss, /**< indicator constraints */
SCIP_Bool* solcand, /**< values for indicator variables in partial solution */
SCIP_Real obj /**< objective of solution */
);
/** @} */
#ifdef __cplusplus
}
#endif
#endif