LNS heuristic using a clique partition to restrict the search neighborhood.
clique primal heuristic
More details about the heuristic can be found in
Structure-Based Primal Heuristics for Mixed Integer Programming
Gerald Gamrath, Timo Berthold, Stefan Heinz, and Michael Winkler
Optimization in the Real World, Volume 13 of the series Mathematics for Industry, pp 37-53
Preliminary version available as ZIB-Report 15-26.
Definition in file heur_clique.c.
#include <assert.h>
#include <string.h>
#include "scip/scip.h"
#include "scip/heur_clique.h"
#include "scip/cons_logicor.h"
#include "scip/pub_misc.h"
Go to the source code of this file.
Macros | |
#define | HEUR_NAME "clique" |
#define | HEUR_DESC "LNS heuristic using a clique partition to restrict the search neighborhood" |
#define | HEUR_DISPCHAR 'Q' |
#define | HEUR_PRIORITY -1000500 |
#define | HEUR_FREQ -1 |
#define | HEUR_FREQOFS 0 |
#define | HEUR_MAXDEPTH -1 |
#define | HEUR_TIMING SCIP_HEURTIMING_BEFORENODE |
#define | HEUR_USESSUBSCIP TRUE |
#define | DEFAULT_MAXNODES 5000LL |
#define | DEFAULT_MINFIXINGRATE 0.25 |
#define | DEFAULT_MINIMPROVE 0.01 |
#define | DEFAULT_MINNODES 500LL |
#define | DEFAULT_NODESOFS 500LL |
#define | DEFAULT_NODESQUOT 0.1 |
#define | DEFAULT_MAXPROPROUNDS 2 |
#define | DEFAULT_RANDSEED 61 |
#define | DEFAULT_MULTIPLIER 1.1 |
#define | DEFAULT_COPYCUTS TRUE |
Functions | |
static | SCIP_DECL_SORTPTRCOMP (varObjSort) |
static SCIP_RETCODE | stableSortBinvars (SCIP *scip, SCIP_VAR **binvars, int nbinvars, int *cliquepartition, int ncliques) |
static SCIP_RETCODE | applyCliqueFixings (SCIP *scip, SCIP_HEURDATA *heurdata, SCIP_VAR **binvars, int nbinvars, int *cliquepartition, int ncliques, SCIP_VAR **onefixvars, int *nonefixvars, SCIP_SOL *sol, int *probingdepthofonefix, SCIP_Bool *cutoff, SCIP_RESULT *result) |
static SCIP_RETCODE | createNewSol (SCIP *scip, SCIP *subscip, SCIP_VAR **subvars, SCIP_SOL *newsol, SCIP_SOL *subsol, SCIP_Bool *success) |
static | SCIP_DECL_HEURCOPY (heurCopyClique) |
static | SCIP_DECL_HEURFREE (heurFreeClique) |
static | SCIP_DECL_HEURINIT (heurInitClique) |
static | SCIP_DECL_HEUREXIT (heurExitClique) |
static | SCIP_DECL_HEUREXEC (heurExecClique) |
SCIP_RETCODE | SCIPincludeHeurClique (SCIP *scip) |
#define HEUR_NAME "clique" |
Definition at line 43 of file heur_clique.c.
Referenced by createNewSol().
#define HEUR_DESC "LNS heuristic using a clique partition to restrict the search neighborhood" |
Definition at line 44 of file heur_clique.c.
#define HEUR_DISPCHAR 'Q' |
Definition at line 45 of file heur_clique.c.
#define HEUR_PRIORITY -1000500 |
Definition at line 46 of file heur_clique.c.
#define HEUR_FREQ -1 |
Definition at line 47 of file heur_clique.c.
#define HEUR_FREQOFS 0 |
Definition at line 48 of file heur_clique.c.
#define HEUR_MAXDEPTH -1 |
Definition at line 49 of file heur_clique.c.
#define HEUR_TIMING SCIP_HEURTIMING_BEFORENODE |
Definition at line 50 of file heur_clique.c.
#define HEUR_USESSUBSCIP TRUE |
does the heuristic use a secondary SCIP instance?
Definition at line 51 of file heur_clique.c.
#define DEFAULT_MAXNODES 5000LL |
maximum number of nodes to regard in the subproblem
Definition at line 53 of file heur_clique.c.
#define DEFAULT_MINFIXINGRATE 0.25 |
minimum percentage of variables that have to be fixed
Definition at line 54 of file heur_clique.c.
#define DEFAULT_MINIMPROVE 0.01 |
factor by which clique heuristic should at least improve the incumbent
Definition at line 55 of file heur_clique.c.
#define DEFAULT_MINNODES 500LL |
minimum number of nodes to regard in the subproblem
Definition at line 60 of file heur_clique.c.
#define DEFAULT_NODESOFS 500LL |
number of nodes added to the contingent of the total nodes
Definition at line 61 of file heur_clique.c.
#define DEFAULT_NODESQUOT 0.1 |
subproblem nodes in relation to nodes of the original problem
Definition at line 62 of file heur_clique.c.
#define DEFAULT_MAXPROPROUNDS 2 |
maximum number of propagation rounds during probing
Definition at line 63 of file heur_clique.c.
#define DEFAULT_RANDSEED 61 |
random seed value to initialize the random permutation value for variables
Definition at line 64 of file heur_clique.c.
#define DEFAULT_MULTIPLIER 1.1 |
value to increase node number to determine the next run
Definition at line 69 of file heur_clique.c.
#define DEFAULT_COPYCUTS TRUE |
should all active cuts from the cutpool of the original scip be copied to constraints of the subscip
Definition at line 70 of file heur_clique.c.
|
static |
comparison method for sorting variables by non-decreasing index
Definition at line 107 of file heur_clique.c.
|
static |
sort the binary variable array w.r.t. the clique partition; thereby ensure the current order within the cliques are not changed
scip | SCIP data structure |
binvars | array of binary variables to sort |
nbinvars | number of binary variables |
cliquepartition | clique partition to use |
ncliques | number of cliques |
Definition at line 130 of file heur_clique.c.
References applyCliqueFixings(), BMSclearMemoryArray, BMScopyMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPfreeBufferArray, and SCIPvarGetObj().
|
static |
apply clique fixing using probing
scip | original SCIP data structure |
heurdata | structure containing heurdata |
binvars | binary variables order w.r.t. to clique partition |
nbinvars | number of binary variables |
cliquepartition | clique partition of all binary variables |
ncliques | number of cliques |
onefixvars | array to store all variables which are stored to one |
nonefixvars | pointer to store the number of variables fixed to one |
sol | working solution |
probingdepthofonefix | pointer to store in which depth the last fixing to was applied |
cutoff | pointer to store whether the propagation stopped with infeasibility |
result | pointer to store the result (solution found) |
Definition at line 232 of file heur_clique.c.
References createNewSol(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_FOUNDSOL, SCIP_MAXTREEDEPTH, SCIP_OKAY, SCIPdebugMsg, SCIPfixVarProbing(), SCIPgetDepth(), SCIPgetProbingDepth(), SCIPgetSolOrigObj(), SCIPisStopped(), SCIPlinkCurrentSol(), SCIPnewProbingNode(), SCIPpropagateProbing(), SCIProundSol(), SCIPtrySol(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), and TRUE.
Referenced by stableSortBinvars().
|
static |
creates a new solution for the original problem by copying the solution of the subproblem
scip | original SCIP data structure |
subscip | SCIP structure of the subproblem |
subvars | the variables of the subproblem |
newsol | working solution |
subsol | solution of the subproblem |
success | used to store whether new solution was found or not |
Definition at line 397 of file heur_clique.c.
References FALSE, HEUR_NAME, NULL, SCIP_CALL, SCIP_DECL_HEURCOPY(), SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetNOrigVars(), SCIPgetSolVals(), SCIPgetVarsData(), SCIPheurGetName(), SCIPsetSolVals(), SCIPtrySol(), and TRUE.
Referenced by applyCliqueFixings().
|
static |
copy method for primal heuristic plugins (called when SCIP copies plugins)
Definition at line 445 of file heur_clique.c.
Referenced by createNewSol().
|
static |
destructor of primal heuristic to free user data (called when SCIP is exiting)
Definition at line 459 of file heur_clique.c.
|
static |
initialization method of primal heuristic (called after problem was transformed)
Definition at line 480 of file heur_clique.c.
|
static |
deinitialization method of primal heuristic
Definition at line 504 of file heur_clique.c.
|
static |
execution method of primal heuristic
Definition at line 525 of file heur_clique.c.