Scippy

GCG

Branch-and-Price & Column Generation for Everyone

automorphism.cpp File Reference

Detailed Description

automorphism recognition of SCIPs

Author
Daniel Peters
Martin Bergner
Jonas Witt
Michael Bastubbe

Definition in file automorphism.cpp.

#include "symmetry/automorphism.h"
#include "symmetry/pub_automorphism.h"
#include "gcg/scip_misc.h"
#include "scip/scip.h"
#include "gcg/gcg.h"
#include "scip/cons_linear.h"
#include "gcg/class_partialdecomp.h"
#include "gcg/class_detprobdata.h"
#include "gcg/cons_decomp.hpp"
#include <cstring>

Go to the source code of this file.

Data Structures

struct  AUT_HOOK2
 

Functions

static void fhook (void *user_param, unsigned int N, const unsigned int *aut)
 
static SCIP_RETCODE allocMemoryNewDetection (SCIP *scip, gcg::DETPROBDATA *detprobdata, AUT_COLOR *colorinfo, int nconss, int nvars, int ncoeffs)
 
static SCIP_RETCODE freeMemory (SCIP *scip, AUT_COLOR *colorinfo)
 
static SCIP_RETCODE setuparraysnewdetection (SCIP *scip, gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, int nblocks, std::vector< int > blocks, AUT_COLOR *colorinfo, SCIP_RESULT *result)
 
static SCIP_RETCODE createGraphNewDetection (SCIP *scip, gcg::DETPROBDATA *detprobdata, gcg::PARTIALDECOMP *partialdec, std::vector< int > blocks, AUT_COLOR colorinfo, AUT_GRAPH *graph, int *pricingnodes, SCIP_RESULT *result)
 
SCIP_RETCODE cmpGraphPair (SCIP *scip, gcg::PARTIALDECOMP *partialdec, int block1, int block2, SCIP_RESULT *result, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, unsigned int searchnodelimit, unsigned int generatorlimit)
 
static int getSign (SCIP *scip, SCIP_Real val)
 
static int comp (SCIP *scip, SCIP_Real val1, SCIP_Real val2, SCIP_Bool onlysign)
 
static int comp (SCIP *scip, AUT_CONS *cons1, AUT_CONS *cons2, SCIP_Bool onlysign)
 
static int comp (SCIP *scip, AUT_VAR *var1, AUT_VAR *var2, SCIP_Bool onlysign)
 
static SCIP_DECL_SORTPTRCOMP (sortptrcons)
 
static SCIP_DECL_SORTPTRCOMP (sortptrconssign)
 
static SCIP_DECL_SORTPTRCOMP (sortptrvar)
 
static SCIP_DECL_SORTPTRCOMP (sortptrvarsign)
 
static SCIP_DECL_SORTPTRCOMP (sortptrval)
 
static SCIP_DECL_SORTPTRCOMP (sortptrvalsign)
 

Function Documentation

◆ fhook()

static void fhook ( void *  user_param,
unsigned int  N,
const unsigned int *  aut 
)
static

◆ allocMemoryNewDetection()

static SCIP_RETCODE allocMemoryNewDetection ( SCIP *  scip,
gcg::DETPROBDATA *  detprobdata,
AUT_COLOR *  colorinfo,
int  nconss,
int  nvars,
int  ncoeffs 
)
static

constructor for colorinfo arrays

Parameters
scipSCIP data structure
detprobdataSCIP data structure
colorinfostruct to save intermediate information
nconssnumber of constraints
nvarsnumber of variables
ncoeffsnumber of coefficients

Definition at line 331 of file automorphism.cpp.

References SCIP_CALL, SCIP_OKAY, and SCIPallocMemoryArray.

Referenced by cmpGraphPair().

◆ freeMemory()

static SCIP_RETCODE freeMemory ( SCIP *  scip,
AUT_COLOR *  colorinfo 
)
static

destructor for colorinfoarrays

Parameters
scipSCIP data structure
colorinfostruct to save intermediate information

Definition at line 350 of file automorphism.cpp.

References SCIP_OKAY, and SCIPfreeMemoryArray.

Referenced by cmpGraphPair().

◆ setuparraysnewdetection()

static SCIP_RETCODE setuparraysnewdetection ( SCIP *  scip,
gcg::DETPROBDATA *  detprobdata,
gcg::PARTIALDECOMP *  partialdec,
int  nblocks,
std::vector< int >  blocks,
AUT_COLOR *  colorinfo,
SCIP_RESULT *  result 
)
static

set up a help structure for graph creation for new detection loop

Parameters
scipSCIP data structure
detprobdatadetprobdata corresponing to presolved or unpresolved problem
partialdecpartial decomp the symmetry for two blocks is checked for
nblocksnumber of blocks the symmetry should be checked for
blocksvectors of block indices the symmetry be checked for
colorinfodata structure to save intermediate data
resultresult pointer to indicate success or failure

Definition at line 379 of file automorphism.cpp.

References b, FALSE, gcg::DETPROBDATA::getCons(), gcg::PARTIALDECOMP::getConssForBlock(), gcg::PARTIALDECOMP::getMasterconss(), gcg::PARTIALDECOMP::getNConssForBlock(), gcg::PARTIALDECOMP::getNMasterconss(), gcg::PARTIALDECOMP::getNVarsForBlock(), gcg::DETPROBDATA::getNVarsForCons(), gcg::DETPROBDATA::getVal(), gcg::DETPROBDATA::getVar(), gcg::PARTIALDECOMP::getVarsForBlock(), gcg::DETPROBDATA::getVarsForCons(), SCIP_Bool, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPdebugMessage, and SCIPisZero().

Referenced by cmpGraphPair().

◆ createGraphNewDetection()

static SCIP_RETCODE createGraphNewDetection ( SCIP *  scip,
gcg::DETPROBDATA *  detprobdata,
gcg::PARTIALDECOMP *  partialdec,
std::vector< int >  blocks,
AUT_COLOR  colorinfo,
AUT_GRAPH *  graph,
int *  pricingnodes,
SCIP_RESULT *  result 
)
static

create a graph out of an array of scips

experimental

Parameters
scipSCIP data structure
detprobdatadetection process information and data
partialdecpartial decomposition
blocksvectors of block indices the symmetry be checked for
colorinfodata structure to save intermediate data
graphgraph needed for discovering isomorphism
pricingnodesnumber of pricing nodes without master
resultresult pointer to indicate success or failure

Definition at line 521 of file automorphism.cpp.

References ABS, b, BMSclearMemoryArray, gcg::DETPROBDATA::getCons(), gcg::PARTIALDECOMP::getConssForBlock(), gcg::PARTIALDECOMP::getMasterconss(), gcg::PARTIALDECOMP::getNConssForBlock(), gcg::PARTIALDECOMP::getNMasterconss(), gcg::PARTIALDECOMP::getNVarsForBlock(), gcg::DETPROBDATA::getNVarsForCons(), gcg::PARTIALDECOMP::getNVarsOfBlockInMasterCons(), gcg::DETPROBDATA::getScip(), gcg::DETPROBDATA::getVal(), gcg::DETPROBDATA::getVar(), gcg::PARTIALDECOMP::getVarProbindexForBlock(), gcg::PARTIALDECOMP::getVarsForBlock(), gcg::DETPROBDATA::getVarsForCons(), gcg::PARTIALDECOMP::isVarBlockvarOfBlock(), nnodes, NULL, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPallocBufferArray, SCIPconsGetName(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPinfinity(), and SCIPvarGetName().

Referenced by cmpGraphPair().

◆ cmpGraphPair()

SCIP_RETCODE cmpGraphPair ( SCIP *  scip,
gcg::PARTIALDECOMP *  partialdec,
int  block1,
int  block2,
SCIP_RESULT *  result,
SCIP_HASHMAP *  varmap,
SCIP_HASHMAP *  consmap,
unsigned int  searchnodelimit,
unsigned int  generatorlimit 
)

compare two graphs w.r.t. automorphism

Parameters
scipSCIP data structure
partialdecpartialdec the graphs should be compared for
block1index of first pricing prob
block2index of second pricing prob
resultresult pointer to indicate success or failure
varmaphashmap to save permutation of variables
consmaphashmap to save permutation of constraints
searchnodelimitsearch node limit
generatorlimitgenerator limit

Definition at line 845 of file automorphism.cpp.

References allocMemoryNewDetection(), createGraphNewDetection(), fhook(), freeMemory(), AUT_HOOK2::generatorlimit, AUT_HOOK2::getBool(), gcg::PARTIALDECOMP::getDetprobdata(), gcg::PARTIALDECOMP::getNCoeffsForBlock(), gcg::PARTIALDECOMP::getNCoeffsForMaster(), gcg::PARTIALDECOMP::getNConssForBlock(), gcg::PARTIALDECOMP::getNMasterconss(), gcg::PARTIALDECOMP::getNVarsForBlock(), AUT_HOOK2::ncalls, NULL, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_SUCCESS, SCIP_VERBLEVEL_FULL, SCIPdebugMessage, SCIPverbMessage(), and setuparraysnewdetection().

◆ getSign()

static int getSign ( SCIP *  scip,
SCIP_Real  val 
)
static
Parameters
scipSCIP data structure
valvalue

Definition at line 911 of file automorphism.cpp.

References SCIPisNegative(), and SCIPisPositive().

Referenced by comp().

◆ comp() [1/3]

static int comp ( SCIP *  scip,
SCIP_Real  val1,
SCIP_Real  val2,
SCIP_Bool  onlysign 
)
static

compare two values of two scips

Parameters
scipSCIP data structure
val1value 1 to compare
val2value 2 to compare
onlysignuse sign of values instead of values?

Definition at line 926 of file automorphism.cpp.

References getSign(), SCIP_Real, SCIPisGT(), and SCIPisLT().

Referenced by comp(), and SCIP_DECL_SORTPTRCOMP().

◆ comp() [2/3]

static int comp ( SCIP *  scip,
AUT_CONS *  cons1,
AUT_CONS *  cons2,
SCIP_Bool  onlysign 
)
static

compare two constraints of two scips

Parameters
scipSCIP data structure
cons1constraint 1 to compare
cons2constraint 2 to compare
onlysignuse sign of values instead of values?

Definition at line 958 of file automorphism.cpp.

References comp(), FALSE, GCGconsGetLhs(), GCGconsGetNVars(), GCGconsGetRhs(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPisEQ().

◆ comp() [3/3]

static int comp ( SCIP *  scip,
AUT_VAR *  var1,
AUT_VAR *  var2,
SCIP_Bool  onlysign 
)
static

compare two variables of two scips

Parameters
scipSCIP data structure
var1variable 1 to compare
var2variable 2 to compare
onlysignuse sign of values instead of values?

Definition at line 983 of file automorphism.cpp.

References comp(), GCGpricingVarGetOriginalVar(), GCGvarIsPricing(), SCIPisEQ(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetType(), and SCIPvarGetUbGlobal().

◆ SCIP_DECL_SORTPTRCOMP() [1/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrcons  )
static

SCIP interface method for sorting the constraints

Definition at line 1024 of file automorphism.cpp.

References comp(), and FALSE.

◆ SCIP_DECL_SORTPTRCOMP() [2/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrconssign  )
static

SCIP interface method for sorting the constraints

Definition at line 1033 of file automorphism.cpp.

References comp(), and TRUE.

◆ SCIP_DECL_SORTPTRCOMP() [3/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrvar  )
static

SCIP interface method for sorting the variables

Definition at line 1042 of file automorphism.cpp.

References comp(), and FALSE.

◆ SCIP_DECL_SORTPTRCOMP() [4/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrvarsign  )
static

SCIP interface method for sorting the variables

Definition at line 1051 of file automorphism.cpp.

References comp(), and TRUE.

◆ SCIP_DECL_SORTPTRCOMP() [5/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrval  )
static

SCIP interface method for sorting the constraint coefficients

Definition at line 1060 of file automorphism.cpp.

References comp(), and FALSE.

◆ SCIP_DECL_SORTPTRCOMP() [6/6]

static SCIP_DECL_SORTPTRCOMP ( sortptrvalsign  )
static

SCIP interface method for sorting the constraint coefficients

Definition at line 1069 of file automorphism.cpp.

References comp(), and TRUE.