Detailed Description
handle partial solutions for linear problems with indicators and otherwise continuous variables
For linear problems with indicators and otherwise continuous variables, the indicator constraint handler can produce partial solutions, i.e., values for the indicator variables. This partial solution can be passed to this heuristic, which then fixes these values and solves an LP. Additionally a local search for a better solution is added.
Definition in file heur_indicator.c.
#include "blockmemshell/memory.h"
#include "scip/cons_indicator.h"
#include "scip/heur_indicator.h"
#include "scip/pub_cons.h"
#include "scip/pub_heur.h"
#include "scip/pub_message.h"
#include "scip/pub_sol.h"
#include "scip/pub_var.h"
#include "scip/scip_cons.h"
#include "scip/scip_copy.h"
#include "scip/scip_general.h"
#include "scip/scip_heur.h"
#include "scip/scip_lp.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_probing.h"
#include "scip/scip_sol.h"
#include "scip/scip_tree.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | HEUR_NAME "indicator" |
#define | HEUR_DESC "indicator heuristic to create feasible solutions from values for indicator variables" |
#define | HEUR_DISPCHAR SCIP_HEURDISPCHAR_LNS |
#define | HEUR_PRIORITY -20200 |
#define | HEUR_FREQ 1 |
#define | HEUR_FREQOFS 0 |
#define | HEUR_MAXDEPTH -1 |
#define | HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP |
#define | HEUR_USESSUBSCIP FALSE |
#define | DEFAULT_ONEOPT FALSE |
#define | DEFAULT_IMPROVESOLS FALSE |
Functions | |
static SCIP_RETCODE | tryOneOpt (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand, int *nfoundsols) |
static SCIP_RETCODE | trySolCandidate (SCIP *scip, SCIP_HEUR *heur, SCIP_HEURDATA *heurdata, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand, int *nfoundsols) |
static | SCIP_DECL_HEURCOPY (heurCopyIndicator) |
static | SCIP_DECL_HEURINIT (heurInitIndicator) |
static | SCIP_DECL_HEURFREE (heurFreeIndicator) |
static | SCIP_DECL_HEUREXEC (heurExecIndicator) |
SCIP_RETCODE | SCIPincludeHeurIndicator (SCIP *scip) |
SCIP_RETCODE | SCIPheurPassIndicator (SCIP *scip, SCIP_HEUR *heur, int nindconss, SCIP_CONS **indconss, SCIP_Bool *solcand, SCIP_Real obj) |
Macro Definition Documentation
◆ HEUR_NAME
#define HEUR_NAME "indicator" |
Definition at line 60 of file heur_indicator.c.
Referenced by SCIP_DECL_HEURCOPY(), SCIPheurPassIndicator(), and SCIPincludeHeurIndicator().
◆ HEUR_DESC
#define HEUR_DESC "indicator heuristic to create feasible solutions from values for indicator variables" |
Definition at line 61 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_DISPCHAR
#define HEUR_DISPCHAR SCIP_HEURDISPCHAR_LNS |
Definition at line 62 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_PRIORITY
#define HEUR_PRIORITY -20200 |
Definition at line 63 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_FREQ
#define HEUR_FREQ 1 |
Definition at line 64 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_FREQOFS
#define HEUR_FREQOFS 0 |
Definition at line 65 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_MAXDEPTH
#define HEUR_MAXDEPTH -1 |
Definition at line 66 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_TIMING
#define HEUR_TIMING SCIP_HEURTIMING_DURINGLPLOOP |
Definition at line 67 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ HEUR_USESSUBSCIP
#define HEUR_USESSUBSCIP FALSE |
does the heuristic use a secondary SCIP instance?
Definition at line 68 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ DEFAULT_ONEOPT
#define DEFAULT_ONEOPT FALSE |
whether the one-opt heuristic should be started
Definition at line 70 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
◆ DEFAULT_IMPROVESOLS
#define DEFAULT_IMPROVESOLS FALSE |
Try to improve other solutions by one-opt?
Definition at line 71 of file heur_indicator.c.
Referenced by SCIPincludeHeurIndicator().
Function Documentation
◆ tryOneOpt()
|
static |
try one-opt on given solution
- Parameters
-
scip SCIP data structure heur indicator heuristic heurdata heuristic data nindconss number of indicator constraints indconss indicator constraints solcand values for indicator variables in partial solution nfoundsols number of solutions found
Definition at line 93 of file heur_indicator.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXTREEDEPTH, SCIP_OKAY, SCIPbacktrackProbing(), SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), SCIPconsIsActive(), SCIPcreateSol(), SCIPdebugMsg, SCIPendProbing(), SCIPgetBinaryVarIndicator(), SCIPgetDepth(), SCIPgetLPSolstat(), SCIPgetSolTransObj(), SCIPisStopped(), SCIPlinkLPSol(), SCIPnewProbingNode(), SCIPpropagateProbing(), SCIPsolveProbingLP(), SCIPstartProbing(), SCIPtrySolFree(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), and TRUE.
Referenced by SCIP_DECL_HEUREXEC(), and trySolCandidate().
◆ trySolCandidate()
|
static |
try given solution
- Parameters
-
scip SCIP data structure heur indicator heuristic heurdata heuristic data nindconss number of indicator constraints indconss indicator constraints solcand values for indicator variables in partial solution nfoundsols number of solutions found
Definition at line 230 of file heur_indicator.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_LPSOLSTAT_OPTIMAL, SCIP_MAXTREEDEPTH, SCIP_OKAY, SCIPchgVarLbProbing(), SCIPchgVarUbProbing(), SCIPconsIsActive(), SCIPcreateSol(), SCIPdebugMsg, SCIPendProbing(), SCIPgetBinaryVarIndicator(), SCIPgetDepth(), SCIPgetLPSolstat(), SCIPgetSolTransObj(), SCIPlinkLPSol(), SCIPnewProbingNode(), SCIPprintSol(), SCIPpropagateProbing(), SCIPsolveProbingLP(), SCIPstartProbing(), SCIPtrySolFree(), SCIPvarGetLbLocal(), SCIPvarGetUbLocal(), TRUE, and tryOneOpt().
Referenced by SCIP_DECL_HEUREXEC().
◆ SCIP_DECL_HEURCOPY()
|
static |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 372 of file heur_indicator.c.
References HEUR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPheurGetName(), and SCIPincludeHeurIndicator().
◆ SCIP_DECL_HEURINIT()
|
static |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 386 of file heur_indicator.c.
References NULL, SCIP_OKAY, SCIPfindConshdlr(), SCIPheurGetData(), and SCIPwarningMessage().
◆ SCIP_DECL_HEURFREE()
|
static |
destructor of primal heuristic to free user data (called when SCIP is exiting)
Definition at line 411 of file heur_indicator.c.
References NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPheurGetData(), and SCIPheurSetData().
◆ SCIP_DECL_HEUREXEC()
|
static |
execution method of primal heuristic
Definition at line 435 of file heur_indicator.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_FOUNDSOL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconshdlrGetConss(), SCIPconshdlrGetNConss(), SCIPconsIsActive(), SCIPdebugMsg, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPgetBestSol(), SCIPgetBinaryVarIndicator(), SCIPgetNBinVars(), SCIPgetNIntVars(), SCIPgetSolOrigObj(), SCIPgetSolVal(), SCIPgetSubscipDepth(), SCIPheurGetData(), SCIPisFeasIntegral(), SCIPsolGetHeur(), TRUE, tryOneOpt(), and trySolCandidate().