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 compr_largestrepr.h
* @ingroup COMPRESSION
* @brief largestrepr tree compression
* @author Jakob Witzig
*
* template file for tree compression plugins
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_COMPR_LARGESTREPR_H__
#define __SCIP_COMPR_LARGESTREPR_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the largestrepr tree compression and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeComprLargestrepr(
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 compr_weakcompr.h
* @ingroup COMPRESSION
* @brief weakcompr tree compression
* @author Jakob Witzig
*
* template file for tree compression plugins
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_COMPR_WEAKCOMPR_H__
#define __SCIP_COMPR_WEAKCOMPR_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the weakcompr tree compression and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeComprWeakcompr(
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 compr_xyz.h
* @ingroup COMPRESSION
* @brief xyz tree compression
* @author Jakob Witzig
*
* template file for tree compression plugins
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_COMPR_XYZ_H__
#define __SCIP_COMPR_XYZ_H__
#include "scip/scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the xyz tree compression and includes it in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeComprXyz(
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 concsolver.h
* @brief datastructures for concurrent solvers
* @author Leona Gottwald
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONCSOLVER_H__
#define __SCIP_CONCSOLVER_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_concsolver.h"
#include "scip/type_syncstore.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates a concurrent solver type */
SCIP_RETCODE SCIPconcsolverTypeCreate(
SCIP_CONCSOLVERTYPE** concsolvertype, /**< pointer to concurrent solver 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 concurrent solver */
SCIP_Real prefpriodefault, /**< the default preferred priority of this concurrent solver type */
SCIP_DECL_CONCSOLVERCREATEINST ((*concsolvercreateinst)),/**< data copy method of concurrent solver */
SCIP_DECL_CONCSOLVERDESTROYINST ((*concsolverdestroyinst)),/**< data copy method of concurrent solver */
SCIP_DECL_CONCSOLVERINITSEEDS ((*concsolverinitseeds)),/**< initialize random seeds of concurrent solver */
SCIP_DECL_CONCSOLVEREXEC ((*concsolverexec)),/**< execution method of concurrent solver */
SCIP_DECL_CONCSOLVERCOPYSOLVINGDATA ((*concsolvercopysolvdata)),/**< method to copy solving data */
SCIP_DECL_CONCSOLVERSTOP ((*concsolverstop)),/**< terminate solving in concurrent solver */
SCIP_DECL_CONCSOLVERSYNCWRITE ((*concsolversyncwrite)),/**< synchronization method of concurrent solver */
SCIP_DECL_CONCSOLVERSYNCREAD ((*concsolversyncread)),/**< synchronization method of concurrent solver */
SCIP_DECL_CONCSOLVERTYPEFREEDATA ((*concsolvertypefreedata)),/**< method to free data of concurrent solver type */
SCIP_CONCSOLVERTYPEDATA* data /**< the concurent solver type's data */
);
/** frees all memory of a concurrent solver type */
void SCIPconcsolverTypeFree(
SCIP_CONCSOLVERTYPE** concsolvertype /**< pointer to concurrent solver data structure */
);
/** gets the data of a concurrent solver type */
SCIP_CONCSOLVERTYPEDATA* SCIPconcsolverTypeGetData(
SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
);
/** sets the data of a concurrent solver type */
void SCIPconcsolverTypeSetData(
SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type */
SCIP_CONCSOLVERTYPEDATA* data /**< the concurrent solver's data */
);
/** gets the name of a concurrent solver type */
char* SCIPconcsolverTypeGetName(
SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
);
/** gets the preferred priority from a concurrent solver type */
SCIP_Real SCIPconcsolverTypeGetPrefPrio(
SCIP_CONCSOLVERTYPE* concsolvertype /**< concurrent solver type */
);
/** creates an instance of the given concurrent solver type */
SCIP_RETCODE SCIPconcsolverCreateInstance(
SCIP_SET* set, /**< global SCIP settings */
SCIP_CONCSOLVERTYPE* concsolvertype, /**< concurrent solver type to create */
SCIP_CONCSOLVER** concsolver /**< pointer to return concurrent solver instance */
);
/** destroys an instance of the given concurrent solver */
SCIP_RETCODE SCIPconcsolverDestroyInstance(
SCIP_SET* set, /**< global SCIP settings */
SCIP_CONCSOLVER** concsolver /**< concurrent solver */
);
/** gets the data of a concurrent solver */
SCIP_CONCSOLVERDATA* SCIPconcsolverGetData(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** sets the data of a concurrent solver */
void SCIPconcsolverSetData(
SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
SCIP_CONCSOLVERDATA* data /**< the concurrent solver's data */
);
/** gets the name of a concurrent solver */
char* SCIPconcsolverGetName(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** initializes the random seeds of a concurrent solver */
SCIP_RETCODE SCIPconcsolverInitSeeds(
SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
unsigned int seed /**< seed for initializing the solver's internal random seeds */
);
/** start the solving process of a concurrent solver */
SCIP_RETCODE SCIPconcsolverExec(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets solving data of concurrent solver and stores it in the given SCIP instance */
SCIP_RETCODE SCIPconcsolverGetSolvingData(
SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
SCIP* scip /**< SCIP datastructure */
);
/** interrupt solving in a concurrent solver */
SCIP_RETCODE SCIPconcsolverStop(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** let the given concurrent solver synchronize, i.e. pass its own solutions and bounds to
* the SPI.
*/
SCIP_RETCODE SCIPconcsolverSync(
SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
SCIP_SET* set /**< global SCIP settings */
);
/** gets the current synchronization frequency of the concurent solver */
SCIP_Real SCIPconcsolverGetSyncFreq(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the total memory used by the concurent solver */
SCIP_Longint SCIPconcsolverGetMemTotal(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** sets the time elapsed since the last synchronization. Must be set before the synchronization is
* started.
*/
void SCIPconcsolverSetTimeSinceLastSync(
SCIP_CONCSOLVER* concsolver, /**< concurrent solver */
SCIP_Real time /**< the time passed since the last synchronization */
);
/** gets the solving time of the concurrent solver */
SCIP_Real SCIPconcsolverGetSolvingTime(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the time spent for synchronization for the concurrent solver */
SCIP_Real SCIPconcsolverGetSyncTime(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of lp iterations the concurrent solver used */
SCIP_Longint SCIPconcsolverGetNLPIterations(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of branch and bound nodes the concurrent solver used */
SCIP_Longint SCIPconcsolverGetNNodes(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of solutions the concurrent solver received during synchronization */
SCIP_Longint SCIPconcsolverGetNSolsRecvd(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of solutions the concurrent solver shared during synchronization */
SCIP_Longint SCIPconcsolverGetNSolsShared(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of tighter global variable bounds the solver received */
SCIP_Longint SCIPconcsolverGetNTighterBnds(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets the number of tighter global variable bounds of integer variables the solver received */
SCIP_Longint SCIPconcsolverGetNTighterIntBnds(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
/** gets index of concurrent solver */
int SCIPconcsolverGetIdx(
SCIP_CONCSOLVER* concsolver /**< concurrent solver */
);
#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 concsolver_scip.h
* @ingroup PARALLEL
* @brief implementation of concurrent solver interface for SCIP
* @author Leona Gottwald
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONCSOLVER_SCIP_H__
#define __SCIP_CONCSOLVER_SCIP_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the concurrent SCIP solver plugins and includes them in SCIP */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConcurrentScipSolvers(
SCIP* scip /**< SCIP datastructure */
);
#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 concurrent.h
* @ingroup PARALLEL
* @brief helper functions for concurrent scip solvers
* @author Leona Gottwald
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#include "scip/type_concurrent.h"
#include "scip/type_scip.h"
#include "scip/type_concsolver.h"
#include "scip/type_sol.h"
#include "scip/type_var.h"
#include "scip/type_syncstore.h"
#include "scip/def.h"
#ifndef __SCIP_CONCURRENT_H__
#define __SCIP_CONCURRENT_H__
#ifdef __cplusplus
extern "C" {
#endif
/** create concurrent data */
SCIP_RETCODE SCIPcreateConcurrent(
SCIP* scip, /**< SCIP datastructure */
SCIP_CONCSOLVER* concsolver, /**< concurrent solver of given SCIP instance */
int* varperm /**< permutation of variables for communication */
);
/** get number of initialized concurrent solvers */
int SCIPgetNConcurrentSolvers(
SCIP* scip /**< SCIP datastructure */
);
/** gets the concurrent solvers */
SCIP_CONCSOLVER** SCIPgetConcurrentSolvers(
SCIP* scip /**< SCIP datastructure */
);
/** adds a concurrent solver */
SCIP_RETCODE SCIPaddConcurrentSolver(
SCIP* scip, /**< SCIP datastructure */
SCIP_CONCSOLVER* concsolver /**< concurrent solver of given SCIP instance */
);
/** frees concurrent data */
SCIP_RETCODE SCIPfreeConcurrent(
SCIP* scip /**< SCIP datastructure */
);
/** increments the time counter for synchronization */
SCIP_RETCODE SCIPincrementConcurrentTime(
SCIP* scip, /**< SCIP datastructure */
SCIP_Real val /**< value by which the time counter for synchronization is incremented */
);
/** synchronize with other concurrent solvers */
SCIP_RETCODE SCIPsynchronize(
SCIP* scip /**< SCIP datastructure */
);
/** pass a solution to the given SCIP instance using that was received via synchronization by using
* the sync heuristic */
SCIP_RETCODE SCIPaddConcurrentSol(
SCIP* scip, /**< SCIP datastructure */
SCIP_SOL* sol /**< solution */
);
/** adds a global boundchange to the given SCIP, by passing it to the sync propagator */
SCIP_RETCODE SCIPaddConcurrentBndchg(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR* var, /**< variable for bound */
SCIP_Real val, /**< value of bound */
SCIP_BOUNDTYPE bndtype /**< type of bound */
);
/** copy the nodenumber, depth, time, and runnumber of one solution to another one */
SCIP_RETCODE SCIPcopySolStats(
SCIP_SOL* source, /**< source for solution statistics */
SCIP_SOL* target /**< target for solution statistics */
);
/** copy solving statistics */
SCIP_RETCODE SCIPcopyConcurrentSolvingStats(
SCIP* source, /**< SCIP data structure */
SCIP* target /**< target SCIP data structure */
);
/** get variable index of original variable that is the same between concurrent solvers */
int SCIPgetConcurrentVaridx(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR* var /**< variable */
);
/** has the solution been created after the last synchronization point */
SCIP_Bool SCIPIsConcurrentSolNew(
SCIP* scip, /**< SCIP data structure */
SCIP_SOL* sol /**< the solution */
);
/** gets the global bound changes since the last synchronization point */
SCIP_BOUNDSTORE* SCIPgetConcurrentGlobalBoundChanges(
SCIP* scip /**< SCIP data structure */
);
/** start solving in parallel using the given set of concurrent solvers */
SCIP_RETCODE SCIPconcurrentSolve(
SCIP* scip /**< pointer to scip datastructure */
);
/** disables storing global bound changes */
void SCIPdisableConcurrentBoundStorage(
SCIP* scip /**< SCIP data structure */
);
/** enables storing global bound changes */
void SCIPenableConcurrentBoundStorage(
SCIP* scip /**< SCIP data structure */
);
/** gets total memory usage of all concurrent solvers together */
SCIP_Longint SCIPgetConcurrentMemTotal(
SCIP* scip /**< SCIP data structure */
);
/** gets the dualbound in the last synchronization */
SCIP_Real SCIPgetConcurrentDualbound(
SCIP* scip /**< SCIP data structure */
);
/** gets the primalbound in the last synchronization */
SCIP_Real SCIPgetConcurrentPrimalbound(
SCIP* scip /**< SCIP data structure */
);
/** gets the gap in the last synchronization */
SCIP_Real SCIPgetConcurrentGap(
SCIP* scip /**< SCIP data structure */
);
/** gives the total number of tightened bounds received from other concurrent solvers */
SCIP_Longint SCIPgetConcurrentNTightenedBnds(
SCIP* scip /**< SCIP data structure */
);
/** gives the total number of tightened bounds for integer variables received from
* other concurrent solvers */
SCIP_Longint SCIPgetConcurrentNTightenedIntBnds(
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 conflict.h
* @ingroup INTERNALAPI
* @brief internal methods for conflict analysis
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONFLICT_H__
#define __SCIP_CONFLICT_H__
#include "blockmemshell/memory.h"
#include "scip/def.h"
#include "scip/type_branch.h"
#include "scip/type_conflict.h"
#include "scip/type_conflictstore.h"
#include "scip/type_event.h"
#include "scip/type_implics.h"
#include "scip/type_lp.h"
#include "scip/type_message.h"
#include "scip/type_prob.h"
#include "scip/type_reopt.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Conflict Handler
*/
/** copies the given conflict handler to a new scip */
SCIP_RETCODE SCIPconflicthdlrCopyInclude(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
);
/** creates a conflict handler */
SCIP_RETCODE SCIPconflicthdlrCreate(
SCIP_CONFLICTHDLR** conflicthdlr, /**< pointer to conflict handler 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 conflict handler */
const char* desc, /**< description of conflict handler */
int priority, /**< priority of the conflict handler */
SCIP_DECL_CONFLICTCOPY((*conflictcopy)), /**< copy method of conflict handler or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_CONFLICTFREE((*conflictfree)), /**< destructor of conflict handler */
SCIP_DECL_CONFLICTINIT((*conflictinit)), /**< initialize conflict handler */
SCIP_DECL_CONFLICTEXIT((*conflictexit)), /**< deinitialize conflict handler */
SCIP_DECL_CONFLICTINITSOL((*conflictinitsol)),/**< solving process initialization method of conflict handler */
SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol)),/**< solving process deinitialization method of conflict handler */
SCIP_DECL_CONFLICTEXEC((*conflictexec)), /**< conflict processing method of conflict handler */
SCIP_CONFLICTHDLRDATA* conflicthdlrdata /**< conflict handler data */
);
/** calls destructor and frees memory of conflict handler */
SCIP_RETCODE SCIPconflicthdlrFree(
SCIP_CONFLICTHDLR** conflicthdlr, /**< pointer to conflict handler data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** calls init method of conflict handler */
SCIP_RETCODE SCIPconflicthdlrInit(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set /**< global SCIP settings */
);
/** calls exit method of conflict handler */
SCIP_RETCODE SCIPconflicthdlrExit(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set /**< global SCIP settings */
);
/** informs conflict handler that the branch and bound process is being started */
SCIP_RETCODE SCIPconflicthdlrInitsol(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set /**< global SCIP settings */
);
/** informs conflict handler that the branch and bound process data is being freed */
SCIP_RETCODE SCIPconflicthdlrExitsol(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set /**< global SCIP settings */
);
/** calls execution method of conflict handler */
SCIP_RETCODE SCIPconflicthdlrExec(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set, /**< global SCIP settings */
SCIP_NODE* node, /**< node to add conflict constraint to */
SCIP_NODE* validnode, /**< node at which the constraint is valid */
SCIP_BDCHGINFO** bdchginfos, /**< bound change resembling the conflict set */
SCIP_Real* relaxedbds, /**< array with relaxed bounds which are efficient to create a valid conflict */
int nbdchginfos, /**< number of bound changes in the conflict set */
SCIP_CONFTYPE conftype, /**< type of the conflict */
SCIP_Bool usescutoffbound, /**< depends the conflict on the cutoff bound? */
SCIP_Bool resolved, /**< was the conflict set already used to create a constraint? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** sets priority of conflict handler */
void SCIPconflicthdlrSetPriority(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_SET* set, /**< global SCIP settings */
int priority /**< new priority of the conflict handler */
);
/** set copy method of conflict handler */
void SCIPconflicthdlrSetCopy(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTCOPY((*conflictcopy)) /**< copy method of the conflict handler */
);
/** set destructor of conflict handler */
void SCIPconflicthdlrSetFree(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTFREE((*conflictfree)) /**< destructor of conflict handler */
);
/** set initialization method of conflict handler */
void SCIPconflicthdlrSetInit(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTINIT((*conflictinit)) /**< initialization method conflict handler */
);
/** set deinitialization method of conflict handler */
void SCIPconflicthdlrSetExit(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTEXIT((*conflictexit)) /**< deinitialization method conflict handler */
);
/** set solving process initialization method of conflict handler */
void SCIPconflicthdlrSetInitsol(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTINITSOL((*conflictinitsol))/**< solving process initialization method of conflict handler */
);
/** set solving process deinitialization method of conflict handler */
void SCIPconflicthdlrSetExitsol(
SCIP_CONFLICTHDLR* conflicthdlr, /**< conflict handler */
SCIP_DECL_CONFLICTEXITSOL((*conflictexitsol))/**< solving process deinitialization method of conflict handler */
);
/** enables or disables all clocks of \p conflicthdlr, depending on the value of the flag */
void SCIPconflicthdlrEnableOrDisableClocks(
SCIP_CONFLICTHDLR* conflicthdlr, /**< the conflict handler for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the conflict handler be enabled? */
);
/*
* Conflict Analysis
*/
/** return TRUE if conflict analysis is applicable; In case the function return FALSE there is no need to initialize the
* conflict analysis since it will not be applied
*/
SCIP_Bool SCIPconflictApplicable(
SCIP_SET* set /**< global SCIP settings */
);
/** creates conflict analysis data for propagation conflicts */
SCIP_RETCODE SCIPconflictCreate(
SCIP_CONFLICT** conflict, /**< pointer to conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
SCIP_SET* set /**< global SCIP settings */
);
/** frees conflict analysis data for propagation conflicts */
SCIP_RETCODE SCIPconflictFree(
SCIP_CONFLICT** conflict, /**< pointer to conflict analysis data */
BMS_BLKMEM* blkmem /**< block memory of transformed problem */
);
/** initializes the propagation conflict analysis by clearing the conflict candidate queue */
SCIP_RETCODE SCIPconflictInit(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_CONFTYPE conftype, /**< type of the conflict */
SCIP_Bool usescutoffbound /**< depends the conflict on a cutoff bound? */
);
/** adds variable's bound to conflict candidate queue */
SCIP_RETCODE SCIPconflictAddBound(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_VAR* var, /**< problem variable */
SCIP_BOUNDTYPE boundtype, /**< type of bound that was changed: lower or upper bound */
SCIP_BDCHGIDX* bdchgidx /**< bound change index (time stamp of bound change), or NULL for current time */
);
/** adds variable's bound to conflict candidate queue with the additional information of a relaxed bound */
SCIP_RETCODE SCIPconflictAddRelaxedBound(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_VAR* var, /**< problem variable */
SCIP_BOUNDTYPE boundtype, /**< type of bound that was changed: lower or upper bound */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
SCIP_Real relaxedbd /**< the relaxed bound */
);
/** checks if the given variable is already part of the current conflict set or queued for resolving with the same or
* even stronger bound
*/
SCIP_RETCODE SCIPconflictIsVarUsed(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_VAR* var, /**< problem variable */
SCIP_SET* set, /**< global SCIP settings */
SCIP_BOUNDTYPE boundtype, /**< type of bound for which the score should be increased */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index (time stamp of bound change), or NULL for current time */
SCIP_Bool* used /**< pointer to store if the variable is already used */
);
/** returns the conflict lower bound if the variable is present in the current conflict set; otherwise the global lower
* bound
*/
SCIP_Real SCIPconflictGetVarLb(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_VAR* var /**< problem variable */
);
/** returns the conflict upper bound if the variable is present in the current conflict set; otherwise the global upper
* bound
*/
SCIP_Real SCIPconflictGetVarUb(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_VAR* var /**< problem variable */
);
/** analyzes conflicting bound changes that were added with calls to SCIPconflictAddBound() and
* SCIPconflictAddRelaxedBound(), and on success, calls the conflict handlers to create a conflict constraint out of
* the resulting conflict set; updates statistics for propagation conflict analysis
*/
SCIP_RETCODE SCIPconflictAnalyze(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_TREE* tree, /**< branch and bound tree */
int validdepth, /**< minimal depth level at which the initial conflict set is valid */
SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
);
/** adds the collected conflict constraints to the corresponding nodes; the best set->conf_maxconss conflict constraints
* are added to the node of their validdepth; additionally (if not yet added, and if repropagation is activated), the
* conflict constraint that triggers the earliest repropagation is added to the node of its validdepth
*/
SCIP_RETCODE SCIPconflictFlushConss(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< current LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable /**< clique table data structure */
);
/** returns the current number of conflict sets in the conflict set storage */
int SCIPconflictGetNConflicts(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of conflict constraints that were added to the problem */
SCIP_Longint SCIPconflictGetNAppliedConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of literals in conflict constraints that were added to the problem */
SCIP_Longint SCIPconflictGetNAppliedLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of global bound changes applied by the conflict analysis */
SCIP_Longint SCIPconflictGetNGlobalChgBds(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of conflict constraints that were added globally to the problem */
SCIP_Longint SCIPconflictGetNAppliedGlobalConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of literals in conflict constraints that were added globally to the problem */
SCIP_Longint SCIPconflictGetNAppliedGlobalLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of local bound changes applied by the conflict analysis */
SCIP_Longint SCIPconflictGetNLocalChgBds(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of conflict constraints that were added locally to the problem */
SCIP_Longint SCIPconflictGetNAppliedLocalConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** returns the total number of literals in conflict constraints that were added locally to the problem */
SCIP_Longint SCIPconflictGetNAppliedLocalLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets time in seconds used for preprocessing global conflict constraint before appliance */
SCIP_Real SCIPconflictGetGlobalApplTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets time in seconds used for analyzing propagation conflicts */
SCIP_Real SCIPconflictGetPropTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to propagation conflict analysis */
SCIP_Longint SCIPconflictGetNPropCalls(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to propagation conflict analysis that yield at least one conflict constraint */
SCIP_Longint SCIPconflictGetNPropSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of conflict constraints detected in propagation conflict analysis */
SCIP_Longint SCIPconflictGetNPropConflictConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in conflict constraints created in propagation conflict analysis */
SCIP_Longint SCIPconflictGetNPropConflictLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of reconvergence constraints detected in propagation conflict analysis */
SCIP_Longint SCIPconflictGetNPropReconvergenceConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in reconvergence constraints created in propagation conflict analysis */
SCIP_Longint SCIPconflictGetNPropReconvergenceLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/*
* Infeasible LP Conflict Analysis
*/
/** analyzes an infeasible or bound exceeding LP to find out the bound changes on variables that were responsible for the
* infeasibility or for exceeding the primal bound;
* on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
* a conflict constraint out of the resulting conflict set;
* updates statistics for infeasible or bound exceeding LP conflict analysis
*/
SCIP_RETCODE SCIPconflictAnalyzeLP(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
);
/** gets time in seconds used for analyzing infeasible LP conflicts */
SCIP_Real SCIPconflictGetInfeasibleLPTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPCalls(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to infeasible LP conflict analysis that yield at least one conflict constraint */
SCIP_Longint SCIPconflictGetNInfeasibleLPSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of conflict constraints detected in infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in conflict constraints created in infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPConflictLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of reconvergence constraints detected in infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in reconvergence constraints created in infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPReconvergenceLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of LP iterations in infeasible LP conflict analysis */
SCIP_Longint SCIPconflictGetNInfeasibleLPIterations(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets time in seconds used for analyzing bound exceeding LP conflicts */
SCIP_Real SCIPconflictGetBoundexceedingLPTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPCalls(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to bound exceeding LP conflict analysis that yield at least one conflict constraint */
SCIP_Longint SCIPconflictGetNBoundexceedingLPSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of conflict constraints detected in bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in conflict constraints created in bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPConflictLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of reconvergence constraints detected in bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in reconvergence constraints created in bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPReconvergenceLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of LP iterations in bound exceeding LP conflict analysis */
SCIP_Longint SCIPconflictGetNBoundexceedingLPIterations(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/*
* infeasible strong branching conflict analysis
*/
/** analyses infeasible strong branching sub problems for conflicts */
SCIP_RETCODE SCIPconflictAnalyzeStrongbranch(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory buffers */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_COL* col, /**< LP column with at least one infeasible strong branching subproblem */
SCIP_Bool* downconflict, /**< pointer to store whether a conflict constraint was created for an
* infeasible downwards branch, or NULL */
SCIP_Bool* upconflict /**< pointer to store whether a conflict constraint was created for an
* infeasible upwards branch, or NULL */
);
/** gets time in seconds used for analyzing infeasible strong branching conflicts */
SCIP_Real SCIPconflictGetStrongbranchTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of successful calls to dual proof analysis derived from infeasible LPs */
SCIP_Longint SCIPconflictGetNDualproofsInfSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of globally valid dual proof constraints derived from infeasible LPs */
SCIP_Longint SCIPconflictGetNDualproofsInfGlobal(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of locally valid dual proof constraints derived from infeasible LPs */
SCIP_Longint SCIPconflictGetNDualproofsInfLocal(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets average length of dual proof constraints derived from infeasible LPs */
SCIP_Longint SCIPconflictGetNDualproofsInfNonzeros(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of successfully analyzed dual proofs derived from bound exceeding LPs */
SCIP_Longint SCIPconflictGetNDualproofsBndSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of globally applied dual proofs derived from bound exceeding LPs */
SCIP_Longint SCIPconflictGetNDualproofsBndGlobal(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of locally applied dual proofs derived from bound exceeding LPs */
SCIP_Longint SCIPconflictGetNDualproofsBndLocal(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets average length of dual proofs derived from bound exceeding LPs */
SCIP_Longint SCIPconflictGetNDualproofsBndNonzeros(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchCalls(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to infeasible strong branching conflict analysis that yield at least one conflict constraint */
SCIP_Longint SCIPconflictGetNStrongbranchSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of conflict constraints detected in infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchConflictConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in conflict constraints created in infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchConflictLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of reconvergence constraints detected in infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in reconvergence constraints created in infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchReconvergenceLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of LP iterations in infeasible strong branching conflict analysis */
SCIP_Longint SCIPconflictGetNStrongbranchIterations(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/*
* pseudo solution conflict analysis
*/
/** analyzes a pseudo solution with objective value exceeding the current cutoff to find out the bound changes on
* variables that were responsible for the objective value degradation;
* on success, calls standard conflict analysis with the responsible variables as starting conflict set, thus creating
* a conflict constraint out of the resulting conflict set;
* updates statistics for pseudo solution conflict analysis
*/
SCIP_RETCODE SCIPconflictAnalyzePseudo(
SCIP_CONFLICT* conflict, /**< conflict analysis data */
BMS_BLKMEM* blkmem, /**< block memory of transformed problem */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< problem statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_PROB* origprob, /**< original problem */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_REOPT* reopt, /**< reoptimization data structure */
SCIP_LP* lp, /**< LP data */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_EVENTQUEUE* eventqueue, /**< event queue */
SCIP_CLIQUETABLE* cliquetable, /**< clique table data structure */
SCIP_Bool* success /**< pointer to store whether a conflict constraint was created, or NULL */
);
/** gets time in seconds used for analyzing pseudo solution conflicts */
SCIP_Real SCIPconflictGetPseudoTime(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to pseudo solution conflict analysis */
SCIP_Longint SCIPconflictGetNPseudoCalls(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of calls to pseudo solution conflict analysis that yield at least one conflict constraint */
SCIP_Longint SCIPconflictGetNPseudoSuccess(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of conflict constraints detected in pseudo solution conflict analysis */
SCIP_Longint SCIPconflictGetNPseudoConflictConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in conflict constraints created in pseudo solution conflict analysis */
SCIP_Longint SCIPconflictGetNPseudoConflictLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets number of reconvergence constraints detected in pseudo solution conflict analysis */
SCIP_Longint SCIPconflictGetNPseudoReconvergenceConss(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** gets total number of literals in reconvergence constraints created in pseudo solution conflict analysis */
SCIP_Longint SCIPconflictGetNPseudoReconvergenceLiterals(
SCIP_CONFLICT* conflict /**< conflict analysis data */
);
/** enables or disables all clocks of \p conflict, depending on the value of the flag */
void SCIPconflictEnableOrDisableClocks(
SCIP_CONFLICT* conflict, /**< the conflict analysis data for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the conflict analysis data 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 conflictstore.h
* @ingroup INTERNALAPI
* @brief internal methods for storing conflicts
* @author Jakob Witzig
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONFLICTSTORE_H__
#define __SCIP_CONFLICTSTORE_H__
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_conflictstore.h"
#include "scip/type_retcode.h"
#include "scip/type_cons.h"
#include "scip/type_event.h"
#include "scip/type_conflict.h"
#include "scip/type_prob.h"
#include "scip/type_reopt.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates separation storage */
SCIP_RETCODE SCIPconflictstoreCreate(
SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
SCIP_SET* set /**< global SCIP settings */
);
/** frees separation storage */
SCIP_RETCODE SCIPconflictstoreFree(
SCIP_CONFLICTSTORE** conflictstore, /**< pointer to store conflict store */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** clears conflict store */
SCIP_RETCODE SCIPconflictstoreClear(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** cleans up conflict store */
SCIP_RETCODE SCIPconflictstoreClean(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** adds a constraint to the pool of proof constraints based on dual rays
*
* @note this methods captures the constraint
*/
SCIP_RETCODE SCIPconflictstoreAddDualraycons(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
SCIP_CONS* dualproof, /**< constraint based on a dual ray */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
* the current relaxation only? */
);
/** adds a constraint to the pool of proof constraints based on dual solutions
*
* @note this methods captures the constraint
*/
SCIP_RETCODE SCIPconflictstoreAddDualsolcons(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
SCIP_CONS* dualproof, /**< constraint based on a dual solution */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_Real scale, /**< scaling factor that needs to be considered when updating the side */
SCIP_Bool updateside, /**< should the side be updated if a new incumbent is found */
SCIP_Bool hasrelaxvar /**< does the dual proof contain at least one variable that exists in
* the current relaxation only? */
);
/** adds a conflict to the conflict store
*
* @note this method captures the constraint
*/
SCIP_RETCODE SCIPconflictstoreAddConflict(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_TREE* tree, /**< branch and bound tree (or NULL for an original constraint) */
SCIP_PROB* transprob, /**< transformed problem (or NULL for an original constraint) */
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_CONS* cons, /**< constraint representing the conflict */
SCIP_CONFTYPE conftype, /**< type of the conflict */
SCIP_Bool cutoffinvolved, /**< is a cutoff bound involved in this conflict */
SCIP_Real primalbound /**< primal bound the conflict depend on (or -SCIPinfinity) */
);
/** deletes all conflicts depending on a cutoff bound larger than the given bound */
SCIP_RETCODE SCIPconflictstoreCleanNewIncumbent(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_PROB* transprob, /**< transformed problem*/
SCIP_REOPT* reopt, /**< reoptimization data */
SCIP_Real cutoffbound /**< current cutoff bound */
);
/** returns the maximal size of the conflict pool */
int SCIPconflictstoreGetMaxPoolSize(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** returns the initial size of the conflict pool */
int SCIPconflictstoreGetInitPoolSize(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** returns the number of stored conflicts on the conflict pool
*
* @note the number of active conflicts can be less
*/
int SCIPconflictstoreGetNConflictsInStore(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** returns all active conflicts stored in the conflict store */
SCIP_RETCODE SCIPconflictstoreGetConflicts(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
SCIP_CONS** conflicts, /**< array to store conflicts */
int conflictsize, /**< size of the conflict array */
int* nconflicts /**< pointer to store the number of conflicts */
);
/** transforms all original conflicts into transformed conflicts */
SCIP_RETCODE SCIPconflictstoreTransform(
SCIP_CONFLICTSTORE* conflictstore, /**< conflict store */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic SCIP statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_PROB* transprob, /**< transformed problem */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** returns the average number of non-zeros over all stored dual ray constraints */
SCIP_Real SCIPconflictstoreGetAvgNnzDualInfProofs(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** return the number of stored dualray constraints */
int SCIPconflictstoreGetNDualInfProofs(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** returns the average number of non-zeros over all stored boundexceeding proofs */
SCIP_Real SCIPconflictstoreGetAvgNnzDualBndProofs(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
/** returns the number of all stored boundexceeding proofs */
int SCIPconflictstoreGetNDualBndProofs(
SCIP_CONFLICTSTORE* conflictstore /**< conflict store */
);
#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 cons.h
* @ingroup INTERNALAPI
* @brief internal methods for constraints and constraint handlers
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_H__
#define __SCIP_CONS_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_stat.h"
#include "scip/type_mem.h"
#include "scip/type_misc.h"
#include "scip/type_timing.h"
#include "scip/type_lp.h"
#include "scip/type_var.h"
#include "scip/type_prob.h"
#include "scip/type_sol.h"
#include "scip/type_tree.h"
#include "scip/type_sepastore.h"
#include "scip/type_cons.h"
#include "scip/type_branch.h"
#include "scip/type_reopt.h"
#include "scip/pub_cons.h"
#ifndef NDEBUG
#include "scip/struct_cons.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* Constraint handler methods
*/
/** copies the given constraint handler to a new scip */
SCIP_RETCODE SCIPconshdlrCopyInclude(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_SET* set, /**< SCIP_SET of SCIP to copy to */
SCIP_Bool* valid /**< was the copying process valid? */
);
/** creates a constraint handler */
SCIP_RETCODE SCIPconshdlrCreate(
SCIP_CONSHDLR** conshdlr, /**< pointer to constraint handler 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 constraint handler */
const char* desc, /**< description of constraint handler */
int sepapriority, /**< priority of the constraint handler for separation */
int enfopriority, /**< priority of the constraint handler for constraint enforcing */
int checkpriority, /**< priority of the constraint handler for checking feasibility (and propagation) */
int sepafreq, /**< frequency for separating cuts; zero means to separate only in the root node */
int propfreq, /**< frequency for propagating domains; zero means only preprocessing propagation */
int eagerfreq, /**< frequency for using all instead of only the useful constraints in separation,
* propagation and enforcement, -1 for no eager evaluations, 0 for first only */
int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
SCIP_Bool delaysepa, /**< should separation method be delayed, if other separators found cuts? */
SCIP_Bool delayprop, /**< should propagation method be delayed, if other propagators found reductions? */
SCIP_Bool needscons, /**< should the constraint handler be skipped, if no constraints are available? */
SCIP_PROPTIMING proptiming, /**< positions in the node solving loop where propagation method of constraint handlers should be executed */
SCIP_PRESOLTIMING presoltiming, /**< timing mask of the constraint handler's presolving method */
SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_CONSFREE ((*consfree)), /**< destructor of constraint handler */
SCIP_DECL_CONSINIT ((*consinit)), /**< initialize constraint handler */
SCIP_DECL_CONSEXIT ((*consexit)), /**< deinitialize constraint handler */
SCIP_DECL_CONSINITPRE ((*consinitpre)), /**< presolving initialization method of constraint handler */
SCIP_DECL_CONSEXITPRE ((*consexitpre)), /**< presolving deinitialization method of constraint handler */
SCIP_DECL_CONSINITSOL ((*consinitsol)), /**< solving process initialization method of constraint handler */
SCIP_DECL_CONSEXITSOL ((*consexitsol)), /**< solving process deinitialization method of constraint handler */
SCIP_DECL_CONSDELETE ((*consdelete)), /**< free specific constraint data */
SCIP_DECL_CONSTRANS ((*constrans)), /**< transform constraint data into data belonging to the transformed problem */
SCIP_DECL_CONSINITLP ((*consinitlp)), /**< initialize LP with relaxations of "initial" constraints */
SCIP_DECL_CONSSEPALP ((*conssepalp)), /**< separate cutting planes for LP solution */
SCIP_DECL_CONSSEPASOL ((*conssepasol)), /**< separate cutting planes for arbitrary primal solution */
SCIP_DECL_CONSENFOLP ((*consenfolp)), /**< enforcing constraints for LP solutions */
SCIP_DECL_CONSENFORELAX ((*consenforelax)), /**< enforcing constraints for relaxation solutions */
SCIP_DECL_CONSENFOPS ((*consenfops)), /**< enforcing constraints for pseudo solutions */
SCIP_DECL_CONSCHECK ((*conscheck)), /**< check feasibility of primal solution */
SCIP_DECL_CONSPROP ((*consprop)), /**< propagate variable domains */
SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method */
SCIP_DECL_CONSRESPROP ((*consresprop)), /**< propagation conflict resolving method */
SCIP_DECL_CONSLOCK ((*conslock)), /**< variable rounding lock method */
SCIP_DECL_CONSACTIVE ((*consactive)), /**< activation notification method */
SCIP_DECL_CONSDEACTIVE((*consdeactive)), /**< deactivation notification method */
SCIP_DECL_CONSENABLE ((*consenable)), /**< enabling notification method */
SCIP_DECL_CONSDISABLE ((*consdisable)), /**< disabling notification method */
SCIP_DECL_CONSDELVARS ((*consdelvars)), /**< variable deletion method */
SCIP_DECL_CONSPRINT ((*consprint)), /**< constraint display method */
SCIP_DECL_CONSCOPY ((*conscopy)), /**< constraint copying method */
SCIP_DECL_CONSPARSE ((*consparse)), /**< constraint parsing method */
SCIP_DECL_CONSGETVARS ((*consgetvars)), /**< constraint get variables method */
SCIP_DECL_CONSGETNVARS((*consgetnvars)), /**< constraint get number of variable method */
SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)), /**< constraint handler diving solution enforcement method */
SCIP_CONSHDLRDATA* conshdlrdata /**< constraint handler data */
);
/** calls destructor and frees memory of constraint handler */
SCIP_RETCODE SCIPconshdlrFree(
SCIP_CONSHDLR** conshdlr, /**< pointer to constraint handler data structure */
SCIP_SET* set /**< global SCIP settings */
);
/** calls init method of constraint handler */
SCIP_RETCODE SCIPconshdlrInit(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** calls exit method of constraint handler */
SCIP_RETCODE SCIPconshdlrExit(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** informs constraint handler that the presolving process is being started */
SCIP_RETCODE SCIPconshdlrInitpre(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** informs constraint handler that the presolving is finished */
SCIP_RETCODE SCIPconshdlrExitpre(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** informs constraint handler that the branch and bound process is being started */
SCIP_RETCODE SCIPconshdlrInitsol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** informs constraint handler that the branch and bound process data is being freed */
SCIP_RETCODE SCIPconshdlrExitsol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_Bool restart /**< was this exit solve call triggered by a restart? */
);
/** calls LP initialization method of constraint handler to separate all initial active constraints */
SCIP_RETCODE SCIPconshdlrInitLP(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_Bool initkeptconss, /**< Also initialize constraints which are valid at a more global node,
* but were not activated there? Should be FALSE for repeated calls at
* one node or if the current focusnode is a child of the former one */
SCIP_Bool* cutoff /**< pointer to store whether infeasibility was detected while building the LP */
);
/** calls separator method of constraint handler to separate LP solution */
SCIP_RETCODE SCIPconshdlrSeparateLP(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_SEPASTORE* sepastore, /**< separation storage */
int depth, /**< depth of current node */
SCIP_Bool execdelayed, /**< execute separation method even if it is marked to be delayed */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls separator method of constraint handler to separate given primal solution */
SCIP_RETCODE SCIPconshdlrSeparateSol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_SOL* sol, /**< primal solution that should be separated */
int depth, /**< depth of current node */
SCIP_Bool execdelayed, /**< execute separation method even if it is marked to be delayed */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls enforcing method of constraint handler for a relaxation solution for all constraints added after last
* conshdlrResetEnfo() call
*/
SCIP_RETCODE SCIPconshdlrEnforceRelaxSol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_SOL* relaxsol, /**< solution to be enforced */
SCIP_Bool solinfeasible, /**< was the solution already found out to be infeasible? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls enforcing method of constraint handler for LP solution for all constraints added after last
* conshdlrReset() call
*/
SCIP_RETCODE SCIPconshdlrEnforceLPSol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_SEPASTORE* sepastore, /**< separation storage */
SCIP_Bool solinfeasible, /**< was the solution already found out to be infeasible? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls diving solution enforcement callback of constraint handler, if it exists */
SCIP_RETCODE SCIPconshdlrGetDiveBoundChanges(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_SET* set, /**< global SCIP settings */
SCIP_DIVESET* diveset, /**< diving settings to control scoring */
SCIP_SOL* sol, /**< current solution of diving mode */
SCIP_Bool* success, /**< pointer to store whether constraint handler successfully found a variable */
SCIP_Bool* infeasible /**< pointer to store whether the current node was detected to be infeasible */
);
/** calls enforcing method of constraint handler for pseudo solution for all constraints added after last
* conshdlrReset() call
*/
SCIP_RETCODE SCIPconshdlrEnforcePseudoSol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_TREE* tree, /**< branch and bound tree */
SCIP_BRANCHCAND* branchcand, /**< branching candidate storage */
SCIP_Bool solinfeasible, /**< was the solution already found out to be infeasible? */
SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
SCIP_Bool forced, /**< should enforcement of pseudo solution be forced? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls feasibility check method of constraint handler */
SCIP_RETCODE SCIPconshdlrCheck(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
SCIP_Bool completely, /**< Should all violations be checked? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls propagation method of constraint handler */
SCIP_RETCODE SCIPconshdlrPropagate(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
int depth, /**< depth of current node; -1 if preprocessing domain propagation */
SCIP_Bool fullpropagation, /**< should all constraints be propagated (or only new ones)? */
SCIP_Bool execdelayed, /**< execute propagation method even if it is marked to be delayed */
SCIP_Bool instrongbranching, /**< are we currently doing strong branching? */
SCIP_PROPTIMING proptiming, /**< current point in the node solving process */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls presolving method of constraint handler */
SCIP_RETCODE SCIPconshdlrPresolve(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PRESOLTIMING timing, /**< current presolving timing */
int nrounds, /**< number of presolving rounds already done */
int* nfixedvars, /**< pointer to total number of variables fixed of all presolvers */
int* naggrvars, /**< pointer to total number of variables aggregated of all presolvers */
int* nchgvartypes, /**< pointer to total number of variable type changes of all presolvers */
int* nchgbds, /**< pointer to total number of variable bounds tightened of all presolvers */
int* naddholes, /**< pointer to total number of domain holes added of all presolvers */
int* ndelconss, /**< pointer to total number of deleted constraints of all presolvers */
int* naddconss, /**< pointer to total number of added constraints of all presolvers */
int* nupgdconss, /**< pointer to total number of upgraded constraints of all presolvers */
int* nchgcoefs, /**< pointer to total number of changed coefficients of all presolvers */
int* nchgsides, /**< pointer to total number of changed left/right hand sides of all presolvers */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** enables or disables all clocks of \p conshdlr, depending on the value of the flag */
void SCIPconshdlrEnableOrDisableClocks(
SCIP_CONSHDLR* conshdlr, /**< the constraint handler for which all clocks should be enabled or disabled */
SCIP_Bool enable /**< should the clocks of the constraint handler be enabled? */
);
/** calls variable deletion method of constraint handler */
SCIP_RETCODE SCIPconshdlrDelVars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** locks rounding of variables involved in the given constraint constraint handler that doesn't need constraints */
SCIP_RETCODE SCIPconshdlrLockVars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_SET* set /**< global SCIP settings */
);
/** unlocks rounding of variables involved in the given constraint constraint handler that doesn't need constraints */
SCIP_RETCODE SCIPconshdlrUnlockVars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_SET* set /**< global SCIP settings */
);
/**
* callback setter methods of constraint handlers
*/
/** sets copy method of both the constraint handler and each associated constraint */
void SCIPconshdlrSetCopy(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), /**< copy method of constraint handler or NULL if you don't want to copy your plugin into sub-SCIPs */
SCIP_DECL_CONSCOPY ((*conscopy)) /**< constraint copying method */
);
/** sets destructor method of constraint handler */
void SCIPconshdlrSetFree(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSFREE ((*consfree)) /**< destructor of constraint handler */
);
/** sets initialization method of constraint handler */
void SCIPconshdlrSetInit(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSINIT ((*consinit)) /**< initialize constraint handler */
);
/** sets deinitialization method of constraint handler */
void SCIPconshdlrSetExit(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSEXIT ((*consexit)) /**< deinitialize constraint handler */
);
/** sets solving process initialization method of constraint handler */
void SCIPconshdlrSetInitsol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSINITSOL((*consinitsol)) /**< solving process initialization method of constraint handler */
);
/** sets solving process deinitialization method of constraint handler */
void SCIPconshdlrSetExitsol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSEXITSOL ((*consexitsol)) /**< solving process deinitialization method of constraint handler */
);
/** sets preprocessing initialization method of constraint handler */
void SCIPconshdlrSetInitpre(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSINITPRE((*consinitpre)) /**< preprocessing initialization method of constraint handler */
);
/** sets preprocessing deinitialization method of constraint handler */
void SCIPconshdlrSetExitpre(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSEXITPRE((*consexitpre)) /**< preprocessing deinitialization method of constraint handler */
);
/** sets presolving method of constraint handler */
SCIP_RETCODE SCIPconshdlrSetPresol(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSPRESOL ((*conspresol)), /**< presolving method of constraint handler */
int maxprerounds, /**< maximal number of presolving rounds the constraint handler participates in (-1: no limit) */
SCIP_PRESOLTIMING presoltiming /**< timing mask of the constraint handler's presolving method */
);
/** sets method of constraint handler to free specific constraint data */
void SCIPconshdlrSetDelete(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSDELETE ((*consdelete)) /**< free specific constraint data */
);
/** sets method of constraint handler to transform constraint data into data belonging to the transformed problem */
void SCIPconshdlrSetTrans(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSTRANS ((*constrans)) /**< transform constraint data into data belonging to the transformed problem */
);
/** sets method of constraint handler to initialize LP with relaxations of "initial" constraints */
void SCIPconshdlrSetInitlp(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSINITLP ((*consinitlp)) /**< initialize LP with relaxations of "initial" constraints */
);
/** sets propagation conflict resolving method of constraint handler */
void SCIPconshdlrSetResprop(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSRESPROP ((*consresprop)) /**< propagation conflict resolving method */
);
/** sets activation notification method of constraint handler */
void SCIPconshdlrSetActive(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSACTIVE ((*consactive)) /**< activation notification method */
);
/** sets deactivation notification method of constraint handler */
void SCIPconshdlrSetDeactive(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSDEACTIVE((*consdeactive)) /**< deactivation notification method */
);
/** sets enabling notification method of constraint handler */
void SCIPconshdlrSetEnable(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSENABLE ((*consenable)) /**< enabling notification method */
);
/** sets disabling notification method of constraint handler */
void SCIPconshdlrSetDisable(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSDISABLE ((*consdisable)) /**< disabling notification method */
);
/** sets variable deletion method of constraint handler */
void SCIPconshdlrSetDelvars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSDELVARS ((*consdelvars)) /**< variable deletion method */
);
/** sets constraint display method of constraint handler */
void SCIPconshdlrSetPrint(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSPRINT ((*consprint)) /**< constraint display method */
);
/** sets constraint parsing method of constraint handler */
void SCIPconshdlrSetParse(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSPARSE ((*consparse)) /**< constraint parsing method */
);
/** sets constraint variable getter method of constraint handler */
void SCIPconshdlrSetGetVars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSGETVARS ((*consgetvars)) /**< constraint variable getter method */
);
/** sets constraint variable number getter method of constraint handler */
void SCIPconshdlrSetGetNVars(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSGETNVARS((*consgetnvars)) /**< constraint variable number getter method */
);
/** sets diving enforcement method of constraint handler */
void SCIPconshdlrSetGetDiveBdChgs(
SCIP_CONSHDLR* conshdlr, /**< constraint handler */
SCIP_DECL_CONSGETDIVEBDCHGS((*consgetdivebdchgs)) /**< constraint handler diving solution enforcement method */
);
/*
* Constraint set change methods
*/
/** frees constraint set change data and releases all included constraints */
SCIP_RETCODE SCIPconssetchgFree(
SCIP_CONSSETCHG** conssetchg, /**< pointer to constraint set change */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set /**< global SCIP settings */
);
/** adds constraint addition to constraint set changes, and captures constraint; activates constraint if the
* constraint set change data is currently active
*/
SCIP_RETCODE SCIPconssetchgAddAddedCons(
SCIP_CONSSETCHG** conssetchg, /**< pointer to constraint set change data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_CONS* cons, /**< added constraint */
int depth, /**< depth of constraint set change's node */
SCIP_Bool focusnode, /**< does the constraint set change belong to the focus node? */
SCIP_Bool active /**< is the constraint set change currently active? */
);
/** adds constraint disabling to constraint set changes, and captures constraint */
SCIP_RETCODE SCIPconssetchgAddDisabledCons(
SCIP_CONSSETCHG** conssetchg, /**< pointer to constraint set change data structure */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_CONS* cons /**< disabled constraint */
);
/** applies constraint set change */
SCIP_RETCODE SCIPconssetchgApply(
SCIP_CONSSETCHG* conssetchg, /**< constraint set change to apply */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
int depth, /**< depth of constraint set change's node */
SCIP_Bool focusnode /**< does the constraint set change belong to the focus node? */
);
/** undoes constraint set change */
SCIP_RETCODE SCIPconssetchgUndo(
SCIP_CONSSETCHG* conssetchg, /**< constraint set change to undo */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** applies constraint set change to the global problem and deletes the constraint set change data */
SCIP_RETCODE SCIPconssetchgMakeGlobal(
SCIP_CONSSETCHG** conssetchg, /**< pointer to constraint set change data */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** increase count of applied cuts */
void SCIPconshdlrIncNAppliedCuts(
SCIP_CONSHDLR* conshdlr /**< constraint handler */
);
/** increase count of found cuts */
void SCIPconshdlrIncNCutsFound(
SCIP_CONSHDLR* conshdlr /**< constraint handler */
);
/*
* Constraint methods
*/
/** creates and captures a constraint, and inserts it into the conss array of its constraint handler
*
* @warning If a constraint is marked to be checked for feasibility but not to be enforced, a LP or pseudo solution
* may be declared feasible even if it violates this particular constraint.
* This constellation should only be used, if no LP or pseudo solution can violate the constraint -- e.g. if a
* local constraint is redundant due to the variable's local bounds.
*/
SCIP_RETCODE SCIPconsCreate(
SCIP_CONS** cons, /**< pointer to constraint */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
const char* name, /**< name of constraint */
SCIP_CONSHDLR* conshdlr, /**< constraint handler for this constraint */
SCIP_CONSDATA* consdata, /**< data for this specific constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
SCIP_Bool original, /**< is constraint belonging to the original problem? */
SCIP_Bool deleteconsdata /**< has the constraint data to be deleted if constraint is freed? */
);
/** copies source constraint of source SCIP into the target constraint for the target SCIP, using the variable map for
* mapping the variables of the source SCIP to the variables of the target SCIP; if the copying process was successful
* a constraint is created and captured;
*
* @warning If a constraint is marked to be checked for feasibility but not to be enforced, an LP or pseudo solution
* may be declared feasible even if it violates this particular constraint.
* This constellation should only be used, if no LP or pseudo solution can violate the constraint -- e.g. if a
* local constraint is redundant due to the variable's local bounds.
*/
SCIP_RETCODE SCIPconsCopy(
SCIP_CONS** cons, /**< pointer to store the created target constraint */
SCIP_SET* set, /**< global SCIP settings of the target SCIP */
const char* name, /**< name of constraint, or NULL if the name of the source constraint should be used */
SCIP* sourcescip, /**< source SCIP data structure */
SCIP_CONSHDLR* sourceconshdlr, /**< source constraint handler for this constraint */
SCIP_CONS* sourcecons, /**< source constraint of the source SCIP */
SCIP_HASHMAP* varmap, /**< a SCIP_HASHMAP mapping variables of the source SCIP to corresponding
* variables of the target SCIP */
SCIP_HASHMAP* consmap, /**< a hashmap to store the mapping of source constraints to the corresponding
* target constraints, must not be NULL! */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP? */
SCIP_Bool separate, /**< should the constraint be separated during LP processing? */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing? */
SCIP_Bool check, /**< should the constraint be checked for feasibility? */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing? */
SCIP_Bool local, /**< is constraint only valid locally? */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)? */
SCIP_Bool dynamic, /**< is constraint subject to aging? */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup? */
SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node? */
SCIP_Bool global, /**< create a global or a local copy? */
SCIP_Bool* valid /**< pointer to store whether the copying was valid or not */
);
/** parses constraint information (in cip format) out of a string; if the parsing process was successful a constraint is
* created, captured, and inserted into the conss array of its constraint handler.
*
* @warning If a constraint is marked to be checked for feasibility but not to be enforced, an LP or pseudo solution
* may be declared feasible even if it violates this particular constraint.
* This constellation should only be used, if no LP or pseudo solution can violate the constraint -- e.g. if a
* local constraint is redundant due to the variable's local bounds.
*/
SCIP_RETCODE SCIPconsParse(
SCIP_CONS** cons, /**< pointer to constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler of target SCIP */
const char* str, /**< name of constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode, /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
SCIP_Bool* success /**< pointer store if the paring process was successful */
);
/** change name of given constraint */
SCIP_RETCODE SCIPconsChgName(
SCIP_CONS* cons, /**< problem constraint */
BMS_BLKMEM* blkmem, /**< block memory buffer */
const char* name /**< new name of constraint */
);
/** frees a constraint and removes it from the conss array of its constraint handler */
SCIP_RETCODE SCIPconsFree(
SCIP_CONS** cons, /**< constraint to free */
BMS_BLKMEM* blkmem, /**< block memory buffer */
SCIP_SET* set /**< global SCIP settings */
);
/** increases usage counter of constraint */
void SCIPconsCapture(
SCIP_CONS* cons /**< constraint */
);
/** decreases usage counter of constraint, and frees memory if necessary */
SCIP_RETCODE SCIPconsRelease(
SCIP_CONS** cons, /**< pointer to constraint */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set /**< global SCIP settings */
);
/** outputs constraint information to file stream */
SCIP_RETCODE SCIPconsPrint(
SCIP_CONS* cons, /**< constraint to print */
SCIP_SET* set, /**< global SCIP settings */
SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
FILE* file /**< output file (or NULL for standard output) */
);
/** checks single constraint for feasibility of the given solution */
SCIP_RETCODE SCIPconsCheck(
SCIP_CONS* cons, /**< constraint to check */
SCIP_SET* set, /**< global SCIP settings */
SCIP_SOL* sol, /**< primal CIP solution */
SCIP_Bool checkintegrality, /**< Has integrality to be checked? */
SCIP_Bool checklprows, /**< Do constraints represented by rows in the current LP have to be checked? */
SCIP_Bool printreason, /**< Should the reason for the violation be printed? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** enforces single constraint for a given pseudo solution */
SCIP_RETCODE SCIPconsEnfops(
SCIP_CONS* cons, /**< constraint to enforce */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
SCIP_Bool objinfeasible, /**< is the solution infeasible anyway due to violating lower objective bound? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** enforces single constraint for a given LP solution */
SCIP_RETCODE SCIPconsEnfolp(
SCIP_CONS* cons, /**< constraint to enforce */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** enforces single constraint for a given relaxation solution */
SCIP_RETCODE SCIPconsEnforelax(
SCIP_CONS* cons, /**< constraint to enforce */
SCIP_SET* set, /**< global SCIP settings */
SCIP_SOL* sol, /**< solution to be enforced */
SCIP_Bool solinfeasible, /**< was the solution already declared infeasible by a constraint handler? */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls LP initialization method for single constraint */
SCIP_RETCODE SCIPconsInitlp(
SCIP_CONS* cons, /**< constraint to initialize */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool* infeasible /**< pointer to store whether infeasibility was detected while building the LP */
);
/** calls separation method of single constraint for LP solution */
SCIP_RETCODE SCIPconsSepalp(
SCIP_CONS* cons, /**< constraint to separate */
SCIP_SET* set, /**< global SCIP settings */
SCIP_RESULT* result /**< pointer to store the result of the separation call */
);
/** calls separation method of single constraint for given primal solution */
SCIP_RETCODE SCIPconsSepasol(
SCIP_CONS* cons, /**< constraint to separate */
SCIP_SET* set, /**< global SCIP settings */
SCIP_SOL* sol, /**< primal solution that should be separated */
SCIP_RESULT* result /**< pointer to store the result of the separation call */
);
/** calls domain propagation method of single constraint */
SCIP_RETCODE SCIPconsProp(
SCIP_CONS* cons, /**< constraint to propagate */
SCIP_SET* set, /**< global SCIP settings */
SCIP_PROPTIMING proptiming, /**< current point in the node solving loop */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** resolves propagation conflict of single constraint */
SCIP_RETCODE SCIPconsResprop(
SCIP_CONS* cons, /**< constraint to resolve conflict for */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
int inferinfo, /**< the user information passed to the corresponding SCIPinferVarLbCons() or SCIPinferVarUbCons() call */
SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** presolves single constraint */
SCIP_RETCODE SCIPconsPresol(
SCIP_CONS* cons, /**< constraint to presolve */
SCIP_SET* set, /**< global SCIP settings */
int nrounds, /**< number of presolving rounds already done */
SCIP_PRESOLTIMING timing, /**< current presolving timing */
int nnewfixedvars, /**< number of variables fixed since the last call to the presolving method */
int nnewaggrvars, /**< number of variables aggregated since the last call to the presolving method */
int nnewchgvartypes, /**< number of variable type changes since the last call to the presolving method */
int nnewchgbds, /**< number of variable bounds tightened since the last call to the presolving method */
int nnewholes, /**< number of domain holes added since the last call to the presolving method */
int nnewdelconss, /**< number of deleted constraints since the last call to the presolving method */
int nnewaddconss, /**< number of added constraints since the last call to the presolving method */
int nnewupgdconss, /**< number of upgraded constraints since the last call to the presolving method */
int nnewchgcoefs, /**< number of changed coefficients since the last call to the presolving method */
int nnewchgsides, /**< number of changed left or right hand sides since the last call to the presolving method */
int* nfixedvars, /**< pointer to count total number of variables fixed of all presolvers */
int* naggrvars, /**< pointer to count total number of variables aggregated of all presolvers */
int* nchgvartypes, /**< pointer to count total number of variable type changes of all presolvers */
int* nchgbds, /**< pointer to count total number of variable bounds tightened of all presolvers */
int* naddholes, /**< pointer to count total number of domain holes added of all presolvers */
int* ndelconss, /**< pointer to count total number of deleted constraints of all presolvers */
int* naddconss, /**< pointer to count total number of added constraints of all presolvers */
int* nupgdconss, /**< pointer to count total number of upgraded constraints of all presolvers */
int* nchgcoefs, /**< pointer to count total number of changed coefficients of all presolvers */
int* nchgsides, /**< pointer to count total number of changed left/right hand sides of all presolvers */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** calls constraint activation notification method of single constraint */
SCIP_RETCODE SCIPconsActive(
SCIP_CONS* cons, /**< constraint to notify */
SCIP_SET* set /**< global SCIP settings */
);
/** calls constraint deactivation notification method of single constraint */
SCIP_RETCODE SCIPconsDeactive(
SCIP_CONS* cons, /**< constraint to notify */
SCIP_SET* set /**< global SCIP settings */
);
/** method to collect the variables of a constraint
*
* If the number of variables is greater than the available slots in the variable array, nothing happens except that
* the success point is set to FALSE. With the method SCIPgetConsNVars() it is possible to get the number of variables
* a constraint has in its scope.
*
* @note The success pointer indicates if all variables were copied into the vars arrray.
*
* @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
* set to FALSE.
*/
SCIP_RETCODE SCIPconsGetVars(
SCIP_CONS* cons, /**< constraint to print */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR** vars, /**< array to store the involved variable of the constraint */
int varssize, /**< available slots in vars array which is needed to check if the array is large enough */
SCIP_Bool* success /**< pointer to store whether the variables are successfully copied */
);
/** method to collect the number of variables of a constraint
*
* @note The success pointer indicates if the contraint handler was able to return the number of variables
*
* @note It might be that a constraint handler does not support this functionality, in that case the success pointer is
* set to FALSE
*/
SCIP_RETCODE SCIPconsGetNVars(
SCIP_CONS* cons, /**< constraint to print */
SCIP_SET* set, /**< global SCIP settings */
int* nvars, /**< pointer to store the number of variables */
SCIP_Bool* success /**< pointer to store whether the constraint successfully returned the number of variables */
);
/** globally removes constraint from all subproblems; removes constraint from the constraint set change data of the
* node, where it was created, or from the problem, if it was a problem constraint
*/
SCIP_RETCODE SCIPconsDelete(
SCIP_CONS* cons, /**< constraint to delete */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** gets and captures transformed constraint of a given constraint; if the constraint is not yet transformed,
* a new transformed constraint for this constraint is created
*/
SCIP_RETCODE SCIPconsTransform(
SCIP_CONS* origcons, /**< original constraint */
BMS_BLKMEM* blkmem, /**< block memory buffer */
SCIP_SET* set, /**< global SCIP settings */
SCIP_CONS** transcons /**< pointer to store the transformed constraint */
);
/** sets the initial flag of the given constraint */
SCIP_RETCODE SCIPconsSetInitial(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_Bool initial /**< new value */
);
/** sets the separate flag of the given constraint */
SCIP_RETCODE SCIPconsSetSeparated(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool separate /**< new value */
);
/** sets the enforce flag of the given constraint */
SCIP_RETCODE SCIPconsSetEnforced(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool enforce /**< new value */
);
/** sets the check flag of the given constraint */
SCIP_RETCODE SCIPconsSetChecked(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool check /**< new value */
);
/** sets the propagate flag of the given constraint */
SCIP_RETCODE SCIPconsSetPropagated(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_Bool propagate /**< new value */
);
/** sets the local flag of the given constraint */
void SCIPconsSetLocal(
SCIP_CONS* cons, /**< constraint */
SCIP_Bool local /**< new value */
);
/** sets the modifiable flag of the given constraint */
void SCIPconsSetModifiable(
SCIP_CONS* cons, /**< constraint */
SCIP_Bool modifiable /**< new value */
);
/** sets the dynamic flag of the given constraint */
void SCIPconsSetDynamic(
SCIP_CONS* cons, /**< constraint */
SCIP_Bool dynamic /**< new value */
);
/** sets the removable flag of the given constraint */
void SCIPconsSetRemovable(
SCIP_CONS* cons, /**< constraint */
SCIP_Bool removable /**< new value */
);
/** sets the stickingatnode flag of the given constraint */
void SCIPconsSetStickingAtNode(
SCIP_CONS* cons, /**< constraint */
SCIP_Bool stickingatnode /**< new value */
);
/** gives the constraint a new name; ATTENTION: to old pointer is over written that might
* result in a memory leakage */
void SCIPconsSetNamePointer(
SCIP_CONS* cons, /**< constraint */
const char* name /**< new name of constraint */
);
/** gets associated transformed constraint of an original constraint, or NULL if no associated transformed constraint
* exists
*/
SCIP_CONS* SCIPconsGetTransformed(
SCIP_CONS* cons /**< constraint */
);
/** activates constraint or marks constraint to be activated in next update */
SCIP_RETCODE SCIPconsActivate(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
int depth, /**< depth in the tree where the constraint activation takes place, or -1 for global problem */
SCIP_Bool focusnode /**< does the constraint activation take place at the focus node? */
);
/** deactivates constraint or marks constraint to be deactivated in next update */
SCIP_RETCODE SCIPconsDeactivate(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** enables constraint's separation, enforcing, and propagation capabilities or marks them to be enabled in next update */
SCIP_RETCODE SCIPconsEnable(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** disables constraint's separation, enforcing, and propagation capabilities or marks them to be disabled in next update */
SCIP_RETCODE SCIPconsDisable(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat /**< dynamic problem statistics */
);
/** enables constraint's separation capabilities or marks them to be enabled in next update */
SCIP_RETCODE SCIPconsEnableSeparation(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** disables constraint's separation capabilities or marks them to be disabled in next update */
SCIP_RETCODE SCIPconsDisableSeparation(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** enables constraint's propagation capabilities or marks them to be enabled in next update */
SCIP_RETCODE SCIPconsEnablePropagation(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** disables constraint's propagation capabilities or marks them to be disabled in next update */
SCIP_RETCODE SCIPconsDisablePropagation(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** marks the constraint to be a conflict */
void SCIPconsMarkConflict(
SCIP_CONS* cons /**< constraint */
);
/** marks the constraint to be propagated (update might be delayed) */
SCIP_EXPORT
SCIP_RETCODE SCIPconsMarkPropagate(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** unmarks the constraint to be propagated (update might be delayed) */
SCIP_RETCODE SCIPconsUnmarkPropagate(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** adds given value to age of constraint, but age can never become negative;
* should be called
* - in constraint separation, if no cut was found for this constraint,
* - in constraint enforcing, if constraint was feasible, and
* - in constraint propagation, if no domain reduction was deduced;
* if it's age exceeds the constraint age limit, makes constraint obsolete or marks constraint to be made obsolete
* in next update
*/
SCIP_RETCODE SCIPconsAddAge(
SCIP_CONS* cons, /**< constraint */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_Real deltaage, /**< value to add to the constraint's age */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** increases age of constraint by 1.0;
* should be called
* - in constraint separation, if no cut was found for this constraint,
* - in constraint enforcing, if constraint was feasible, and
* - in constraint propagation, if no domain reduction was deduced;
* if it's age exceeds the constraint age limit, makes constraint obsolete or marks constraint to be made obsolete
* in next update
*/
SCIP_RETCODE SCIPconsIncAge(
SCIP_CONS* cons, /**< constraint */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_SET* set, /**< global SCIP settings */
SCIP_STAT* stat, /**< dynamic problem statistics */
SCIP_PROB* prob, /**< problem data */
SCIP_REOPT* reopt /**< reoptimization data */
);
/** resets age of constraint to zero;
* should be called
* - in constraint separation, if a cut was found for this constraint,
* - in constraint enforcing, if the constraint was violated, and
* - in constraint propagation, if a domain reduction was deduced;
* if it was obsolete, makes constraint useful again or marks constraint to be made useful again in next update
*/
SCIP_RETCODE SCIPconsResetAge(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set /**< global SCIP settings */
);
/** resolves the given conflicting bound, that was deduced by the given constraint, by putting all "reason" bounds
* leading to the deduction into the conflict queue with calls to SCIPaddConflictLb(), SCIPaddConflictUb(), SCIPaddConflictBd(),
* SCIPaddConflictRelaxedLb(), SCIPaddConflictRelaxedUb(), SCIPaddConflictRelaxedBd(), or SCIPaddConflictBinvar();
*
* @note it is sufficient to explain the relaxed bound change
*/
SCIP_RETCODE SCIPconsResolvePropagation(
SCIP_CONS* cons, /**< constraint that deduced the assignment */
SCIP_SET* set, /**< global SCIP settings */
SCIP_VAR* infervar, /**< variable whose bound was deduced by the constraint */
int inferinfo, /**< user inference information attached to the bound change */
SCIP_BOUNDTYPE inferboundtype, /**< bound that was deduced (lower or upper bound) */
SCIP_BDCHGIDX* bdchgidx, /**< bound change index, representing the point of time where change took place */
SCIP_Real relaxedbd, /**< the relaxed bound */
SCIP_RESULT* result /**< pointer to store the result of the callback method */
);
/** adds given values to lock status of the constraint and updates the locks of the given locktype of the involved variables */
SCIP_RETCODE SCIPconsAddLocks(
SCIP_CONS* cons, /**< constraint */
SCIP_SET* set, /**< global SCIP settings */
SCIP_LOCKTYPE locktype, /**< type of variable locks */
int nlockspos, /**< increase in number of rounding locks for constraint */
int nlocksneg /**< increase in number of rounding locks for constraint's negation */
);
/*
* Hash functions
*/
/** gets the key (i.e. the name) of the given constraint */
SCIP_DECL_HASHGETKEY(SCIPhashGetKeyCons);
/*
* method for arrays of contraint handlers
*/
/** stores all constraints marked for propagation away when probing is started */
SCIP_RETCODE SCIPconshdlrsStorePropagationStatus(
SCIP_SET* set, /**< global SCIP settings */
SCIP_CONSHDLR** conshdlrs, /**< all constraint handlers */
int nconshdlrs /**< number of contraint handlers */
);
/** reset all constraints marked for propagation when probing was finished */
SCIP_RETCODE SCIPconshdlrsResetPropagationStatus(
SCIP_SET* set, /**< global SCIP settings */
BMS_BLKMEM* blkmem, /**< block memory */
SCIP_CONSHDLR** conshdlrs, /**< all constraint handlers */
int nconshdlrs /**< number of contraint handlers */
);
#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 cons_abspower.h
* @ingroup CONSHDLRS
* @brief Constraint handler for absolute power constraints \f$\textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}\f$
* @author Stefan Vigerske
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_ABSPOWER_H__
#define __SCIP_CONS_ABSPOWER_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_nlp.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_sol.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for absolute power constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrAbspower(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Absolute Power Constraints
*
* @{
*
* This constraint handler handles constraints of the form
* \f[
* \textrm{lhs} \leq \textrm{sign}(x+a) |x+a|^n + c z \leq \textrm{rhs}
* \f]
* for \f$n > 1.0\f$ a rational number, \f$a\f$ and \f$c\f$ arbitrary, and \f$x\f$ and \f$z\f$ variables.
* Note that \f$x\f$ can have \f$-a\f$ in the interior of its domain.
*
* Constraints are enforced by separation, domain propagation, and spatial branching.
*
* Cuts that separate on the convex hull of the graph of \f$\textrm{sign}(x+a) |x+a|^n\f$ are generated as long as they separate the relaxation solution.
* Otherwise, spatial branching on \f$x\f$ is applied.
*
* Further, domain propagation is implemented to propagate bound changes on \f$x\f$ onto \f$z\f$, and vice versa, and
* repropagation is implemented to allow for conflict analysis.
* During presolve, a pairwise comparison of absolute power constraints may allow to fix or aggregate some variables.
* See also
*
* @par
* Stefan Vigerske@n
* Decomposition of Multistage Stochastic Programs and a Constraint Integer Programming Approach to Mixed-Integer Nonlinear Programming@n
* PhD Thesis, Humboldt-University Berlin, 2012, submitted.
*
*/
/** creates and captures a absolute power constraint
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_VAR* x, /**< nonlinear variable x in constraint */
SCIP_VAR* z, /**< linear variable z in constraint */
SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
SCIP_Real zcoef, /**< coefficient of z in constraint */
SCIP_Real lhs, /**< left hand side of constraint */
SCIP_Real rhs, /**< right hand side of constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are seperated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an absolute power constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsAbspower(); all flags can be set via SCIPconsSetFLAGNAME-methods in scip.h
*
* @see SCIPcreateConsAbspower() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_VAR* x, /**< nonlinear variable x in constraint */
SCIP_VAR* z, /**< linear variable z in constraint */
SCIP_Real exponent, /**< exponent n of |x+offset|^n term in constraint */
SCIP_Real xoffset, /**< offset in |x+offset|^n term in constraint */
SCIP_Real zcoef, /**< coefficient of z in constraint */
SCIP_Real lhs, /**< left hand side of constraint */
SCIP_Real rhs /**< right hand side of constraint */
);
/** gets the absolute power constraint as a nonlinear row representation */
SCIP_EXPORT
SCIP_RETCODE SCIPgetNlRowAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint */
SCIP_NLROW** nlrow /**< a buffer where to store pointer to nonlinear row */
);
/** gets nonlinear variable x in absolute power constraint */
SCIP_EXPORT
SCIP_VAR* SCIPgetNonlinearVarAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets linear variable z in absolute power constraint */
SCIP_EXPORT
SCIP_VAR* SCIPgetLinearVarAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets exponent in power term in absolute power constraint */
SCIP_EXPORT
SCIP_Real SCIPgetExponentAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets offset in power term in absolute power constraint */
SCIP_EXPORT
SCIP_Real SCIPgetOffsetAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets coefficient of linear variable in absolute power constraint */
SCIP_EXPORT
SCIP_Real SCIPgetCoefLinearAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets left hand side in absolute power constraint */
SCIP_EXPORT
SCIP_Real SCIPgetLhsAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets right hand side in absolute power constraint */
SCIP_EXPORT
SCIP_Real SCIPgetRhsAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** gets the absolute violation of a absolute power constraint by a solution */
SCIP_EXPORT
SCIP_Real SCIPgetViolationAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< absolute power constraint */
SCIP_SOL* sol /**< LP solution */
);
/** returns whether constraint is convex w.r.t. global bounds
*
* @note in difference to SCIPisConvexQuadratic, we put convexity/concavity of the constraint function in relation to the constraint sides here
*/
SCIP_EXPORT
SCIP_Bool SCIPisConvexAbspower(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< absolute power constraint */
);
/** @} */
/** @} */
#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 cons_and.h
* @ingroup CONSHDLRS
* @brief Constraint handler for AND constraints, \f$r = x_1 \wedge x_2 \wedge \dots \wedge x_n\f$
* @author Tobias Achterberg
* @author Stefan Heinz
* @author Michael Winkler
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_AND_H__
#define __SCIP_CONS_AND_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for and constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrAnd(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name AND Constraints
*
* @{
*
* This constraint handler deals with AND-constraints. These are constraint of the form:
*
* \f[
* r = x_1 \wedge x_2 \wedge \dots \wedge x_n
* \f]
*
* where \f$x_i\f$ is a binary variable for all \f$i\f$. Hence, \f$r\f$ is also of binary type. The variable \f$r\f$ is
* called resultant and the \f$x\f$'s operators.
*/
/** creates and captures an and constraint
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsAnd(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_VAR* resvar, /**< resultant variable of the operation */
int nvars, /**< number of operator variables in the constraint */
SCIP_VAR** vars, /**< array with operator variables of constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an and constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsAnd(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
*
* @see SCIPcreateConsAnd() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicAnd(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_VAR* resvar, /**< resultant variable of the operation */
int nvars, /**< number of operator variables in the constraint */
SCIP_VAR** vars /**< array with operator variables of constraint */
);
/** gets number of variables in and constraint */
SCIP_EXPORT
int SCIPgetNVarsAnd(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets array of variables in and constraint */
SCIP_EXPORT
SCIP_VAR** SCIPgetVarsAnd(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets the resultant variable in and constraint */
SCIP_EXPORT
SCIP_VAR* SCIPgetResultantAnd(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** return if the variables of the AND-constraint are sorted with respect to their indices */
SCIP_EXPORT
SCIP_Bool SCIPisAndConsSorted(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** sort the variables of the AND-constraint with respect to their indices */
SCIP_EXPORT
SCIP_RETCODE SCIPsortAndCons(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** when 'upgrading' the given AND-constraint, should the check flag for the upgraded constraint be set to TRUE, even if
* the check flag of this AND-constraint is set to FALSE?
*/
SCIP_EXPORT
SCIP_RETCODE SCIPchgAndConsCheckFlagWhenUpgr(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint data */
SCIP_Bool flag /**< should an arising constraint from the given AND-constraint be checked,
* even if the check flag of the AND-constraint is set to FALSE
*/
);
/** when 'upgrading' the given AND-constraint, should the removable flag for the upgraded constraint be set to FALSE,
* even if the removable flag of this AND-constraint is set to TRUE?
*/
SCIP_EXPORT
SCIP_RETCODE SCIPchgAndConsRemovableFlagWhenUpgr(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint data */
SCIP_Bool flag /**< should an arising constraint from the given AND-constraint be not
* removable, even if the removable flag of the AND-constraint is set to
* TRUE
*/
);
/** @} */
/** @} */
#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 cons_benders.h
* @ingroup CONSHDLRS
* @brief constraint handler for Benders' decomposition
* @author Stephen J. Maher
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_BENDERS_H__
#define __SCIP_CONS_BENDERS_H__
#include "scip/def.h"
#include "scip/type_benders.h"
#include "scip/type_cons.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 handler for Benders' decomposition and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrBenders(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Benders Constraints
*
* Two constraint handlers are implemented for the generation of Benders' decomposition cuts. When included in a
* problem, the Benders' decomposition constraint handlers generate cuts during the enforcement of LP and relaxation
* solutions. Additionally, Benders' decomposition cuts can be generated when checking the feasibility of solutions with
* respect to the subproblem constraints.
*
* This constraint handler has an enforcement priority that is less than the integer constraint handler. This means that
* only integer feasible solutions from the LP solver are enforced by this constraint handler. This is the traditional
* behaviour of the branch-and-check approach to Benders' decomposition. Additionally, the check priority is set low,
* such that this expensive constraint handler is only called as a final check on primal feasible solutions.
*
* This constraint handler in the standard constraint handler that should be added when using Benders' decomposition.
* Additionally, there is a flag in SCIPincludeConshdlrBenders that permits the addition of the LP constraint handler,
* cons_benderslp. The use of both cons_benders and cons_benderslp allows the user to perform a multiphase Benders'
* decomposition algorithm.
*
* @{
*/
/** enforces Benders' constraints for given solution
*
* This method is called from cons_benderslp and cons_benders. If the method is called from cons_benderslp, then the
* solutions are not guaranteed to be integer feasible. This is because the default priority is set greater than the
* integer constraint handler. If this method is called from cons_benders, then, because the default enforcement
* priority is set less than that of the integer constraint handler, then it can be assumed that the solutions are
* integer feasible.
*
* The checkint flag indicates whether integer feasibility can be assumed. If it is not assumed, i.e. checkint ==
* FALSE, then only the convex relaxations of the subproblems are solved. If integer feasibility is assumed, i.e.
* checkint == TRUE, then the convex relaxations and the full CIP are solved to generate Benders' cuts and check
* solution feasibility.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPconsBendersEnforceSolution(
SCIP* scip, /**< the SCIP instance */
SCIP_SOL* sol, /**< the primal solution to enforce, or NULL for the current LP/pseudo sol */
SCIP_CONSHDLR* conshdlr, /**< the constraint handler */
SCIP_RESULT* result, /**< the result of the enforcement */
SCIP_BENDERSENFOTYPE type, /**< the type of solution being enforced */
SCIP_Bool checkint /**< should integrality be considered when checking the subproblems */
);
/** @} */
/** @} */
#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 cons_benderslp.h
* @ingroup CONSHDLRS
* @brief constraint handler for benderslp decomposition
* @author Stephen J. Maher
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_BENDERSLP_H__
#define __SCIP_CONS_BENDERSLP_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for benderslp constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrBenderslp(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Benders Constraints
*
* Two constraint handlers are implemented for the generation of Benders' decomposition cuts. When included in a
* problem, the Benders' decomposition constraint handlers generate cuts during the enforcement of LP and relaxation
* solutions. Additionally, Benders' decomposition cuts can be generated when checking the feasibility of solutions with
* respect to the subproblem constraints.
*
* This constraint handler has an enforcement priority that is greater than the integer constraint handler. This means
* that all LP solutions will be first checked for feasibility with respect to the Benders' decomposition second stage
* constraints before performing an integrality check. This is part of a multi-phase approach for solving mixed integer
* programs by Benders' decomposition.
*
* A parameter is available to control the depth at which the non-integer LP solution are enforced by solving the
* Benders' decomposition subproblems. This parameter is set to 0 by default, indicating that non-integer LP solutions
* are enforced only at the root node.
*
* @{
*/
/** @} */
/** @} */
#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 cons_bivariate.h
* @ingroup CONSHDLRS
* @brief constraint handler for bivariate nonlinear constraints \f$\textrm{lhs} \leq f(x,y) + c z \leq \textrm{rhs}\f$
* @author Martin Ballerstein
* @author Dennis Michaels
* @author Stefan Vigerske
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_BIVARIATE_H__
#define __SCIP_CONS_BIVARIATE_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "nlpi/type_expr.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for bivariate constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrBivariate(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Bivariate Constraints
*
* This constraint handler handles constraints of the form
* \f[
* \textrm{lhs} \leq f(x,y) + c z \leq \textrm{rhs}
* \f]
* for a bivariate nonlinear function \f$f(x,y)\f$ (given as expression tree) that has
* a fixed convexity behaviour, that is, \f$f(x,y)\f$ has to be either jointly convex in \f$(x,y)\f$,
* or convex in \f$x\f$ and concave in \f$y\f$,
* or convex in \f$x\f$ and convex in \f$y\f$, but indefinite w.r.t. \f$(x,y)\f$.
* See also
*
* @par
* Martin Ballerstein, Dennis Michaels, and Stefan Vigerske@n
* Linear Underestimators for bivariate functions with a fixed convexity behavior@n
* ZIB Report 13-02, 2013. http://opus4.kobv.de/opus4-zib/frontdoor/index/index/docId/1764
*
* @{
*/
typedef enum
{
SCIP_BIVAR_ALLCONVEX = 0, /* f(x,y) is convex */
SCIP_BIVAR_1CONVEX_INDEFINITE = 1, /* f(x,y) is 1-convex and indefinite */
SCIP_BIVAR_CONVEX_CONCAVE = 2, /* f(x,y) is convex in x and concave in y */
SCIP_BIVAR_UNKNOWN = 3 /* unknown */
} SCIP_BIVAR_CONVEXITY;
/** creates and captures a bivariate constraint
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_EXPRTREE* f, /**< expression tree specifying bivariate function f(x,y) */
SCIP_BIVAR_CONVEXITY convextype, /**< kind of convexity of f(x,y) */
SCIP_VAR* z, /**< linear variable in constraint */
SCIP_Real zcoef, /**< coefficient of linear variable */
SCIP_Real lhs, /**< left hand side of constraint */
SCIP_Real rhs, /**< right hand side of constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are seperated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an absolute power constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsBivariate(); all flags can be set via SCIPconsSetFLAGNAME-methods in cons.h
*
* @see SCIPcreateConsBivariate() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
SCIP_EXPRTREE* f, /**< expression tree specifying bivariate function f(x,y) */
SCIP_BIVAR_CONVEXITY convextype, /**< kind of convexity of f(x,y) */
SCIP_VAR* z, /**< linear variable in constraint */
SCIP_Real zcoef, /**< coefficient of linear variable */
SCIP_Real lhs, /**< left hand side of constraint */
SCIP_Real rhs /**< right hand side of constraint */
);
/** gets the linear variable of a bivariate constraint, or NULL if no such variable */
SCIP_EXPORT
SCIP_VAR* SCIPgetLinearVarBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** gets the coefficients of the linear variable of a bivariate constraint */
SCIP_EXPORT
SCIP_Real SCIPgetLinearCoefBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** gets the expression tree of a bivariate constraint */
SCIP_EXPORT
SCIP_EXPRTREE* SCIPgetExprtreeBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** gets the left hand side of a bivariate constraint */
SCIP_EXPORT
SCIP_Real SCIPgetLhsBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** gets the right hand side of a bivariate constraint */
SCIP_EXPORT
SCIP_Real SCIPgetRhsBivariate(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** @} */
/** @} */
#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 cons_bounddisjunction.h
* @ingroup CONSHDLRS
* @brief constraint handler for bound disjunction constraints \f$(x_1 \{\leq,\geq\} b_1) \vee \ldots \vee (x_n \{\leq,\geq\} b_n)\f$
* @author Tobias Achterberg
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_BOUNDDISJUNCTION_H__
#define __SCIP_CONS_BOUNDDISJUNCTION_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_lp.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for bound disjunction constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrBounddisjunction(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Bound Disjunction Constraints
*
* @{
*
* This constraint handler handles bound disjunction constraints of the form
* \f[
* (x_1 \{\leq,\geq\} b_1) \vee \ldots \vee (x_n \{\leq,\geq\} b_n)
* \f]
* with bounds \f$b_i \in Q\f$, decision variables \f$x_i\f$, which can be of any type,
* and bound types \f$\leq\f$ or \f$\geq\f$.
*/
/** creates and captures a bound disjunction constraint
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables in the constraint */
SCIP_VAR** vars, /**< variables of the literals in the constraint */
SCIP_BOUNDTYPE* boundtypes, /**< types of bounds of the literals (lower or upper bounds) */
SCIP_Real* bounds, /**< bounds of the literals */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an and constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsBounddisjunction(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
*
* @see SCIPcreateConsBounddisjunction() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables in the constraint */
SCIP_VAR** vars, /**< variables of the literals in the constraint */
SCIP_BOUNDTYPE* boundtypes, /**< types of bounds of the literals (lower or upper bounds) */
SCIP_Real* bounds /**< bounds of the literals */
);
/** gets number of variables in bound disjunction constraint */
SCIP_EXPORT
int SCIPgetNVarsBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets array of variables in bound disjunction constraint */
SCIP_EXPORT
SCIP_VAR** SCIPgetVarsBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets array of bound types in bound disjunction constraint */
SCIP_EXPORT
SCIP_BOUNDTYPE* SCIPgetBoundtypesBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets array of bounds in bound disjunction constraint */
SCIP_EXPORT
SCIP_Real* SCIPgetBoundsBounddisjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** @} */
/** @} */
#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 cons_cardinality.h
* @ingroup CONSHDLRS
* @brief constraint handler for cardinality constraints
* @author Tobias Fischer
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_CARDINALITY_H__
#define __SCIP_CONS_CARDINALITY_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for cardinality constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrCardinality(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Cardinality Constraints
*
* @{
*
* This constraint handler handles cardinality constraints of the form
* \f[
* |\mbox{supp}(x)| \leq b
* \f]
* with integer right-hand side \f$b\f$. Here, \f$|\mbox{supp}(x)|\f$ denotes the number of nonzero entries of the
* vector \f$x\f$.
*
* Cardinality constraints generalize special ordered set of type one (SOS1) constraints in which \f$b = 1\f$.
*/
/** creates and captures an cardinality constraint
*
* We set the constraint to not be modifable. If the weights are non
* NULL, the variables are ordered according to these weights (in
* ascending order).
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables in the constraint */
SCIP_VAR** vars, /**< array with variables of constraint entries */
int cardval, /**< number of variables allowed to be nonzero */
SCIP_VAR** indvars, /**< indicator variables to indicate which variables may be treated as nonzero
* in cardinality constraint, or NULL if indicator variables should be
* created automatically */
SCIP_Real* weights, /**< weights determining the variable order, or NULL if variables should be
* ordered in the same way they were added to the constraint */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an cardinality constraint
* in its most basic variant, i. e., with all constraint flags set to their default values, which can be set
* afterwards using SCIPsetConsFLAGNAME() in scip.h
*
* @see SCIPcreateConsCardinality() for the default constraint flag configuration
*
* @warning Do NOT set the constraint to be modifiable manually, because this might lead
* to wrong results as the variable array will not be resorted
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables in the constraint */
SCIP_VAR** vars, /**< array with variables of constraint entries */
int cardval, /**< number of variables allowed to be nonzero */
SCIP_VAR** indvars, /**< indicator variables to indicate which variables may be treated as nonzero
* in cardinality constraint, or NULL if indicator variables should be
* created automatically */
SCIP_Real* weights /**< weights determining the variable order, or NULL if variables should be
* ordered in the same way they were added to the constraint */
);
/** changes cardinality value of cardinality constraint (i.e., right hand side of cardinality constraint) */
SCIP_EXPORT
SCIP_RETCODE SCIPchgCardvalCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< pointer to hold the created constraint */
int cardval /**< number of variables allowed to be nonzero */
);
/** adds variable to cardinality constraint, the position is determined by the given weight */
SCIP_EXPORT
SCIP_RETCODE SCIPaddVarCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint */
SCIP_VAR* var, /**< variable to add to the constraint */
SCIP_VAR* indvar, /**< indicator variable to indicate whether variable may be treated as nonzero
* in cardinality constraint (or NULL if this variable should be created
* automatically) */
SCIP_Real weight /**< weight determining position of variable */
);
/** appends variable to cardinality constraint */
SCIP_EXPORT
SCIP_RETCODE SCIPappendVarCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint */
SCIP_VAR* var, /**< variable to add to the constraint */
SCIP_VAR* indvar /**< indicator variable to indicate whether variable may be treated as nonzero
* in cardinality constraint (or NULL if this variable should be created
* automatically) */
);
/** gets number of variables in cardinality constraint */
SCIP_EXPORT
int SCIPgetNVarsCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** gets array of variables in cardinality constraint */
SCIP_EXPORT
SCIP_VAR** SCIPgetVarsCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets cardinality value of cardinality constraint (i.e., right hand side of cardinality constraint) */
SCIP_EXPORT
int SCIPgetCardvalCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** gets array of weights in cardinality constraint (or NULL if not existent) */
SCIP_EXPORT
SCIP_Real* SCIPgetWeightsCardinality(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** @} */
/** @} */
#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 cons_components.h
* @brief constraint handler for handling independent components
* @author Gerald Gamrath
*
* This constraint handler looks for independent components.
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_COMPONENTS_H__
#define __SCIP_CONS_COMPONENTS_H__
#include "scip/def.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the components constraint handler and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrComponents(
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 cons_conjunction.h
* @ingroup CONSHDLRS
* @brief constraint handler for conjunction constraints
* @author Tobias Achterberg
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_CONJUNCTION_H__
#define __SCIP_CONS_CONJUNCTION_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for conjunction constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrConjunction(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Conjunction Constraints
*
* @{
*
* A conjunction constraint \f$ C \f$ is a constraint of the form
* \f[
* C = C_1 \wedge \dots \wedge C_n
* \f]
* where all the \f$ C_i \f$ are individual constraints themselves.
*/
/** creates and captures a conjunction constraint
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsConjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nconss, /**< number of initial constraints in conjunction */
SCIP_CONS** conss, /**< initial constraint in conjunction */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are separated as constraints. */
);
/** creates and captures an and constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsConjunction(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
*
* @see SCIPcreateConsConjunction() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicConjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nconss, /**< number of initial constraints in conjunction */
SCIP_CONS** conss /**< initial constraint in conjunction */
);
/** adds constraint to the conjunction of constraints */
SCIP_EXPORT
SCIP_RETCODE SCIPaddConsElemConjunction(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< conjunction constraint */
SCIP_CONS* addcons /**< additional constraint in conjunction */
);
/** @} */
/** @} */
#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 cons_countsols.h
* @ingroup CONSHDLRS
* @brief Constraint handler for counting feasible solutions
* @author Stefan Heinz
* @author Michael Winkler
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_COUNTSOLS_H__
#define __SCIP_CONS_COUNTSOLS_H__
#include "scip/def.h"
#include "scip/type_dialog.h"
#include "scip/type_misc.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the handler for countsol constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrCountsols(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Constraint Handler for counting solutions
*
* @{
*
* If this constraint handler is activated than it counts or collects all feasible solutions. We refer to \ref COUNTER for
* more details about using SCIP for counting feasible solutions.
*/
/** dialog execution method for the count command */
SCIP_EXPORT
SCIP_DECL_DIALOGEXEC(SCIPdialogExecCountPresolve);
/** dialog execution method for the count command */
SCIP_EXPORT
SCIP_DECL_DIALOGEXEC(SCIPdialogExecCount);
/** execution method of dialog for writing all solutions */
SCIP_EXPORT
SCIP_DECL_DIALOGEXEC(SCIPdialogExecWriteAllsolutions);
/** execute counting */
SCIP_EXPORT
SCIP_RETCODE SCIPcount(
SCIP* scip /**< SCIP data structure */
);
/** returns number of feasible solutions found as SCIP_Longint; if the number does not fit into
* a SCIP_Longint the valid flag is set to FALSE
*/
SCIP_EXPORT
SCIP_Longint SCIPgetNCountedSols(
SCIP* scip, /**< SCIP data structure */
SCIP_Bool* valid /**< pointer to store if the return value is valid */
);
/** returns number of counted solutions as string */
SCIP_EXPORT
void SCIPgetNCountedSolsstr(
SCIP* scip, /**< SCIP data structure */
char** buffer, /**< buffer to store the number for counted solutions */
int buffersize, /**< buffer size */
int* requiredsize /**< pointer to store the required size */
);
/** returns number of counted feasible subtrees */
SCIP_EXPORT
SCIP_Longint SCIPgetNCountedFeasSubtrees(
SCIP* scip /**< SCIP data structure */
);
/** Method to get the sparse solution.
*
* @note You get the pointer to the sparse solutions stored in the constraint handler (not a copy).
*
* @note The sparse solutions are stored w.r.t. the active variables. This are the variables which got not removed
* during presolving. For none active variables the value has to be computed depending on their aggregation
* type. See for more details about that \ref COLLECTALLFEASEBLES.
*/
SCIP_EXPORT
void SCIPgetCountedSparseSols(
SCIP* scip, /**< SCIP data structure */
SCIP_VAR*** vars, /**< pointer to variable array defining to variable order */
int* nvars, /**< number of variables */
SCIP_SPARSESOL*** sols, /**< pointer to the solutions */
int* nsols /**< pointer to number of solutions */
);
/** setting SCIP parameters for such that a valid counting process is possible */
SCIP_EXPORT
SCIP_RETCODE SCIPsetParamsCountsols(
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 cons_cumulative.h
* @ingroup CONSHDLRS
* @brief constraint handler for cumulative constraints
* @author Timo Berthold
* @author Stefan Heinz
* @author Jens Schulz
*
*/
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
#ifndef __SCIP_CONS_CUMULATIVE_H__
#define __SCIP_CONS_CUMULATIVE_H__
#include "scip/def.h"
#include "scip/type_cons.h"
#include "scip/type_lp.h"
#include "scip/type_misc.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_scip.h"
#include "scip/type_sol.h"
#include "scip/type_timing.h"
#include "scip/type_var.h"
#ifdef __cplusplus
extern "C" {
#endif
/** creates the constraint handler for cumulative constraints and includes it in SCIP
*
* @ingroup ConshdlrIncludes
* */
SCIP_EXPORT
SCIP_RETCODE SCIPincludeConshdlrCumulative(
SCIP* scip /**< SCIP data structure */
);
/**@addtogroup CONSHDLRS
*
* @{
*
* @name Cumulative Constraints
*
* Given:
* - a set of jobs, represented by their integer start time variables \f$S_j\f$, their array of processing times \f$p_j\f$ and of
* their demands \f$d_j\f$.
* - an integer resource capacity \f$C\f$
*
* The cumulative constraint ensures that for each point in time \f$t\f$ \f$\sum_{j: S_j \leq t < S_j + p_j} d_j \leq C\f$ holds.
*
* @par
* Separation:
* - can be done using binary start time model, see Pritskers, Watters and Wolfe
* - or by just separating relatively weak cuts on the start time variables
*
* @par
* Propagation:
* - time tabling, Klein & Scholl (1999)
* - Edge-finding from Petr Vilim, adjusted and simplified for dynamic repropagation
* (2009)
* - energetic reasoning, see Baptiste, Le Pape, Nuijten (2001)
*
* @{
*/
/** creates and captures a cumulative constraint */
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands, /**< array containing corresponding demands */
int capacity, /**< available cumulative capacity */
SCIP_Bool initial, /**< should the LP relaxation of constraint be in the initial LP?
* Usually set to TRUE. Set to FALSE for 'lazy constraints'. */
SCIP_Bool separate, /**< should the constraint be separated during LP processing?
* Usually set to TRUE. */
SCIP_Bool enforce, /**< should the constraint be enforced during node processing?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool check, /**< should the constraint be checked for feasibility?
* TRUE for model constraints, FALSE for additional, redundant constraints. */
SCIP_Bool propagate, /**< should the constraint be propagated during node processing?
* Usually set to TRUE. */
SCIP_Bool local, /**< is constraint only valid locally?
* Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. */
SCIP_Bool modifiable, /**< is constraint modifiable (subject to column generation)?
* Usually set to FALSE. In column generation applications, set to TRUE if pricing
* adds coefficients to this constraint. */
SCIP_Bool dynamic, /**< is constraint subject to aging?
* Usually set to FALSE. Set to TRUE for own cuts which
* are seperated as constraints. */
SCIP_Bool removable, /**< should the relaxation be removed from the LP due to aging or cleanup?
* Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'. */
SCIP_Bool stickingatnode /**< should the constraint always be kept at the node where it was added, even
* if it may be moved to a more global node?
* Usually set to FALSE. Set to TRUE to for constraints that represent node data. */
);
/** creates and captures an absolute power constraint
* in its most basic version, i. e., all constraint flags are set to their basic value as explained for the
* method SCIPcreateConsCumulative(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h
*
* @see SCIPcreateConsCumulative() for information about the basic constraint flag configuration
*
* @note the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateConsBasicCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS** cons, /**< pointer to hold the created constraint */
const char* name, /**< name of constraint */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands, /**< array containing corresponding demands */
int capacity /**< available cumulative capacity */
);
/** set the left bound of effective horizon */
SCIP_EXPORT
SCIP_RETCODE SCIPsetHminCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint data */
int hmin /**< left bound of time axis to be considered */
);
/** returns the left bound of the effective horizon */
SCIP_EXPORT
int SCIPgetHminCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** set the right bound of the effective horizon */
SCIP_EXPORT
SCIP_RETCODE SCIPsetHmaxCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons, /**< constraint data */
int hmax /**< right bound of time axis to be considered */
);
/** returns the right bound of effective horizon */
SCIP_EXPORT
int SCIPgetHmaxCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint */
);
/** returns the start time variables of the cumulative constraint */
SCIP_EXPORT
SCIP_VAR** SCIPgetVarsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** returns the number of start time variables of the cumulative constraint */
SCIP_EXPORT
int SCIPgetNVarsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** returns the capacity of the cumulative constraint */
SCIP_EXPORT
int SCIPgetCapacityCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** returns the durations of the cumulative constraint */
SCIP_EXPORT
int* SCIPgetDurationsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** returns the demands of the cumulative constraint */
SCIP_EXPORT
int* SCIPgetDemandsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< constraint data */
);
/** check for the given starting time variables with their demands and durations if the cumulative conditions for the
* given solution is satisfied
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcheckCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
SCIP_SOL* sol, /**< primal solution, or NULL for current LP/pseudo solution */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands, /**< array containing corresponding demands */
int capacity, /**< available cumulative capacity */
int hmin, /**< left bound of time axis to be considered */
int hmax, /**< right bound of time axis to be considered */
SCIP_Bool* violated, /**< pointer to store if the cumulative condition is violated */
SCIP_CONS* cons, /**< constraint which is checked */
SCIP_Bool printreason /**< should the reason for the violation be printed? */
);
/** normalize cumulative condition */
SCIP_EXPORT
SCIP_RETCODE SCIPnormalizeCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
int nvars, /**< number of start time variables (activities) */
SCIP_VAR** vars, /**< array of start time variables */
int* durations, /**< array of durations */
int* demands, /**< array of demands */
int* capacity, /**< pointer to store the changed cumulative capacity */
int* nchgcoefs, /**< pointer to count total number of changed coefficients */
int* nchgsides /**< pointer to count number of side changes */
);
/** searches for a time point within the cumulative condition were the cumulative condition can be split */
SCIP_EXPORT
SCIP_RETCODE SCIPsplitCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands, /**< array containing corresponding demands */
int capacity, /**< available cumulative capacity */
int* hmin, /**< pointer to store the left bound of the effective horizon */
int* hmax, /**< pointer to store the right bound of the effective horizon */
int* split /**< point were the cumulative condition can be split */
);
/** presolve cumulative condition w.r.t. effective horizon by detecting irrelevant variables */
SCIP_EXPORT
SCIP_RETCODE SCIPpresolveCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
int nvars, /**< number of start time variables (activities) */
SCIP_VAR** vars, /**< array of start time variables */
int* durations, /**< array of durations */
int hmin, /**< left bound of time axis to be considered */
int hmax, /**< right bound of time axis to be considered (not including hmax) */
SCIP_Bool* downlocks, /**< array storing if the variable has a down lock, or NULL */
SCIP_Bool* uplocks, /**< array storing if the variable has an up lock, or NULL */
SCIP_CONS* cons, /**< constraint which gets propagated, or NULL */
SCIP_Bool* delvars, /**< array storing the variable which can be deleted from the constraint */
int* nfixedvars, /**< pointer to store the number of fixed variables */
int* nchgsides, /**< pointer to store the number of changed sides */
SCIP_Bool* cutoff /**< buffer to store whether a cutoff is detected */
);
/** propagate the given cumulative condition */
SCIP_EXPORT
SCIP_RETCODE SCIPpropCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
SCIP_PRESOLTIMING presoltiming, /**< current presolving timing */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands, /**< array containing corresponding demands */
int capacity, /**< available cumulative capacity */
int hmin, /**< left bound of time axis to be considered */
int hmax, /**< right bound of time axis to be considered */
SCIP_CONS* cons, /**< constraint which gets propagated */
int* nchgbds, /**< pointer to store the number of variable bound changes */
SCIP_Bool* initialized, /**< was conflict analysis initialized */
SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
SCIP_Bool* cutoff /**< pointer to store if the cumulative condition is violated */
);
/** resolve propagation w.r.t. the cumulative condition */
SCIP_EXPORT
SCIP_RETCODE SCIPrespropCumulativeCondition(
SCIP* scip, /**< SCIP data structure */
int nvars, /**< number of start time variables (activities) */
SCIP_VAR** vars, /**< array of start time variables */
int* durations, /**< array of durations */
int* demands, /**< array of demands */
int capacity, /**< cumulative capacity */
int hmin, /**< left bound of time axis to be considered (including hmin) */
int hmax, /**< right bound of time axis to be considered (not including hmax) */
SCIP_VAR* infervar, /**< the conflict variable whose bound change has to be resolved */
int inferinfo, /**< the user information */
SCIP_BOUNDTYPE boundtype, /**< the type of the changed bound (lower or upper bound) */
SCIP_BDCHGIDX* bdchgidx, /**< the index of the bound change, representing the point of time where the change took place */
SCIP_Real relaxedbd, /**< the relaxed bound which is sufficient to be explained */
SCIP_Bool* explanation, /**< bool array which marks the variable which are part of the explanation if a cutoff was detected, or NULL */
SCIP_RESULT* result /**< pointer to store the result of the propagation conflict resolving call */
);
/** this method visualizes the cumulative structure in GML format */
SCIP_EXPORT
SCIP_RETCODE SCIPvisualizeConsCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_CONS* cons /**< cumulative constraint */
);
/** solves given cumulative condition as independent sub problem
*
* @note The time and memory limit should be respected.
*
* @note If the problem was solved to the earliest start times (ests) and latest start times (lsts) array contain the
* solution values; If the problem was not solved these two arrays contain the global bounds at the time the sub
* solver was interrupted.
*
* input:
* - njobs : number of jobs (activities)
* - objvals : array of objective coefficients for each job (linear objective function), or NULL if none
* - durations : array of durations
* - demands : array of demands
* - capacity : cumulative capacity
* - hmin : left bound of time axis to be considered (including hmin)
* - hmax : right bound of time axis to be considered (not including hmax)
* - timelimit : time limit for solving in seconds
* - memorylimit : memory limit for solving in mega bytes (MB)
* - maxnodes : maximum number of branch-and-bound nodes to solve the single cumulative constraint (-1: no limit)
*
* input/output:
* - ests : array of earliest start times for each job
* - lsts : array of latest start times for each job
*
* output:
* - solved : pointer to store if the problem is solved (to optimality)
* - infeasible : pointer to store if the problem is infeasible
* - unbounded : pointer to store if the problem is unbounded
* - error : pointer to store if an error occurred
*
*/
#define SCIP_DECL_SOLVECUMULATIVE(x) SCIP_RETCODE x (int njobs, SCIP_Real* ests, SCIP_Real* lsts, SCIP_Real* objvals, \
int* durations, int* demands, int capacity, int hmin, int hmax, \
SCIP_Real timelimit, SCIP_Real memorylimit, SCIP_Longint maxnodes, \
SCIP_Bool* solved, SCIP_Bool* infeasible, SCIP_Bool* unbounded, SCIP_Bool* error)
/** sets method to solve an individual cumulative condition */
SCIP_EXPORT
SCIP_RETCODE SCIPsetSolveCumulative(
SCIP* scip, /**< SCIP data structure */
SCIP_DECL_SOLVECUMULATIVE((*solveCumulative)) /**< method to use an individual cumulative condition */
);
/** solves given cumulative condition as independent sub problem
*
* @note If the problem was solved to the earliest start times (ests) and latest start times (lsts) array contain the
* solution values; If the problem was not solved these two arrays contain the global bounds at the time the sub
* solver was interrupted.
*/
SCIP_EXPORT
SCIP_RETCODE SCIPsolveCumulative(
SCIP* scip, /**< SCIP data structure */
int njobs, /**< number of jobs (activities) */
SCIP_Real* ests, /**< array with the earlier start time for each job */
SCIP_Real* lsts, /**< array with the latest start time for each job */
SCIP_Real* objvals, /**< array of objective coefficients for each job (linear objective function), or NULL if none */
int* durations, /**< array of durations */
int* demands, /**< array of demands */
int capacity, /**< cumulative capacity */
int hmin, /**< left bound of time axis to be considered (including hmin) */
int hmax, /**< right bound of time axis to be considered (not including hmax) */
SCIP_Real timelimit, /**< time limit for solving in seconds */
SCIP_Real memorylimit, /**< memory limit for solving in mega bytes (MB) */
SCIP_Longint maxnodes, /**< maximum number of branch-and-bound nodes to solve the single cumulative constraint (-1: no limit) */
SCIP_Bool* solved, /**< pointer to store if the problem is solved (to optimality) */
SCIP_Bool* infeasible, /**< pointer to store if the problem is infeasible */
SCIP_Bool* unbounded, /**< pointer to store if the problem is unbounded */
SCIP_Bool* error /**< pointer to store if an error occurred */
);
/** creates the worst case resource profile, that is, all jobs are inserted with the earliest start and latest
* completion time
*/
SCIP_EXPORT
SCIP_RETCODE SCIPcreateWorstCaseProfile(
SCIP* scip, /**< SCIP data structure */
SCIP_PROFILE* profile, /**< resource profile */
int nvars, /**< number of variables (jobs) */
SCIP_VAR** vars, /**< array of integer variable which corresponds to starting times for a job */
int* durations, /**< array containing corresponding durations */
int* demands /**< array containing corresponding demands */
);
/** computes w.r.t. the given worst case resource profile the first time point where the given capacity can be violated */
SCIP_EXPORT
int SCIPcomputeHmin(
SCIP* scip, /**< SCIP data structure */
SCIP_PROFILE* profile, /**< worst case resource profile */
int capacity /**< capacity to check */
);
/** computes w.r.t. the given worst case resource profile the first time point where the given capacity is satisfied for sure */
SCIP_EXPORT
int SCIPcomputeHmax(
SCIP* scip, /**< SCIP data structure */
SCIP_PROFILE* profile, /**< worst case profile */
int capacity /**< capacity to check */
);
/** @} */
/** @} */
#ifdef __cplusplus
}
#endif
#endif