methods for dealing with symmetry detection graphs
Definition in file symmetry_graph.c.
#include "scip/symmetry_graph.h"
#include "scip/scip.h"
#include "scip/misc.h"
#include "symmetry/struct_symmetry.h"
#include "symmetry/type_symmetry.h"
Go to the source code of this file.
|
static |
ensures that the node-based arrays in symmetry graph are sufficiently long
scip | SCIP data structure |
graph | symmetry detection graph |
addsize | required additional size of node-based arrays |
Definition at line 359 of file symmetry_graph.c.
References assert(), SYM_Graph::maxnnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by SCIPaddSymgraphConsnode(), SCIPaddSymgraphOpnode(), and SCIPaddSymgraphValnode().
|
static |
ensures that the edge-based arrays in symmetry graph are sufficiently long
scip | SCIP data structure |
graph | symmetry detection graph |
addsize | required additional size of edge-based arrays |
Definition at line 610 of file symmetry_graph.c.
References assert(), SYM_Graph::edgefirst, SYM_Graph::edgesecond, SYM_Graph::edgevals, SYM_Graph::maxnedges, SYM_Graph::nedges, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.
Referenced by SCIPaddSymgraphEdge().
compares two variables for permutation symmetry detection
Variables are sorted first by their type, then by their objective coefficient, then by their lower bound, and then by their upper bound.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
scip | SCIP pointer (or NULL for exact comparison) |
var1 | first variable for comparison |
var2 | second variable for comparison |
Definition at line 683 of file symmetry_graph.c.
References assert(), NULL, SCIPisGT(), SCIPisLT(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetType(), and SCIPvarGetUbGlobal().
Referenced by compareVarsFixed(), and SCIPcomputeSymgraphColors().
|
static |
compares two variables for permutation symmetry detection
Variables are sorted first by whether they are fixed, then by their type, then by their objective coefficient, then by their lower bound, and then by their upper bound.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
scip | SCIP pointer (or NULL for exact comparison) |
var1 | first variable for comparison |
var2 | second variable for comparison |
isfixed1 | whether var1 needs to be fixed |
isfixed2 | whether var2 needs to be fixed |
Definition at line 747 of file symmetry_graph.c.
References assert(), compareVars(), NULL, and SCIP_Bool.
Referenced by SCIP_DECL_SORTINDCOMP().
|
static |
sorts nodes of a permutation symmetry detection graph
Variables are sorted first by whether they are fixed, then by their type, then by their objective coefficient, then by their lower bound, and then by their upper bound.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 777 of file symmetry_graph.c.
References assert(), compareVarsFixed(), SYM_Graph::isfixedvar, NULL, SCIP_Bool, SYM_Graph::symvars, and vars.
|
static |
compares two variables for signed permutation symmetry detection
Variables are sorted first by their type, then by their objective coefficient, then by their lower bound, and then by their upper bound. To take signed permutations into account, variable domains are centered at origin if the domain is finite.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
scip | SCIP pointer (or NULL for exact comparison) |
var1 | first variable for comparison |
var2 | second variable for comparison |
isneg1 | whether var1 needs to be negated |
isneg2 | whether var2 needs to be negated |
infinity | values as least as large as this are regarded as infinite |
Definition at line 808 of file symmetry_graph.c.
References assert(), infinity, NULL, SCIP_Bool, SCIP_Real, SCIPisGT(), SCIPisLT(), SCIPvarGetLbGlobal(), SCIPvarGetObj(), SCIPvarGetType(), and SCIPvarGetUbGlobal().
Referenced by compareVarsFixedSignedPerm(), and SCIPcomputeSymgraphColors().
|
static |
compares two variables for signed permutation symmetry detection
Variables are sorted first by whether they are fixed, then by their type, then by their objective coefficient, then by their lower bound and then by their upper bound. To take signed permutations into account, variable domains are centered at origin if the domain is finite.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
scip | SCIP pointer (or NULL for exact comparison) |
var1 | first variable for comparison |
var2 | second variable for comparison |
isfixed1 | whether var1 needs to be fixed |
isfixed2 | whether var2 needs to be fixed |
isneg1 | whether var1 needs to be negated |
isneg2 | whether var2 needs to be negated |
infinity | values as least as large as this are regarded as infinite |
Definition at line 926 of file symmetry_graph.c.
References assert(), compareVarsSignedPerm(), infinity, NULL, SCIP_Bool, and SCIP_Real.
Referenced by SCIP_DECL_SORTINDCOMP().
|
static |
sorts nodes of a signed permutation symmetry detection graph
Variables are sorted first by whether they are fixed, then by their type, then by their objective coefficient, then by their lower bound and then by their upper bound. To take signed permutations into account, variable domains are centered at origin if the domain is finite.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 961 of file symmetry_graph.c.
References assert(), compareVarsFixedSignedPerm(), FALSE, SYM_Graph::infinity, SYM_Graph::isfixedvar, SYM_Graph::nsymvars, NULL, SCIP_Bool, SYM_Graph::symvars, TRUE, and vars.
|
static |
compares two operators
Operators are sorted by their int values.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
op1 | first operator in comparison |
op2 | second operator in comparison |
Definition at line 1010 of file symmetry_graph.c.
Referenced by SCIP_DECL_SORTINDCOMP(), and SCIPcomputeSymgraphColors().
|
static |
sorts operators corresponding to SCIP_EXPRHDLR*
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 1031 of file symmetry_graph.c.
References compareOps().
|
static |
sorts real values
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 1048 of file symmetry_graph.c.
References SCIP_Real.
compares constraint nodes
Nodes are sorted by their type of constraint, then by the lhs, and then by the rhs.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
scip | SCIP data structure |
graph | underlying symmetry detection graph |
ind1 | index of first constraint node |
ind2 | index of second constraint node |
Definition at line 1072 of file symmetry_graph.c.
References assert(), SYM_Graph::conss, SYM_Graph::lhs, NULL, SYM_Graph::rhs, SCIPconsGetHdlr(), SCIPisGT(), and SCIPisLT().
Referenced by SCIP_DECL_SORTINDCOMP(), and SCIPcomputeSymgraphColors().
|
static |
sorts constraint nodes
Nodes are sorted by their type of constraint, then by the lhs, and then by the rhs.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 1133 of file symmetry_graph.c.
References compareConsnodes(), and NULL.
|
static |
sorts edges
Edges are sorted by their weights.
result: < 0: ind1 comes before (is better than) ind2 = 0: both indices have the same value
0: ind2 comes after (is worse than) ind2
Definition at line 1148 of file symmetry_graph.c.
References SYM_Graph::edgevals.
returns whether a node of the symmetry detection graph needs to be fixed
var | active problem variable |
fixedtype | variable types that must be fixed by symmetries |
Definition at line 1164 of file symmetry_graph.c.
References assert(), FALSE, NULL, SCIP_Bool, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_CONTINUOUS, SCIP_VARTYPE_IMPLINT, SCIP_VARTYPE_INTEGER, SCIPvarGetType(), SYM_SPEC_BINARY, SYM_SPEC_INTEGER, SYM_SPEC_REAL, TRUE, and var.
Referenced by SCIPcomputeSymgraphColors().