Detailed Description
heuristic solver for pricing problems that solves independent set problems with cliquer
Definition in file solver_cliquer.c.
#include <assert.h>#include "gcg/solver_cliquer.h"#include "scip/cons_linear.h"#include "scip/cons_varbound.h"#include "gcg/pub_solver.h"#include "gcg/pricer_gcg.h"#include "gcg/relax_gcg.h"#include "gcg/pub_gcgcol.h"#include "gcg/pub_gcgvar.h"#include "gcg/gcg.h"#include "gcg/scip_misc.h"#include "cliquer/cliquer.h"Go to the source code of this file.
Data Structures | |
| struct | GCG_SolverData |
Macros | |
| #define | SOLVER_NAME "cliquer" |
| #define | SOLVER_DESC "heuristic solver for pricing problems that solves independent set problems with cliquer" |
| #define | SOLVER_PRIORITY 150 |
| #define | SOLVER_HEURENABLED TRUE |
| #define | SOLVER_EXACTENABLED FALSE |
| #define | DEFAULT_MAXNODES 200 |
| #define | DEFAULT_MAXDENSITY 1.0 |
| #define | DEFAULT_SKIPCHECKSNODELIMIT 75 |
| #define | DEFAULT_USELINCUTOFF TRUE |
| #define | DEFAULT_SLOPE -1980 |
| #define | DEFAULT_INTERCEPT 2000 |
| #define | DEFAULT_OBJCOEFDISTR 0 |
| #define | DEFAULT_USEMULTIPL FALSE |
| #define | DEFAULT_MAXCLIQUECONSPERC 0.5 |
| #define | solverInitCliquer NULL |
| #define | solverExitCliquer NULL |
| #define | solverUpdateCliquer NULL |
| #define | solverSolveCliquer NULL |
Typedefs | |
| typedef enum cliquerConsType | CLIQUER_CONSTYPE |
Enumerations | |
| enum | cliquerConsType { LINEAR_IS , LINEAR_IS_LIKE , LINEAR_CLIQUE , LINEAR_COUPLING_DECORATIVE , LINEAR_COUPLING_CLIQUE , VARBND_SAME , VARBND_STD , VARBND_IS } |
Functions | |
| static INLINE SCIP_Bool | isVarLinked (SCIP_VAR **linkedvars, int nlinkedvars, SCIP_VAR *var) |
| static SCIP_Bool | areVarsLinkedRec (int **linkmatrix, int vindex1, int vindex2, int *vartrace, int *traceindex, SCIP_VAR **linkedvars, int nlinkedvars) |
| static SCIP_Bool | areVarsLinked (SCIP *scip, int **linkmatrix, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_VAR **linkedvars, int nlinkedvars) |
| static void | updateVarLinks (SCIP *scip, int **linkmatrix, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_VAR **linkedvars, int *nlinkedvars) |
| static INLINE int | getNodeIndex (SCIP_VAR *var, SCIP_VAR **vararray, int indexcount) |
| static int | getLinkedNodeIndex (SCIP *scip, SCIP_VAR *var, SCIP_VAR **indsetvars, int indexcount, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars) |
| static INLINE int | countReachableVars (SCIP *scip, int **linkmatrix, SCIP_VAR *var, SCIP_VAR **linkedvars, int nlinkedvars) |
| static INLINE SCIP_VAR * | getLinkedNodeVar (SCIP *scip, SCIP_VAR *var, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars) |
| static INLINE int | getNodeIndexCouplDigraph (SCIP *scip, SCIP_VAR *var, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_VAR **varsincouplings, int nvarsincouplings) |
| static void | aggregateObjCoef (SCIP *scip, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_Real *aggrobjcoef) |
| static INLINE SCIP_Real | getAggrObjCoef (SCIP_VAR *var, int nlinkedvars, int nvarsincouplings, SCIP_Real *aggrobjcoef) |
| static INLINE void | setAggrObjCoef (SCIP *scip, SCIP_VAR *var, SCIP_Real value, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef) |
| static int | addVarToGraph (SCIP *scip, graph_t *g, SCIP_VAR *consvar, int *indexcount, SCIP_Real scalingfactor, SCIP_VAR **indsetvars, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, int nvarsincouplings, SCIP_Real *aggrobjcoef) |
| static void | setLinkedSolvals (SCIP *scip, SCIP_Real *solvals, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_VAR *var, SCIP_Real val) |
| static SCIP_Bool | areObjectivesIntegral (SCIP *scip, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_VAR **varsincouplings, int nvarsincouplings, SCIP_Real *aggrobjcoef) |
| static SCIP_Real | scaleRelativeToMax (SCIP *scip, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_VAR **varsincouplings, int nvarsincouplings, SCIP_Real *aggrobjcoef) |
| static void | setProblemNotApplicable (GCG *gcg, int probnr, SCIP_Bool *isnotapplicable) |
| static INLINE int | assureInCouplingGraph (SCIP *scip, SCIP_VAR **varsincouplings, int *nvarsincouplings, SCIP_VAR *var, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix) |
| static INLINE void | updateCouplingDiGraph (SCIP *scip, SCIP_VAR **consvars, int nconsvars, SCIP_VAR *var, int **couplingmatrix, SCIP_VAR **varsincouplings, int *nvarsincouplings, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix) |
| static SCIP_Bool | isCouplingRelevantRec (SCIP *scip, int varind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int nlinkedvars, SCIP_Real *aggrobjcoef, int maxdepth) |
| static INLINE SCIP_Bool | isCouplingRelevant (SCIP *scip, int varind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int nlinkedvars, SCIP_Real *aggrobjcoef) |
| static INLINE SCIP_Bool | isCouplingRelevantVar (SCIP *scip, SCIP_VAR *var, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, SCIP_Real *aggrobjcoef) |
| static INLINE SCIP_Bool | hasSuccessorRel (SCIP *scip, int varind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int nlinkedvars, SCIP_Real *aggrobjcoef) |
| static INLINE int | getNSuccessorsRelevant (SCIP *scip, int varind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int nlinkedvars, SCIP_Real *aggrobjcoef, int *varmultiplicities, SCIP_Bool usemultiplicities) |
| static INLINE void | initVarMultiplicities (SCIP *scip, int **linkmatrix, SCIP_VAR **linkedvars, int nlinkedvars, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int *varmultiplicities) |
| static INLINE void | objCoefDistrHeurNatural (SCIP *scip, int actvarind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int *varmultiplicities, SCIP_Bool usemultipl, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef, SCIP_CONS **constraints, int nconss, int *couplingcoefindices, CLIQUER_CONSTYPE *cliquerconstypes) |
| static INLINE void | objCoefDistrHeurIS (SCIP *scip, int actvarind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int *varmultiplicities, SCIP_Bool usemultipl, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef, SCIP_CONS **constraints, int nconss, int *couplingcoefindices, CLIQUER_CONSTYPE *cliquerconstypes) |
| static INLINE void | objCoefDistrHeurUniform (SCIP *scip, int actvarind, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int *varmultiplicities, SCIP_Bool usemultipl, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef) |
| static void | distributeObjCoefRec (SCIP *scip, int actvarind, SCIP_Bool *isdistributed, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, int *varmultiplicities, SCIP_Bool usemultipl, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef, SCIP_CONS **constraints, int nconss, int *couplingcoefindices, CLIQUER_CONSTYPE *cliquerconstypes, int selecteddistrheur) |
| static void | distributeObjCoef (SCIP *scip, SCIP_CONS **constraints, int nconss, int *couplingcoefindices, CLIQUER_CONSTYPE *cliquerconstypes, int **couplingmatrix, SCIP_VAR **varsincouplings, int nvarsincouplings, SCIP_VAR **linkedvars, int nlinkedvars, int **linkmatrix, SCIP_Real *aggrobjcoef, int selecteddistrheur, SCIP_Bool usemultipl) |
| static SCIP_Bool | determineCliquerConsTypes (SCIP *pricingprob, SCIP_CONS **constraints, SCIP_VAR **linkedvars, SCIP_VAR **vconsvars, int *markedconsindices, int **linkmatrix, int *couplingcoefindices, int *nlinkedvars, int nconss, int *markedcount, CLIQUER_CONSTYPE *cliquerconstypes) |
| static SCIP_Bool | propagateVariablefixings (SCIP *pricingprob, SCIP_CONS **constraints, SCIP_VAR **linkedvars, SCIP_VAR **vconsvars, SCIP_VAR **varsincouplings, SCIP_Real *solvals, int **couplingmatrix, int **linkmatrix, int *nvarsincouplings, int *couplingcoefindices, int *consvarsfixedcount, int nlinkedvars, int nconss, int *nfixedvars, CLIQUER_CONSTYPE *cliquerconstypes) |
| static SCIP_RETCODE | solveCliquer (SCIP_Bool exactly, GCG *gcg, SCIP *pricingprob, GCG_SOLVERDATA *solver, int probnr, SCIP_Real *lowerbound, GCG_PRICINGSTATUS *status) |
| static | GCG_DECL_SOLVERFREE (solverFreeCliquer) |
| static | GCG_DECL_SOLVERINITSOL (solverInitsolCliquer) |
| static | GCG_DECL_SOLVEREXITSOL (solverExitsolCliquer) |
| static | GCG_DECL_SOLVERSOLVEHEUR (solverSolveHeurCliquer) |
| SCIP_RETCODE | GCGincludeSolverCliquer (GCG *gcg) |
Macro Definition Documentation
◆ SOLVER_NAME
| #define SOLVER_NAME "cliquer" |
Definition at line 55 of file solver_cliquer.c.
◆ SOLVER_DESC
| #define SOLVER_DESC "heuristic solver for pricing problems that solves independent set problems with cliquer" |
Definition at line 56 of file solver_cliquer.c.
◆ SOLVER_PRIORITY
| #define SOLVER_PRIORITY 150 |
Definition at line 57 of file solver_cliquer.c.
◆ SOLVER_HEURENABLED
| #define SOLVER_HEURENABLED TRUE |
indicates whether the solver should be enabled
Definition at line 59 of file solver_cliquer.c.
◆ SOLVER_EXACTENABLED
| #define SOLVER_EXACTENABLED FALSE |
indicates whether the solver should be enabled
Definition at line 60 of file solver_cliquer.c.
◆ DEFAULT_MAXNODES
| #define DEFAULT_MAXNODES 200 |
Definition at line 62 of file solver_cliquer.c.
◆ DEFAULT_MAXDENSITY
| #define DEFAULT_MAXDENSITY 1.0 |
Definition at line 63 of file solver_cliquer.c.
◆ DEFAULT_SKIPCHECKSNODELIMIT
| #define DEFAULT_SKIPCHECKSNODELIMIT 75 |
Definition at line 64 of file solver_cliquer.c.
◆ DEFAULT_USELINCUTOFF
| #define DEFAULT_USELINCUTOFF TRUE |
Definition at line 65 of file solver_cliquer.c.
◆ DEFAULT_SLOPE
| #define DEFAULT_SLOPE -1980 |
Definition at line 66 of file solver_cliquer.c.
◆ DEFAULT_INTERCEPT
| #define DEFAULT_INTERCEPT 2000 |
Definition at line 67 of file solver_cliquer.c.
◆ DEFAULT_OBJCOEFDISTR
| #define DEFAULT_OBJCOEFDISTR 0 |
Definition at line 68 of file solver_cliquer.c.
◆ DEFAULT_USEMULTIPL
| #define DEFAULT_USEMULTIPL FALSE |
Definition at line 69 of file solver_cliquer.c.
◆ DEFAULT_MAXCLIQUECONSPERC
| #define DEFAULT_MAXCLIQUECONSPERC 0.5 |
Definition at line 70 of file solver_cliquer.c.
◆ solverInitCliquer
| #define solverInitCliquer NULL |
Definition at line 2803 of file solver_cliquer.c.
◆ solverExitCliquer
| #define solverExitCliquer NULL |
Definition at line 2804 of file solver_cliquer.c.
◆ solverUpdateCliquer
| #define solverUpdateCliquer NULL |
Definition at line 2805 of file solver_cliquer.c.
◆ solverSolveCliquer
| #define solverSolveCliquer NULL |
Definition at line 2806 of file solver_cliquer.c.
Typedef Documentation
◆ CLIQUER_CONSTYPE
| typedef enum cliquerConsType CLIQUER_CONSTYPE |
Definition at line 88 of file solver_cliquer.c.
Enumeration Type Documentation
◆ cliquerConsType
| enum cliquerConsType |
| Enumerator | |
|---|---|
| LINEAR_IS | |
| LINEAR_IS_LIKE | |
| LINEAR_CLIQUE | |
| LINEAR_COUPLING_DECORATIVE | |
| LINEAR_COUPLING_CLIQUE | |
| VARBND_SAME | |
| VARBND_STD | |
| VARBND_IS | |
Definition at line 77 of file solver_cliquer.c.
Function Documentation
◆ isVarLinked()
|
static |
Returns whether the given var is linked in some way with other variables
- Parameters
-
linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array var Variable whose membership in the linkedvars array is to be checked
Definition at line 111 of file solver_cliquer.c.
References FALSE, SCIP_Bool, and TRUE.
Referenced by addVarToGraph(), assureInCouplingGraph(), getLinkedNodeIndex(), getNodeIndexCouplDigraph(), initVarMultiplicities(), and setAggrObjCoef().
◆ areVarsLinkedRec()
|
static |
Returns whether 2 variables are linked, either simply or in a transitive way in respect to a given linkmatrix matrix. Use of the wrapper function areVarsLinked(..) is recommended
- Parameters
-
linkmatrix Matrix indicating which variables are linked by a node vindex1 Problem index of the first variable in the pair that is to be checked vindex2 Problem index of the second variable in the pair that is to be checked vartrace Array to keep track of which nodes have already been visited during recursion traceindex Pointer to index to keep track of the number of visited nodes during recursion linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array
Definition at line 133 of file solver_cliquer.c.
References areVarsLinkedRec(), FALSE, SCIP_Bool, SCIPvarGetProbindex(), and TRUE.
Referenced by areVarsLinked(), and areVarsLinkedRec().
◆ areVarsLinked()
|
static |
Wrapper function for areVarsLinkedRec, mallocs and cleans up the necessary memory and passes through the result
- Parameters
-
scip The problem instance linkmatrix Matrix indicating which variables are linked by a node var1 The first variable in the pair that is to be checked var2 The second variable in the pair that is to be checked linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array
Definition at line 184 of file solver_cliquer.c.
References areVarsLinkedRec(), SCIP_Bool, SCIP_CALL_ABORT, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPvarGetProbindex(), and TRUE.
Referenced by aggregateObjCoef(), getLinkedNodeIndex(), getLinkedNodeVar(), propagateVariablefixings(), setAggrObjCoef(), setLinkedSolvals(), and updateVarLinks().
◆ updateVarLinks()
|
static |
Update transitivity in the linkmatrix matrix between 2 variables that are to be linked and all linked variables
- Parameters
-
scip The Problem instance linkmatrix Matrix indicating which variables are linked by a node var1 The first variable in the pair that is to be checked var2 The second variable in the pair that is to be checked linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array
Definition at line 226 of file solver_cliquer.c.
References areVarsLinked(), FALSE, SCIP_Bool, SCIPvarGetProbindex(), and TRUE.
Referenced by determineCliquerConsTypes().
◆ getNodeIndex()
Get the node index of a given variable in a given array (for graph), else return -1
- Parameters
-
var Variable for which the node index is to be determined vararray Array of variables that are mapped to a node of the graph indexcount Number of variables that are mapped in the graph
Definition at line 299 of file solver_cliquer.c.
Referenced by addVarToGraph(), countReachableVars(), getLinkedNodeIndex(), and getNodeIndexCouplDigraph().
◆ getLinkedNodeIndex()
|
static |
Returns the node index of a given variable in the bijection or that of a linked variable, if any.
- Parameters
-
scip The problem instance var Variable for which the node index is to be determined indsetvars Array of variables that are mapped to a node of the graph indexcount Number of variables that are mapped in the graph linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array
Definition at line 317 of file solver_cliquer.c.
References areVarsLinked(), getNodeIndex(), and isVarLinked().
Referenced by addVarToGraph(), and solveCliquer().
◆ countReachableVars()
|
static |
Computes the number of reachable nodes from a given variable
- Parameters
-
scip The problem instance linkmatrix Matrix indicating which variables are linked var The starting variable linkedvars Array of variables that are linked by eq-constraints nlinkedvars Number of linked variables
Definition at line 357 of file solver_cliquer.c.
References getNodeIndex(), SCIP_Bool, SCIP_CALL_ABORT, SCIPallocBufferArray, SCIPallocCleanBufferArray, SCIPfreeBufferArray, SCIPvarGetProbindex(), and TRUE.
Referenced by initVarMultiplicities().
◆ getLinkedNodeVar()
|
static |
Returns a representative variable for a given variable in the linked variable-bijection, if any, else NULL.
- Parameters
-
scip The problem instance var Variable for which the node index is to be determined linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array
Definition at line 410 of file solver_cliquer.c.
References areVarsLinked(), and NULL.
Referenced by assureInCouplingGraph(), and getNodeIndexCouplDigraph().
◆ getNodeIndexCouplDigraph()
|
static |
Returns the index of the representative variable for a given variable in the linked variable-bijection, if any.
- Parameters
-
scip The problem instance var Variable for which the node index is to be determined linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array
Definition at line 430 of file solver_cliquer.c.
References getLinkedNodeVar(), getNodeIndex(), isVarLinked(), and NULL.
Referenced by isCouplingRelevantVar(), objCoefDistrHeurIS(), and objCoefDistrHeurNatural().
◆ aggregateObjCoef()
|
static |
Aggregates objective coefficients for linked variables in the aggrobjcoef array.
- Parameters
-
scip The problem instance linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 448 of file solver_cliquer.c.
References areVarsLinked(), SCIP_CALL_ABORT, SCIP_Real, SCIPallocClearBufferArray, SCIPfreeBufferArray, SCIPvarGetObj(), and SCIPvarGetProbindex().
Referenced by solveCliquer().
◆ getAggrObjCoef()
|
static |
Returns the aggregated objective coefficient.
- Parameters
-
var The variable for which the aggr. obj. coef. should be returned nlinkedvars Index of linkedvars array nvarsincouplings Index of varsincouplings array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 495 of file solver_cliquer.c.
References SCIP_Real, SCIPvarGetObj(), and SCIPvarGetProbindex().
Referenced by addVarToGraph(), areObjectivesIntegral(), distributeObjCoefRec(), isCouplingRelevantRec(), objCoefDistrHeurIS(), objCoefDistrHeurNatural(), objCoefDistrHeurUniform(), scaleRelativeToMax(), and solveCliquer().
◆ setAggrObjCoef()
|
static |
Set (/update) aggregated objective coefficients savely.
- Parameters
-
scip The problem instance var The variable for which the aggr. obj. coef. should be updated value Value to set for given var (and linked vars) linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by a node aggrobjcoef Array of aggregated objective coefficients.
Definition at line 509 of file solver_cliquer.c.
References areVarsLinked(), isVarLinked(), and SCIPvarGetProbindex().
Referenced by objCoefDistrHeurIS(), objCoefDistrHeurNatural(), and objCoefDistrHeurUniform().
◆ addVarToGraph()
|
static |
Add a variable to the bijection graph g and indsetvars array. Returns the index of the corresponding node in the graph.
- Parameters
-
scip The problem instance g Graph into which to insert the new variable as a node consvar The variable that is to be assigned a node in the graph indexcount Pointer to Index of the next unassigned node in the graph scalingfactor Factor for scaling the weight of newly mapped nodes indsetvars Array that keeps track of variables that are part of the graph linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array nvarsincouplings Index of varsincouplings array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 538 of file solver_cliquer.c.
References abs(), getAggrObjCoef(), getLinkedNodeIndex(), getNodeIndex(), isVarLinked(), SCIP_Real, and SCIPisLT().
Referenced by solveCliquer().
◆ setLinkedSolvals()
|
static |
Set the solvals of a variable and of all its linked variables, if any
- Parameters
-
scip The problem instance solvals Array holding the current solution values of all variables of the problem linkmatrix Matrix indicating which variables are linked by a node linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array var Var that may be linked that itself should be set to the value val val Value to which all linked vars are supposed to be set to
Definition at line 583 of file solver_cliquer.c.
References areVarsLinked(), SCIPisGE(), SCIPisLE(), SCIPvarGetLbLocal(), SCIPvarGetProbindex(), and SCIPvarGetUbLocal().
Referenced by propagateVariablefixings(), and solveCliquer().
◆ areObjectivesIntegral()
|
static |
Check if the objective coefficients of the variables are already Integral
- Parameters
-
scip The problem instance linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array varsincouplings Array of variables that are involved in coupling nvarsincouplings Index of varsincouplings array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 613 of file solver_cliquer.c.
References FALSE, getAggrObjCoef(), SCIP_Bool, SCIP_Real, SCIPgetNVars(), SCIPgetVars(), SCIPisZero(), and TRUE.
Referenced by solveCliquer().
◆ scaleRelativeToMax()
|
static |
Scale the objective coefficients of the variables maximally s.t. they become integral and the sum of values does not exceed INT_MAX
- Parameters
-
scip The problem instance linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array varsincouplings Array of variables that are involved in coupling nvarsincouplings Index of varsincouplings array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 643 of file solver_cliquer.c.
References getAggrObjCoef(), SCIP_Real, SCIPgetNVars(), SCIPgetVars(), and SCIPisLT().
Referenced by solveCliquer().
◆ setProblemNotApplicable()
Set isnotapplicable to true for given problem number if solver is applied at root node and no cuts are applied.
- Parameters
-
gcg master problem SCIP data structure probnr pricing problem number isnotapplicable array storing if solver is applicable to problems
Definition at line 684 of file solver_cliquer.c.
References GCGgetMasterprob(), GCGisRootNode(), SCIPgetNCutsApplied(), and TRUE.
Referenced by solveCliquer().
◆ assureInCouplingGraph()
|
static |
Returns index in adjacency matrix of coupling digraph (after inserting it if not already contained).
- Parameters
-
scip The problem instance varsincouplings Array of variables that are involved in coupling nvarsincouplings Index of varsincouplings array var Variable whose membership in the varsincouplings array is to be checked linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints
Definition at line 696 of file solver_cliquer.c.
References getLinkedNodeVar(), and isVarLinked().
Referenced by updateCouplingDiGraph().
◆ updateCouplingDiGraph()
|
static |
Update coupling digraph for a given coupling(like) constraint, i.e., the coupling and constraint vars. This is done by assuring all variables have a corresponding index in the graph. Then, directed edges from coupling var to each other var involved in the constraint are inserted.
- Parameters
-
scip The problem instance consvars Array of variables in constraint for which to update the graph nconsvars Index of consvars array var Coupling / vbd variable for which to update graph couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints
Definition at line 726 of file solver_cliquer.c.
References assureInCouplingGraph().
Referenced by propagateVariablefixings().
◆ isCouplingRelevantRec()
|
static |
Recursive function - should be called through isCouplingRelevant() or other non-recursive methods. Checks if a variable for a given index in the coupling digraph is relevant for distributing the coefficients.
- Parameters
-
scip The problem instance varind Variable index for which to check if it has a successor couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients. maxdepth Integer limiting recursion to finite depth in case of a cycle.
Definition at line 762 of file solver_cliquer.c.
References FALSE, getAggrObjCoef(), isCouplingRelevantRec(), SCIP_Bool, SCIPisLT(), and TRUE.
Referenced by getNSuccessorsRelevant(), hasSuccessorRel(), isCouplingRelevant(), isCouplingRelevantRec(), and isCouplingRelevantVar().
◆ isCouplingRelevant()
|
static |
Checks if a variable for a given index in the coupling digraph is relevant for distributing the coefficients. A variable is said to be relevant iff
- it has a negative objective coefficient or
- in the digraph a node corresponding to a variable with negative obj. coef. is reachable in the digraph.
- Parameters
-
scip The problem instance varind Variable index for which to check if it has a successor couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 798 of file solver_cliquer.c.
References isCouplingRelevantRec(), and SCIP_Bool.
Referenced by objCoefDistrHeurIS(), objCoefDistrHeurNatural(), and objCoefDistrHeurUniform().
◆ isCouplingRelevantVar()
|
static |
Same as isCouplingRelevant(), but takes a SCIP_VAR pointer instead of the digraph index.
- Parameters
-
scip The problem instance var Variable for which to check if it has a successor couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array linkmatrix Matrix indicating which variables are linked by eq-constraints linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 814 of file solver_cliquer.c.
References getNodeIndexCouplDigraph(), isCouplingRelevantRec(), and SCIP_Bool.
Referenced by objCoefDistrHeurIS(), and objCoefDistrHeurNatural().
◆ hasSuccessorRel()
|
static |
Checks in the coupling digraph if a var with a given index has a coupling relevant successor.
- Parameters
-
scip The problem instance varind Variable index for which to check if it has a successor couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients.
Definition at line 837 of file solver_cliquer.c.
References FALSE, isCouplingRelevantRec(), SCIP_Bool, and TRUE.
Referenced by distributeObjCoef().
◆ getNSuccessorsRelevant()
|
static |
Get the number of coupling-relevant successors in the Coupling DiGraph.
- Parameters
-
scip The problem instance varind Variable index for which to count the successors couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array nlinkedvars Index of linkedvars array aggrobjcoef Array of aggregated objective coefficients. varmultiplicities Array holding number of vars represented by digraph node usemultiplicities Wether to use the given multiplicities
Definition at line 863 of file solver_cliquer.c.
References isCouplingRelevantRec().
Referenced by objCoefDistrHeurIS(), objCoefDistrHeurNatural(), and objCoefDistrHeurUniform().
◆ initVarMultiplicities()
|
static |
Compute entries for varmultiplicities array holding counts of represented variables per digraph node
- Parameters
-
scip The problem instance linkmatrix Matrix indicating which variables are linked linkedvars Array of variables that are linked by eq-constraints nlinkedvars Number of linked variables couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array varmultiplicities Array holding number of vars represented by digraph node
Definition at line 893 of file solver_cliquer.c.
References countReachableVars(), and isVarLinked().
Referenced by distributeObjCoef().
◆ objCoefDistrHeurNatural()
|
static |
Coupling(-like) Variable Objective Distribution Strategy 1: Natural Coefficient Share Distribution.
- Parameters
-
scip The problem instance actvarind Index of actual variable couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array varmultiplicities Array holding number of vars represented by digraph node usemultipl Wether varmultiplicities should be used for weighting linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints aggrobjcoef Array of aggregated objective coefficients. constraints Array containing pointers to SCIP constraints of pricing problem nconss Index of constraints array couplingcoefindices Array for coupling coefficient of each constraint (if coupling) cliquerconstypes Array holding constraint types (specific to this solver)
Definition at line 946 of file solver_cliquer.c.
References denominator(), FALSE, getAggrObjCoef(), getNodeIndexCouplDigraph(), getNSuccessorsRelevant(), isCouplingRelevant(), isCouplingRelevantVar(), LINEAR_COUPLING_CLIQUE, LINEAR_COUPLING_DECORATIVE, SCIP_Bool, SCIP_CALL_ABORT, SCIP_Real, SCIPallocClearBufferArray, SCIPblkmem(), SCIPfreeBufferArray, SCIPgetConsNVars(), SCIPgetVarsLinear(), SCIPgetVarVarbound(), SCIPgetVbdvarVarbound(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImageInt(), SCIPhashmapSetImageInt(), setAggrObjCoef(), and VARBND_STD.
Referenced by distributeObjCoefRec().
◆ objCoefDistrHeurIS()
|
static |
Coupling(-like) Variable Objective Distribution Strategy 2: Independent Set-based share distribution.
- Parameters
-
scip The problem instance actvarind Index of actual variable couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array varmultiplicities Array holding number of vars represented by digraph node usemultipl Wether varmultiplicities should be used for weighting linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints aggrobjcoef Array of aggregated objective coefficients. constraints Array containing pointers to SCIP constraints of pricing problem nconss Index of constraints array couplingcoefindices Array for coupling coefficient of each constraint (if coupling) cliquerconstypes Array holding constraint types (specific to this solver)
Definition at line 1107 of file solver_cliquer.c.
References denominator(), FALSE, getAggrObjCoef(), getNodeIndexCouplDigraph(), getNSuccessorsRelevant(), isCouplingRelevant(), isCouplingRelevantVar(), LINEAR_COUPLING_CLIQUE, NULL, SCIP_Bool, SCIP_CALL_ABORT, SCIP_Real, SCIPblkmem(), SCIPgetConsNVars(), SCIPgetVarsLinear(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImageInt(), SCIPhashmapSetImageInt(), and setAggrObjCoef().
Referenced by distributeObjCoefRec().
◆ objCoefDistrHeurUniform()
|
static |
Coupling(-like) Variable Objective Distribution Strategy 3: Uniform Coefficient Share Distribution.
- Parameters
-
scip The problem instance actvarind Index of actual variable couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array varmultiplicities Array holding number of vars represented by digraph node usemultipl Wether varmultiplicities should be used for weighting linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints aggrobjcoef Array of aggregated objective coefficients.
Definition at line 1266 of file solver_cliquer.c.
References getAggrObjCoef(), getNSuccessorsRelevant(), isCouplingRelevant(), SCIP_Real, and setAggrObjCoef().
Referenced by distributeObjCoefRec().
◆ distributeObjCoefRec()
|
static |
Distributes the objective coefficient of coupling(-like) vars to all other vars occurring in those constraints. -> Recursive function: Should be called through non-recursive wrapper function 'distributeObjCoef()'.
- Parameters
-
scip The problem instance actvarind Index of actual variable isdistributed Array storing if a coupled variable was visited couplingmatrix Matrix indicating which variables are involved in couplings varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array varmultiplicities Array holding number of vars represented by digraph node usemultipl Wether varmultiplicities should be used for weighting linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints aggrobjcoef Array of aggregated objective coefficients. constraints Array containing pointers to SCIP constraints of pricing problem nconss Index of constraints array couplingcoefindices Array for coupling coefficient of each constraint (if coupling) cliquerconstypes Array holding constraint types (specific to this solver) selecteddistrheur Number of selected obj coef distribution heuristic.
Definition at line 1307 of file solver_cliquer.c.
References distributeObjCoefRec(), getAggrObjCoef(), objCoefDistrHeurIS(), objCoefDistrHeurNatural(), objCoefDistrHeurUniform(), SCIPisGT(), and TRUE.
Referenced by distributeObjCoef(), and distributeObjCoefRec().
◆ distributeObjCoef()
|
static |
Distributes the objective coefficient of coupling(-like) vars to all other vars occurring in those constraints.
- Parameters
-
scip The problem instance constraints Array containing pointers to SCIP constraints of pricing problem nconss Index of constraints array couplingcoefindices Array for coupling coefficient of each constraint (if coupling) cliquerconstypes Array holding constraint types (specific to this solver) couplingmatrix Matrix indicating which variables are linked by a node varsincouplings Array of variables that are involved in couplings nvarsincouplings Index of varsincouplings array linkedvars Array of variables that are linked by eq-constraints nlinkedvars Index of linkedvars array linkmatrix Matrix indicating which variables are linked by eq-constraints aggrobjcoef Array of aggregated objective coefficients. selecteddistrheur Number of selected obj coef distribution heuristic. usemultipl Wether varmultiplicities should be used for weighting
Definition at line 1403 of file solver_cliquer.c.
References distributeObjCoefRec(), hasSuccessorRel(), initVarMultiplicities(), NULL, SCIP_Bool, SCIP_CALL_ABORT, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPfreeBufferArray, and TRUE.
Referenced by solveCliquer().
◆ determineCliquerConsTypes()
|
static |
Determine cliquer constraint type and save it in the cliquerconstype array. Also, build same-constraint equality graph and coupling digraph.
- Returns
- SCIP bool that is false in case a constraint is encountered that cannot be handled, true if propagation was successful.
- Parameters
-
pricingprob pricing problem SCIP data structure constraints Array containing pointers to SCIP constraints of pricing problem linkedvars Array of variables that are linked by eq-constraints vconsvars Array to store variables of a varbound constraint. markedconsindices Array containing pointers to SCIP constraints to mark them linkmatrix Matrix indicating which variables are linked by a node couplingcoefindices Array for coupling coefficient of each constraint (if coupling) nlinkedvars Index of linkedvars array nconss Index of constraints array markedcount Index of markedconstraints array cliquerconstypes Array holding constraint types (specific to this solver)
Definition at line 1460 of file solver_cliquer.c.
References abs(), FALSE, LINEAR_CLIQUE, LINEAR_COUPLING_CLIQUE, LINEAR_COUPLING_DECORATIVE, LINEAR_IS, LINEAR_IS_LIKE, NULL, SCIP_Bool, SCIP_Real, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIPgetConsNVars(), SCIPgetLhsLinear(), SCIPgetLhsVarbound(), SCIPgetNVarsLinear(), SCIPgetRhsLinear(), SCIPgetRhsVarbound(), SCIPgetValsLinear(), SCIPgetVarVarbound(), SCIPgetVbdcoefVarbound(), SCIPgetVbdvarVarbound(), SCIPisEQ(), SCIPisInfinity(), SCIPisLT(), TRUE, updateVarLinks(), VARBND_IS, VARBND_SAME, and VARBND_STD.
Referenced by solveCliquer().
◆ propagateVariablefixings()
|
static |
Propagate fixings of variables through constraints until the set of fixed variables is stable.
- Returns
- SCIP bool that is false in case the problem is infeasible, true if propagation was successful.
- Parameters
-
pricingprob pricing problem SCIP data structure constraints Array containing pointers to SCIP constraints of pricing problem linkedvars Array of variables that are linked by eq-constraints vconsvars Array to store variables of a varbound constraint. varsincouplings Array of variables that are involved in couplings solvals Array holding the current solution values of all problem variables couplingmatrix Matrix indicating which variables are involved in couplings linkmatrix Matrix indicating which variables are linked by a node nvarsincouplings Index of varsincouplings array couplingcoefindices Array for coupling coefficient of each constraint (if coupling) consvarsfixedcount Array for counting how many variables are fixed per constraint nlinkedvars Index of linkedvars array nconss Index of constraints array nfixedvars Integer counting the number of currently fixed problem variables cliquerconstypes Array holding constraint types (specific to this solver)
Definition at line 1701 of file solver_cliquer.c.
References areVarsLinked(), FALSE, LINEAR_CLIQUE, LINEAR_COUPLING_CLIQUE, LINEAR_COUPLING_DECORATIVE, LINEAR_IS, LINEAR_IS_LIKE, NULL, SCIP_Bool, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIPgetConsNVars(), SCIPgetNVarsLinear(), SCIPgetVarsLinear(), SCIPgetVarVarbound(), SCIPgetVbdvarVarbound(), SCIPvarGetProbindex(), setLinkedSolvals(), TRUE, updateCouplingDiGraph(), VARBND_IS, VARBND_SAME, and VARBND_STD.
Referenced by solveCliquer().
◆ solveCliquer()
|
static |
Solve the pricing problem as an independent set problem, in an approximate way.
- Parameters
-
exactly should the pricing problem be solved to optimality or heuristically? gcg GCG data structure pricingprob pricing problem SCIP data structure solver solver data structure probnr problem number lowerbound pointer to store lower bound status pointer to store pricing problem status
Definition at line 2012 of file solver_cliquer.c.
References addVarToGraph(), aggregateObjCoef(), areObjectivesIntegral(), determineCliquerConsTypes(), distributeObjCoef(), FALSE, GCG_PRICINGSTATUS_INFEASIBLE, GCG_PRICINGSTATUS_NOTAPPLICABLE, GCG_PRICINGSTATUS_UNKNOWN, GCGcreateGcgCol(), GCGgetMasterprob(), GCGpricerAddCol(), getAggrObjCoef(), getLinkedNodeIndex(), GCG_SolverData::isnotapplicable, GCG_SolverData::lincutoffintercept, GCG_SolverData::lincutoffslope, LINEAR_CLIQUE, LINEAR_COUPLING_CLIQUE, LINEAR_COUPLING_DECORATIVE, LINEAR_IS, LINEAR_IS_LIKE, GCG_SolverData::maxcliqueconsperc, GCG_SolverData::maxdensity, GCG_SolverData::maxnodes, NULL, GCG_SolverData::objcoefdistr, propagateVariablefixings(), scaleRelativeToMax(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPallocClearBufferArray, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetConsNVars(), SCIPgetConss(), SCIPgetDepth(), SCIPgetNBinVars(), SCIPgetNConss(), SCIPgetNVars(), SCIPgetVars(), SCIPgetVarsLinear(), SCIPgetVarVarbound(), SCIPgetVbdvarVarbound(), SCIPinfinity(), SCIPisGT(), SCIPisLT(), SCIPvarGetLbLocal(), SCIPvarGetObj(), SCIPvarGetProbindex(), SCIPvarGetUbLocal(), setLinkedSolvals(), setProblemNotApplicable(), GCG_SolverData::skipchecksnodelimit, TRUE, GCG_SolverData::uselincutoff, GCG_SolverData::usemultiplicity, VARBND_IS, VARBND_SAME, and VARBND_STD.
Referenced by GCG_DECL_SOLVERSOLVEHEUR().
◆ GCG_DECL_SOLVERFREE()
|
static |
destructor of pricing solver to free user data (called when SCIP is exiting)
Definition at line 2735 of file solver_cliquer.c.
References GCGgetDwMasterprob(), GCGsolverGetData(), GCGsolverSetData(), NULL, SCIP_OKAY, and SCIPfreeMemory.
◆ GCG_DECL_SOLVERINITSOL()
|
static |
solving process initialization method of pricing solver (called when branch and bound process is about to begin)
Definition at line 2754 of file solver_cliquer.c.
References GCGgetDwMasterprob(), GCGgetMasterprob(), GCGgetNPricingprobs(), GCGsolverGetData(), GCG_SolverData::isnotapplicable, NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocClearBlockMemoryArray.
◆ GCG_DECL_SOLVEREXITSOL()
|
static |
solving process deinitialization method of pricing solver (called before branch and bound process data is freed)
Definition at line 2781 of file solver_cliquer.c.
References GCGgetMasterprob(), GCGgetNPricingprobs(), GCGsolverGetData(), GCG_SolverData::isnotapplicable, NULL, SCIP_OKAY, and SCIPfreeBlockMemoryArray.
◆ GCG_DECL_SOLVERSOLVEHEUR()
|
static |
heuristic solving method of independent set solver
Definition at line 2810 of file solver_cliquer.c.
References FALSE, GCGsolverGetData(), NULL, SCIP_CALL, SCIP_OKAY, and solveCliquer().
◆ GCGincludeSolverCliquer()
| SCIP_RETCODE GCGincludeSolverCliquer | ( | GCG * | gcg | ) |
creates the cliquer solver for pricing problems and includes it in GCG
- Parameters
-
gcg GCG data structure
Definition at line 2824 of file solver_cliquer.c.
References DEFAULT_INTERCEPT, DEFAULT_MAXCLIQUECONSPERC, DEFAULT_MAXDENSITY, DEFAULT_MAXNODES, DEFAULT_OBJCOEFDISTR, DEFAULT_SKIPCHECKSNODELIMIT, DEFAULT_SLOPE, DEFAULT_USELINCUTOFF, DEFAULT_USEMULTIPL, FALSE, GCGgetDwMasterprob(), GCGgetOrigprob(), GCGpricerIncludeSolver(), GCG_SolverData::lincutoffintercept, GCG_SolverData::lincutoffslope, GCG_SolverData::maxcliqueconsperc, GCG_SolverData::maxdensity, GCG_SolverData::maxnodes, NULL, GCG_SolverData::objcoefdistr, SCIP_CALL, SCIP_OKAY, SCIP_REAL_MAX, SCIP_REAL_MIN, SCIPaddBoolParam(), SCIPaddIntParam(), SCIPaddRealParam(), SCIPallocMemory, SCIPincludeExternalCodeInformation(), GCG_SolverData::skipchecksnodelimit, SOLVER_DESC, SOLVER_EXACTENABLED, SOLVER_HEURENABLED, SOLVER_NAME, SOLVER_PRIORITY, solverExitCliquer, solverInitCliquer, solverSolveCliquer, solverUpdateCliquer, TRUE, GCG_SolverData::uselincutoff, and GCG_SolverData::usemultiplicity.
Referenced by GCGincludeMasterPlugins().