Detailed Description
automorphism recognition of SCIPs
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 |
hook function to save the permutation of the graph; fhook() is called by metis for every generator, AUT_HOOK* hook stores a combined mapping in nodemapping that is filled generator-wise
- Parameters
-
user_param data structure to save hashmaps with permutation N number of permutations aut array of permutations
Definition at line 182 of file automorphism.cpp.
References AUT_HOOK2::blocks, AUT_HOOK2::detprobdata, AUT_HOOK2::generatorlimit, AUT_HOOK2::getBool(), gcg::DETPROBDATA::getCons(), AUT_HOOK2::getConsHash(), gcg::PARTIALDECOMP::getConssForBlock(), AUT_HOOK2::getGraph(), gcg::PARTIALDECOMP::getNConssForBlock(), AUT_HOOK2::getNNodes(), gcg::PARTIALDECOMP::getNVarsForBlock(), gcg::DETPROBDATA::getScip(), gcg::DETPROBDATA::getVar(), AUT_HOOK2::getVarHash(), gcg::PARTIALDECOMP::getVarsForBlock(), AUT_HOOK2::ncalls, AUT_HOOK2::nodemap, NULL, AUT_HOOK2::partialdec, SCIP_CALL_ABORT, SCIPallocBufferArray, SCIPconsGetName(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPhashmapInsert(), SCIPvarGetName(), AUT_HOOK2::setBool(), and TRUE.
Referenced by cmpGraphPair().
◆ allocMemoryNewDetection()
|
static |
constructor for colorinfo arrays
- Parameters
-
scip SCIP data structure detprobdata SCIP data structure colorinfo struct to save intermediate information nconss number of constraints nvars number of variables ncoeffs number of coefficients
Definition at line 331 of file automorphism.cpp.
References SCIP_CALL, SCIP_OKAY, and SCIPallocMemoryArray.
Referenced by cmpGraphPair().
◆ freeMemory()
|
static |
destructor for colorinfoarrays
- Parameters
-
scip SCIP data structure colorinfo struct to save intermediate information
Definition at line 350 of file automorphism.cpp.
References SCIP_OKAY, and SCIPfreeMemoryArray.
Referenced by cmpGraphPair().
◆ setuparraysnewdetection()
|
static |
set up a help structure for graph creation for new detection loop
- Parameters
-
scip SCIP data structure detprobdata detprobdata corresponing to presolved or unpresolved problem partialdec partial decomp the symmetry for two blocks is checked for nblocks number of blocks the symmetry should be checked for blocks vectors of block indices the symmetry be checked for colorinfo data structure to save intermediate data result result 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 |
create a graph out of an array of scips
experimental
- Parameters
-
scip SCIP data structure detprobdata detection process information and data partialdec partial decomposition blocks vectors of block indices the symmetry be checked for colorinfo data structure to save intermediate data graph graph needed for discovering isomorphism pricingnodes number of pricing nodes without master result result 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
-
scip SCIP data structure partialdec partialdec the graphs should be compared for block1 index of first pricing prob block2 index of second pricing prob result result pointer to indicate success or failure varmap hashmap to save permutation of variables consmap hashmap to save permutation of constraints searchnodelimit search node limit generatorlimit generator 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()
- Parameters
-
scip SCIP data structure val value
Definition at line 911 of file automorphism.cpp.
References SCIPisNegative(), and SCIPisPositive().
Referenced by comp().
◆ comp() [1/3]
compare two values of two scips
- Parameters
-
scip SCIP data structure val1 value 1 to compare val2 value 2 to compare onlysign use 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]
compare two constraints of two scips
- Parameters
-
scip SCIP data structure cons1 constraint 1 to compare cons2 constraint 2 to compare onlysign use 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]
compare two variables of two scips
- Parameters
-
scip SCIP data structure var1 variable 1 to compare var2 variable 2 to compare onlysign use 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 interface method for sorting the constraints
Definition at line 1024 of file automorphism.cpp.
◆ SCIP_DECL_SORTPTRCOMP() [2/6]
|
static |
SCIP interface method for sorting the constraints
Definition at line 1033 of file automorphism.cpp.
◆ SCIP_DECL_SORTPTRCOMP() [3/6]
|
static |
SCIP interface method for sorting the variables
Definition at line 1042 of file automorphism.cpp.
◆ SCIP_DECL_SORTPTRCOMP() [4/6]
|
static |
SCIP interface method for sorting the variables
Definition at line 1051 of file automorphism.cpp.
◆ SCIP_DECL_SORTPTRCOMP() [5/6]
|
static |
SCIP interface method for sorting the constraint coefficients
Definition at line 1060 of file automorphism.cpp.
◆ SCIP_DECL_SORTPTRCOMP() [6/6]
|
static |
SCIP interface method for sorting the constraint coefficients
Definition at line 1069 of file automorphism.cpp.