Scippy

SCIP

Solving Constraint Integer Programs

PublicSymmetryGraphMethods

Detailed Description

Functions

SCIP_RETCODE SCIPcreateSymgraph (SCIP *scip, SYM_SYMTYPE symtype, SYM_GRAPH **graph, SCIP_VAR **symvars, int nsymvars, int nopnodes, int nvalnodes, int nconsnodes, int nedges)
 
SCIP_RETCODE SCIPfreeSymgraph (SCIP *scip, SYM_GRAPH **graph)
 
SCIP_RETCODE SCIPcopySymgraph (SCIP *scip, SYM_GRAPH **graph, SYM_GRAPH *origgraph, int *perm, SYM_SPEC fixedtype)
 
SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear (SCIP *scip, SYM_GRAPH *graph, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_CONS *cons, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool *success)
 
SCIP_RETCODE SCIPaddSymgraphVarAggregation (SCIP *scip, SYM_GRAPH *graph, int rootidx, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real constant)
 
SCIP_RETCODE SCIPaddSymgraphOpnode (SCIP *scip, SYM_GRAPH *graph, int op, int *nodeidx)
 
SCIP_RETCODE SCIPaddSymgraphValnode (SCIP *scip, SYM_GRAPH *graph, SCIP_Real val, int *nodeidx)
 
SCIP_RETCODE SCIPaddSymgraphConsnode (SCIP *scip, SYM_GRAPH *graph, SCIP_CONS *cons, SCIP_Real lhs, SCIP_Real rhs, int *nodeidx)
 
int SCIPgetSymgraphVarnodeidx (SCIP *scip, SYM_GRAPH *graph, SCIP_VAR *var)
 
int SCIPgetSymgraphNegatedVarnodeidx (SCIP *scip, SYM_GRAPH *graph, SCIP_VAR *var)
 
SCIP_RETCODE SCIPupdateSymgraphLhs (SYM_GRAPH *graph, int nodeidx, SCIP_Real newlhs)
 
SCIP_RETCODE SCIPupdateSymgraphRhs (SYM_GRAPH *graph, int nodeidx, SCIP_Real newrhs)
 
SCIP_RETCODE SCIPfixSymgraphVarnode (SYM_GRAPH *graph, SCIP_VAR *var)
 
SCIP_RETCODE SCIPaddSymgraphEdge (SCIP *scip, SYM_GRAPH *graph, int first, int second, SCIP_Bool hasval, SCIP_Real val)
 
SCIP_RETCODE SCIPcomputeSymgraphColors (SCIP *scip, SYM_GRAPH *graph, SYM_SPEC fixedtype)
 
SYM_SYMTYPE SCIPgetSymgraphSymtype (SYM_GRAPH *graph)
 
SCIP_VAR ** SCIPgetSymgraphVars (SYM_GRAPH *graph)
 
int SCIPgetSymgraphNVars (SYM_GRAPH *graph)
 
int SCIPgetSymgraphNConsnodes (SYM_GRAPH *graph)
 
int SCIPgetSymgraphNNodes (SYM_GRAPH *graph)
 
int SCIPgetSymgraphNEdges (SYM_GRAPH *graph)
 
int SCIPgetSymgraphEdgeFirst (SYM_GRAPH *graph, int edgeidx)
 
int SCIPgetSymgraphEdgeSecond (SYM_GRAPH *graph, int edgeidx)
 
int SCIPgetSymgraphVarnodeColor (SYM_GRAPH *graph, int nodeidx)
 
SYM_NODETYPE SCIPgetSymgraphNodeType (SYM_GRAPH *graph, int nodeidx)
 
int SCIPgetSymgraphNodeColor (SYM_GRAPH *graph, int nodeidx)
 
SCIP_Bool SCIPisSymgraphEdgeColored (SYM_GRAPH *graph, int edgeidx)
 
int SCIPgetSymgraphEdgeColor (SYM_GRAPH *graph, int edgeidx)
 
int SCIPgetSymgraphNVarcolors (SYM_GRAPH *graph)
 
SCIP_Bool SCIPhasGraphUniqueEdgetype (SYM_GRAPH *graph)
 
SCIP_RETCODE SCIPallocateSymgraphConsnodeperm (SCIP *scip, SYM_GRAPH *graph)
 
SCIP_RETCODE SCIPcreateSymgraphConsnodeperm (SCIP *scip, SYM_GRAPH *graph)
 
int * SCIPgetSymgraphConsnodeperm (SCIP *scip, SYM_GRAPH *graph)
 
SCIP_RETCODE SCIPfreeSymgraphConsnodeperm (SCIP *scip, SYM_GRAPH *graph)
 
SCIP_RETCODE SCIPgetSymActiveVariables (SCIP *scip, SYM_SYMTYPE symtype, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
 
SCIP_RETCODE SCIPfreeSymDataExpr (SCIP *scip, SYM_EXPRDATA **symdata)
 
int SCIPgetSymExprdataNConstants (SYM_EXPRDATA *symdata)
 
SCIP_RealSCIPgetSymExprdataConstants (SYM_EXPRDATA *symdata)
 
SCIP_RETCODE SCIPgetCoefSymData (SCIP *scip, SCIP_EXPR *expr, SCIP_EXPR *parentexpr, SCIP_Real *coef, SCIP_Bool *success)
 

Function Documentation

◆ SCIPcreateSymgraph()

SCIP_RETCODE SCIPcreateSymgraph ( SCIP scip,
SYM_SYMTYPE  symtype,
SYM_GRAPH **  graph,
SCIP_VAR **  symvars,
int  nsymvars,
int  nopnodes,
int  nvalnodes,
int  nconsnodes,
int  nedges 
)

creates and initializes a symmetry detection graph with memory for the given number of nodes and edges

Note
at some point, the graph needs to be freed!

creates and initializes a symmetry detection graph with memory for the given number of nodes and edges

Note
At some point, the graph needs to be freed!
Parameters
scipSCIP data structure
symtypetype of symmetries encoded in graph
graphpointer to hold symmetry detection graph
symvarsvariables used in symmetry detection
nsymvarsnumber of variables used in symmetry detection
nopnodesnumber of operator nodes
nvalnodesnumber of value nodes
nconsnodesnumber of constraint nodes
nedgesnumber of edges

Definition at line 44 of file symmetry_graph.c.

References FALSE, nnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPallocClearBlockMemoryArray, and SCIPinfinity().

Referenced by checkSymmetriesAreSymmetries(), computeSymmetryGroup(), and SCIPcopySymgraph().

◆ SCIPfreeSymgraph()

SCIP_RETCODE SCIPfreeSymgraph ( SCIP scip,
SYM_GRAPH **  graph 
)

frees a symmetry detection graph

Parameters
scipSCIP data structure
graphpointer to symmetry detection graph

Definition at line 111 of file symmetry_graph.c.

References NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SYM_SYMTYPE_PERM, and SYM_SYMTYPE_SIGNPERM.

Referenced by checkSymmetriesAreSymmetries(), and computeSymmetryGroup().

◆ SCIPcopySymgraph()

SCIP_RETCODE SCIPcopySymgraph ( SCIP scip,
SYM_GRAPH **  graph,
SYM_GRAPH origgraph,
int *  perm,
SYM_SPEC  fixedtype 
)

◆ SCIPextendPermsymDetectionGraphLinear()

SCIP_RETCODE SCIPextendPermsymDetectionGraphLinear ( SCIP scip,
SYM_GRAPH graph,
SCIP_VAR **  vars,
SCIP_Real vals,
int  nvars,
SCIP_CONS cons,
SCIP_Real  lhs,
SCIP_Real  rhs,
SCIP_Bool success 
)

adds a symmetry detection graph for a linear constraint to existing graph

For permutation symmetries, a constraint node is added that is connected to all variable nodes in the constraint. Edges are colored according to the variable coefficients. For signed permutation symmetries, also edges connecting the constraint node and the negated variable nodes are added, these edges are colored by the negative coefficients.

Parameters
scipSCIP data structure
graphsymmetry detection graph
varsvariable array of linear constraint
valscoefficients of linear constraint
nvarsnumber of variables in linear constraint
consconstraint for which we encode symmetries
lhsleft-hand side of constraint
rhsright-hand side of constraint
successpointer to store whether graph could be built

Definition at line 226 of file symmetry_graph.c.

References SYM_Graph::islocked, SYM_Graph::nsymvars, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddSymgraphConsnode(), SCIPaddSymgraphEdge(), SCIPgetSymgraphNegatedVarnodeidx(), SCIPgetSymgraphSymtype(), SCIPgetSymgraphVarnodeidx(), SCIPvarGetProbindex(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, and TRUE.

Referenced by addSymmetryInformation().

◆ SCIPaddSymgraphVarAggregation()

SCIP_RETCODE SCIPaddSymgraphVarAggregation ( SCIP scip,
SYM_GRAPH graph,
int  rootidx,
SCIP_VAR **  vars,
SCIP_Real vals,
int  nvars,
SCIP_Real  constant 
)

adds nodes and edges corresponding to the aggregation of a variable to a symmetry detection graph

For permutation symmetries, the root node is connected with all variable nodes in the aggregation. Edges are colored according to the variable coefficients. For signed permutation symmetries, also edges connecting the root node and the negated variable nodes are added, these edges are colored by the negative coefficients.

Parameters
scipSCIP data structure
graphsymmetry detection graph
rootidxindex of root node of the aggegration
varsarray of variables in aggregation
valscoefficients of variables
nvarsnumber of variables in aggregation
constantconstant of aggregation

Definition at line 294 of file symmetry_graph.c.

References FALSE, SYM_Graph::nsymvars, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddSymgraphEdge(), SCIPaddSymgraphValnode(), SCIPgetSymgraphNegatedVarnodeidx(), SCIPgetSymgraphSymtype(), SCIPgetSymgraphVarnodeidx(), SCIPisZero(), SCIPvarGetProbindex(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, and TRUE.

Referenced by addSymmetryInformation(), and SCIP_DECL_CONSGETPERMSYMGRAPH().

◆ SCIPaddSymgraphOpnode()

SCIP_RETCODE SCIPaddSymgraphOpnode ( SCIP scip,
SYM_GRAPH graph,
int  op,
int *  nodeidx 
)

◆ SCIPaddSymgraphValnode()

SCIP_RETCODE SCIPaddSymgraphValnode ( SCIP scip,
SYM_GRAPH graph,
SCIP_Real  val,
int *  nodeidx 
)

◆ SCIPaddSymgraphConsnode()

SCIP_RETCODE SCIPaddSymgraphConsnode ( SCIP scip,
SYM_GRAPH graph,
SCIP_CONS cons,
SCIP_Real  lhs,
SCIP_Real  rhs,
int *  nodeidx 
)

adds a constraint node to a symmetry detection graph and returns its node index

Parameters
scipSCIP data structure
graphsymmetry detection graph
consconstraint of node
lhsleft-hand side of node
rhsright-hand side of node
nodeidxpointer to hold index of created node

Definition at line 464 of file symmetry_graph.c.

References SYM_Graph::conss, ensureNodeArraysSize(), SYM_Graph::infinity, SYM_Graph::islocked, SYM_Graph::lhs, MAX, SYM_Graph::maxnconsnodes, MIN, SYM_Graph::nconsnodes, SYM_Graph::nnodes, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::rhs, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPcalcMemGrowSize(), SCIPerrorMessage, SCIPreallocBlockMemoryArray, and SYM_NODETYPE_CONS.

Referenced by addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPcopySymgraph(), and SCIPextendPermsymDetectionGraphLinear().

◆ SCIPgetSymgraphVarnodeidx()

◆ SCIPgetSymgraphNegatedVarnodeidx()

int SCIPgetSymgraphNegatedVarnodeidx ( SCIP scip,
SYM_GRAPH graph,
SCIP_VAR var 
)

◆ SCIPupdateSymgraphLhs()

SCIP_RETCODE SCIPupdateSymgraphLhs ( SYM_GRAPH graph,
int  nodeidx,
SCIP_Real  newlhs 
)

updates the lhs of a constraint node

Parameters
graphsymmetry detection graph
nodeidxindex of constraint node in graph
newlhsnew left-hand side of node

Definition at line 553 of file symmetry_graph.c.

References SYM_Graph::lhs, SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SCIP_OKAY, and SYM_NODETYPE_CONS.

◆ SCIPupdateSymgraphRhs()

SCIP_RETCODE SCIPupdateSymgraphRhs ( SYM_GRAPH graph,
int  nodeidx,
SCIP_Real  newrhs 
)

updates the rhs of a constraint node

Parameters
graphsymmetry detection graph
nodeidxindex of constraint node in graph
newrhsnew reft-hand side of node

Definition at line 569 of file symmetry_graph.c.

References SYM_Graph::nodeinfopos, SYM_Graph::nodetypes, NULL, SYM_Graph::rhs, SCIP_OKAY, and SYM_NODETYPE_CONS.

◆ SCIPfixSymgraphVarnode()

SCIP_RETCODE SCIPfixSymgraphVarnode ( SYM_GRAPH graph,
SCIP_VAR var 
)

registers a variable node (corresponding to active variable) to be fixed by symmetry

Parameters
graphsymmetry detection graph
varactive variable that needs to be fixed

Definition at line 585 of file symmetry_graph.c.

References SYM_Graph::isfixedvar, NULL, SCIP_OKAY, SCIPvarGetProbindex(), and TRUE.

◆ SCIPaddSymgraphEdge()

SCIP_RETCODE SCIPaddSymgraphEdge ( SCIP scip,
SYM_GRAPH graph,
int  first,
int  second,
SCIP_Bool  hasval,
SCIP_Real  val 
)

adds an edge to a symmetry detection graph

Parameters
scipSCIP data structure
graphsymmetry detection graph
firstfirst node index of edge
secondsecond node index of edge
hasvalwhether the edge has a value
valvalue of the edge (is it has a value)

Definition at line 634 of file symmetry_graph.c.

References SYM_Graph::edgefirst, SYM_Graph::edgesecond, SYM_Graph::edgevals, ensureEdgeArraysSize(), SYM_Graph::islocked, SYM_Graph::nedges, NULL, SCIP_CALL, SCIP_ERROR, SCIP_OKAY, SCIPerrorMessage, and SCIPinfinity().

Referenced by addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), SCIPaddSymgraphVarAggregation(), SCIPcopySymgraph(), SCIPextendPermsymDetectionGraphLinear(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().

◆ SCIPcomputeSymgraphColors()

SCIP_RETCODE SCIPcomputeSymgraphColors ( SCIP scip,
SYM_GRAPH graph,
SYM_SPEC  fixedtype 
)

computes colors of nodes and edges

computes colors of nodes and edges

Colors are detected by sorting different types of nodes (variables, operators, values, and constraint) and edges. If two consecutive nodes of the same type differ (e.g., different variable type), they are assigned a new color.

Parameters
scipSCIP data structure
graphsymmetry detection graph
fixedtypevariable types that must be fixed by symmetries

Definition at line 1196 of file symmetry_graph.c.

References compareConsnodes(), compareOps(), compareVars(), compareVarsSignedPerm(), SYM_Graph::conscolors, SYM_Graph::edgecolors, FALSE, SYM_Graph::isfixedvar, isFixedVar(), SYM_Graph::islocked, SYM_Graph::nconsnodes, SYM_Graph::nedges, SYM_Graph::nopnodes, SYM_Graph::nsymvars, NULL, SYM_Graph::nvalnodes, SYM_Graph::opcolors, SYM_Graph::ops, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPisEQ(), SCIPisInfinity(), SCIPsort(), SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, SYM_Graph::symvars, TRUE, SYM_Graph::valcolors, SYM_Graph::vals, and SYM_Graph::varcolors.

Referenced by checkSymmetriesAreSymmetries(), computeSymmetryGroup(), and SCIPcopySymgraph().

◆ SCIPgetSymgraphSymtype()

SYM_SYMTYPE SCIPgetSymgraphSymtype ( SYM_GRAPH graph)

returns the type of symmetries encoded in graph

Parameters
graphsymmetry detection graph

Definition at line 1439 of file symmetry_graph.c.

References NULL, and SYM_Graph::symtype.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), SCIPaddSymgraphVarAggregation(), SCIPextendPermsymDetectionGraphLinear(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphVars()

SCIP_VAR** SCIPgetSymgraphVars ( SYM_GRAPH graph)

returns the variables in a symmetry detection graph

Parameters
graphsymmetry detection graph

Definition at line 1449 of file symmetry_graph.c.

References NULL, and SYM_Graph::symvars.

◆ SCIPgetSymgraphNVars()

int SCIPgetSymgraphNVars ( SYM_GRAPH graph)

returns the number of variables in a symmetry detection graph

Parameters
graphsymmetry detection graph

Definition at line 1459 of file symmetry_graph.c.

References SYM_Graph::nsymvars, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphNConsnodes()

int SCIPgetSymgraphNConsnodes ( SYM_GRAPH graph)

returns the number of constraint nodes in a symmetry detection graph

Parameters
graphsymmetry detection graph

Definition at line 1469 of file symmetry_graph.c.

References SYM_Graph::nconsnodes, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphNNodes()

int SCIPgetSymgraphNNodes ( SYM_GRAPH graph)

returns the number of non-variable nodes in a graph

Parameters
graphsymmetry detection graph

Definition at line 1479 of file symmetry_graph.c.

References SYM_Graph::nnodes, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), SYMcomputeSymmetryGenerators(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetEvenOperator().

◆ SCIPgetSymgraphNEdges()

int SCIPgetSymgraphNEdges ( SYM_GRAPH graph)

returns the number of edges in a graph

Parameters
graphsymmetry detection graph

Definition at line 1489 of file symmetry_graph.c.

References SYM_Graph::nedges, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphEdgeFirst()

int SCIPgetSymgraphEdgeFirst ( SYM_GRAPH graph,
int  edgeidx 
)

return the first node index of an edge

Parameters
graphsymmetry detection graph
edgeidxindex of edge

Definition at line 1499 of file symmetry_graph.c.

References SYM_Graph::edgefirst, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), SCIPcopySymgraph(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphEdgeSecond()

int SCIPgetSymgraphEdgeSecond ( SYM_GRAPH graph,
int  edgeidx 
)

return the second node index of an edge

Parameters
graphsymmetry detection graph
edgeidxindex of edge

Definition at line 1511 of file symmetry_graph.c.

References SYM_Graph::edgesecond, and NULL.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), SCIPcopySymgraph(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphVarnodeColor()

int SCIPgetSymgraphVarnodeColor ( SYM_GRAPH graph,
int  nodeidx 
)

returns the color of a variable node

Parameters
graphsymmetry detection graph
nodeidxindex of variable node

Definition at line 1523 of file symmetry_graph.c.

References SYM_Graph::islocked, NULL, SYM_SYMTYPE_PERM, SYM_SYMTYPE_SIGNPERM, SYM_Graph::symtype, and SYM_Graph::varcolors.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphNodeType()

SYM_NODETYPE SCIPgetSymgraphNodeType ( SYM_GRAPH graph,
int  nodeidx 
)

returns the type of a node

Parameters
graphsymmetry detection graph
nodeidxindex of node

Definition at line 1545 of file symmetry_graph.c.

References nnodes, SYM_Graph::nodetypes, NULL, and SYM_NODETYPE_VAR.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphNodeColor()

int SCIPgetSymgraphNodeColor ( SYM_GRAPH graph,
int  nodeidx 
)

◆ SCIPisSymgraphEdgeColored()

SCIP_Bool SCIPisSymgraphEdgeColored ( SYM_GRAPH graph,
int  edgeidx 
)

returns whether an edge is colored

Parameters
graphsymmetry detection graph
edgeidxindex of edge

Definition at line 1583 of file symmetry_graph.c.

References SYM_Graph::edgecolors, FALSE, SYM_Graph::islocked, NULL, and TRUE.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), isEdgeGroupable(), SCIPgetSymgraphEdgeColor(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphEdgeColor()

int SCIPgetSymgraphEdgeColor ( SYM_GRAPH graph,
int  edgeidx 
)

returns color of an edge

Parameters
graphsymmetry detection graph
edgeidxindex of edge

Definition at line 1598 of file symmetry_graph.c.

References SYM_Graph::edgecolors, NULL, and SCIPisSymgraphEdgeColored().

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), SYMcheckGraphsAreIdentical(), and SYMcomputeSymmetryGenerators().

◆ SCIPgetSymgraphNVarcolors()

int SCIPgetSymgraphNVarcolors ( SYM_GRAPH graph)

returns the number of unique variable colors in the graph

Parameters
graphsymmetry detection graph

Definition at line 1611 of file symmetry_graph.c.

References SYM_Graph::nsymvars, NULL, and SYM_Graph::nvarcolors.

Referenced by computeSymmetryGroup().

◆ SCIPhasGraphUniqueEdgetype()

SCIP_Bool SCIPhasGraphUniqueEdgetype ( SYM_GRAPH graph)

returns whether the graph has a unique edge type

Parameters
graphsymmetry detection graph

Definition at line 1624 of file symmetry_graph.c.

References NULL, and SYM_Graph::uniqueedgetype.

Referenced by createOrDetermineSizeGraph(), createOrDetermineSizeGraphCheck(), and SYMcomputeSymmetryGenerators().

◆ SCIPallocateSymgraphConsnodeperm()

SCIP_RETCODE SCIPallocateSymgraphConsnodeperm ( SCIP scip,
SYM_GRAPH graph 
)

creates consnodeperm array for symmetry detection graph

Note
colors of symmetry detection graph must have been computed
Parameters
scipSCIP data structure
graphsymmetry detection graph

◆ SCIPcreateSymgraphConsnodeperm()

SCIP_RETCODE SCIPcreateSymgraphConsnodeperm ( SCIP scip,
SYM_GRAPH graph 
)

creates consnodeperm array for symmetry detection graph

Note
colors of symmetry detection graph must have been computed
Parameters
scipSCIP data structure
graphsymmetry detection graph

Definition at line 1637 of file symmetry_graph.c.

References SYM_Graph::consnodeperm, SYM_Graph::islocked, SYM_Graph::nconsnodes, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemoryArray, and SCIPsort().

Referenced by checkSymmetriesAreSymmetries(), and SCIPgetSymgraphConsnodeperm().

◆ SCIPgetSymgraphConsnodeperm()

int* SCIPgetSymgraphConsnodeperm ( SCIP scip,
SYM_GRAPH graph 
)

returns consnodeperm array for symmetry detection graph

Note
colors of symmetry detection graph must have been computed
Parameters
scipSCIP data structure
graphsymmetry detection graph

Definition at line 1675 of file symmetry_graph.c.

References SYM_Graph::consnodeperm, SYM_Graph::islocked, NULL, SCIP_CALL_ABORT, and SCIPcreateSymgraphConsnodeperm().

◆ SCIPfreeSymgraphConsnodeperm()

SCIP_RETCODE SCIPfreeSymgraphConsnodeperm ( SCIP scip,
SYM_GRAPH graph 
)

frees consnodeperm array for symmetry detection graph

Parameters
scipSCIP data structure
graphsymmetry detection graph

Definition at line 1657 of file symmetry_graph.c.

References SYM_Graph::consnodeperm, SYM_Graph::islocked, SYM_Graph::nconsnodes, NULL, SCIP_OKAY, and SCIPfreeBlockMemoryArrayNull.

Referenced by checkSymmetriesAreSymmetries().

◆ SCIPgetSymActiveVariables()

SCIP_RETCODE SCIPgetSymActiveVariables ( SCIP scip,
SYM_SYMTYPE  symtype,
SCIP_VAR ***  vars,
SCIP_Real **  scalars,
int *  nvars,
SCIP_Real constant,
SCIP_Bool  transformed 
)

Transforms given variables, scalars, and constant to the corresponding active variables, scalars, and constant.

For permutation symmetries, active variables as encoded in SCIP are used. For signed permutation symmetries, active variables are shifted such that their domain is centered at 0 (if both their upper and lower bounds are finite).

Note
constant needs to be initialized!
Parameters
scipSCIP data structure
symtypetype of symmetries for which variables are required
varspointer to vars array to get active variables for
scalarspointer to scalars a_1, ..., a_n in linear sum a_1*x_1 + ... + a_n*x_n + c
nvarspointer to number of variables and values in vars and vals array
constantpointer to constant c in linear sum a_1*x_1 + ... + a_n*x_n + c
transformedtransformed constraint?

Definition at line 1697 of file symmetry_graph.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPgetProbvarLinearSum(), SCIPisInfinity(), SCIPreallocBufferArray, SCIPvarGetLbGlobal(), SCIPvarGetOrigvarSum(), SCIPvarGetUbGlobal(), SYM_SYMTYPE_SIGNPERM, and TRUE.

Referenced by addSymmetryInformation(), SCIP_DECL_CONSGETPERMSYMGRAPH(), SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(), tryAddGadgetBilinearProductSignedPerm(), tryAddGadgetEvenOperatorSum(), tryAddGadgetEvenOperatorVariable(), and tryAddGadgetSquaredDifference().

◆ SCIPfreeSymDataExpr()

SCIP_RETCODE SCIPfreeSymDataExpr ( SCIP scip,
SYM_EXPRDATA **  symdata 
)

frees symmetry information of an expression

Parameters
scipSCIP data structure
symdatasymmetry information of an expression

Definition at line 1761 of file symmetry_graph.c.

References NULL, SCIP_OKAY, SCIPfreeBlockMemory, and SCIPfreeBlockMemoryArrayNull.

Referenced by addSymmetryInformation(), isEvenOperator(), SCIPgetCoefSymData(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().

◆ SCIPgetSymExprdataNConstants()

int SCIPgetSymExprdataNConstants ( SYM_EXPRDATA symdata)

returns number of coefficients from exprdata

Parameters
symdatasymmetry information of an expression

Definition at line 1784 of file symmetry_graph.c.

References SYM_ExprData::nconstants, and NULL.

Referenced by addSymmetryInformation(), isEvenOperator(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().

◆ SCIPgetSymExprdataConstants()

SCIP_Real* SCIPgetSymExprdataConstants ( SYM_EXPRDATA symdata)

returns number of coefficients form exprdata

Parameters
symdatasymmetry information of an expression

Definition at line 1794 of file symmetry_graph.c.

References SYM_ExprData::constants, and NULL.

Referenced by addSymmetryInformation(), isEvenOperator(), tryAddGadgetBilinearProductSignedPerm(), and tryAddGadgetSquaredDifference().

◆ SCIPgetCoefSymData()

SCIP_RETCODE SCIPgetCoefSymData ( SCIP scip,
SCIP_EXPR expr,
SCIP_EXPR parentexpr,
SCIP_Real coef,
SCIP_Bool success 
)

gets coefficient of expression from parent expression

Parameters
scipSCIP data structure
exprexpression for which coefficient needs to be found
parentexprparent of expr
coefbuffer to store coefficient
successwhether a coefficient is found

Definition at line 1804 of file symmetry_graph.c.

References SYM_ExprData::children, SYM_ExprData::coefficients, FALSE, SYM_ExprData::ncoefficients, NULL, SCIP_CALL, SCIP_OKAY, SCIPexprGetHdlr(), SCIPexprhdlrHasGetSymData(), SCIPfreeSymDataExpr(), SCIPgetSymDataExpr(), and TRUE.

Referenced by addSymmetryInformation().