35#include <bliss/defs.hh>
36#include <bliss/graph.hh>
40#include <dejavu/tools/bliss_converter.h>
90 bool isIdentity =
true;
109 for (
int j = 0; j < permlen; ++j)
111 if ( (
int) aut[j] != j )
123 for (
int j = 0; j < permlen; ++j)
162#ifdef BLISS_PATCH_PRESENT
163 return "bliss " BLISS_VERSION
"p";
165 return "bliss " BLISS_VERSION;
172 return "Computing Graph Automorphisms by T. Junttila and P. Kaski (users.aalto.fi/~tjunttil/bliss)";
176#define XSTR(x) STR(x)
181 return "sassy " XSTR(SASSY_VERSION_MAJOR)
"." XSTR(SASSY_VERSION_MINOR);
187 return "Symmetry preprocessor by Markus Anders (github.com/markusa4/sassy)";
195 dejavu::static_graph* G,
211 assert( maxgenerators >= 0 );
239 dejavu::preprocessor sassy;
242 dejavu_hook sassyglue = [&](
int n,
const int* p,
int nsupp,
const int* suppa) {
243 sassyhook((
void*)&data, n, p, nsupp, suppa);
247 sassy.reduce(G, &sassyglue);
249 if( G->get_sgraph()->v_size == 0 )
251 dejavu::big_number grp_sz = sassy.grp_sz;
252 *log10groupsize = (
SCIP_Real) log10l(grp_sz.mantissa * powl(10.0, (
SCIP_Real) grp_sz.exponent));
257 bliss::Graph blissgraph(0);
260 convert_dejavu_to_bliss(G, &blissgraph);
263 blissgraph.write_dot(
"debug.dot");
266#ifdef SCIP_DISABLED_CODE
269 FILE* fp = fopen(filename,
"w");
272 blissgraph.write_dimacs(fp);
283 blissgraph.set_splitting_heuristic(bliss::Graph::shs_f);
285 blissgraph.set_component_recursion(
false);
287#if BLISS_VERSION_MAJOR >= 1 || BLISS_VERSION_MINOR >= 76
293 auto hook = [&](
unsigned int n,
const unsigned int* aut) {
294 sassy.bliss_hook(n, aut);
298 blissgraph.find_automorphisms(stats, hook, term);
302#ifdef BLISS_PATCH_PRESENT
310 blissgraph.find_automorphisms(stats, dejavu::preprocessor::bliss_hook, (
void*) &sassy);
314 (void) stats.print(stdout);
317 dejavu::big_number grp_sz = sassy.grp_sz;
318 *log10groupsize = (
SCIP_Real) log10l(stats.get_group_size_approx() * grp_sz.mantissa * powl(10.0, (
SCIP_Real) grp_sz.exponent));
374 dejavu::static_graph sassygraph;
380 sassygraph.dump_dimacs(filename);
408 dejavu::static_graph sassygraph;
423 for (
int p = 0; p <
nperms && ! success; ++p)
425 for (
int i = 0;
i < nnodesfromG1; ++
i)
427 if (
perms[p][
i] >= nnodesfromG1 )
435 for (
int p = 0; p <
nperms; ++p)
SCIP_RETCODE SYMbuildDejavuGraphCheck(SCIP *scip, dejavu::static_graph *dejavugraph, SYM_GRAPH *G1, SYM_GRAPH *G2, int *nnodes, int *nnodesfromG1, SCIP_Bool *success)
SCIP_RETCODE SYMbuildDejavuGraph(SCIP *scip, dejavu::static_graph *dejavugraph, SYM_GRAPH *graph, SCIP_Bool *success)
methods to build dejavu graph for symmetry detection
interface for symmetry computations
SCIP_Bool SYMcheckGraphsAreIdentical(SCIP *scip, SYM_SYMTYPE symtype, SYM_GRAPH *G1, SYM_GRAPH *G2)
const char * SYMsymmetryGetName(void)
const char * SYMsymmetryGetAddName(void)
SCIP_RETCODE SYMcomputeSymmetryGenerators(SCIP *scip, int maxgenerators, SYM_GRAPH *graph, int *nperms, int *nmaxperms, int ***perms, SCIP_Real *log10groupsize, SCIP_Real *symcodetime)
SCIP_Bool SYMcanComputeSymmetry(void)
const char * SYMsymmetryGetDesc(void)
static void sassyhook(void *user_param, int n, const int *aut, int nsupp, const int *suppa)
const char * SYMsymmetryGetAddDesc(void)
static SCIP_RETCODE computeAutomorphisms(SCIP *scip, SYM_SYMTYPE symtype, dejavu::static_graph *G, int nsymvars, int maxgenerators, int ***perms, int *nperms, int *nmaxperms, SCIP_Real *log10groupsize, SCIP_Bool restricttovars, SCIP_Real *symcodetime)
Constraint handler for linear constraints in their most general form, .
constraint handler for nonlinear constraints specified by algebraic expressions
#define SCIP_CALL_ABORT(x)
private functions to work with algebraic expressions
power and signed power expression handlers
variable expression handler
const char * SCIPgetProbName(SCIP *scip)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Real SCIPgetSolvingTime(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SYM_SYMTYPE SCIPgetSymgraphSymtype(SYM_GRAPH *graph)
int SCIPgetSymgraphNVars(SYM_GRAPH *graph)
assert(minobj< SCIPgetCutoffbound(scip))
public methods for memory management
methods for dealing with symmetry detection graphs
struct SYM_Graph SYM_GRAPH
enum SCIP_Retcode SCIP_RETCODE
enum SYM_Symtype SYM_SYMTYPE