44 #define PROP_NAME "orbitalfixing" 45 #define PROP_DESC "propagator for orbital fixing" 46 #define PROP_TIMING SCIP_PROPTIMING_BEFORELP 47 #define PROP_PRIORITY -1000000 49 #define PROP_DELAY FALSE 52 #define TABLE_NAME_ORBITALFIXING "orbitalfixing" 53 #define TABLE_DESC_ORBITALFIXING "orbital fixing statistics" 54 #define TABLE_POSITION_ORBITALFIXING 7001 55 #define TABLE_EARLIEST_ORBITALFIXING SCIP_STAGE_SOLVING 95 assert(
scip != NULL );
96 assert( table != NULL );
99 assert( tabledata != NULL );
100 assert( tabledata->propdata != NULL );
102 if ( tabledata->propdata->enabled )
119 assert( tabledata != NULL );
154 assert( scip != NULL );
155 assert( permvars != NULL );
156 assert( orbits != NULL );
157 assert( orbitbegins != NULL );
158 assert( infeasible != NULL );
159 assert( nfixedzero != NULL );
160 assert( nfixedone != NULL );
161 assert( norbits > 0 );
162 assert( orbitbegins[0] == 0 );
168 SCIPdebugMsg(scip,
"Perform orbital fixing on %d orbits.\n", norbits);
171 for (i = 0; i < norbits; ++i)
179 assert( orbitbegins[i+1] - orbitbegins[i] >= 2 );
182 for (j = orbitbegins[i]; j < orbitbegins[i+1]; ++j)
184 assert( 0 <= orbits[j] && orbits[j] < npermvars );
185 var = permvars[orbits[j]];
186 assert( var != NULL );
192 havefixedone =
FALSE;
193 havefixedzero =
FALSE;
203 havefixedzero =
TRUE;
207 if ( havefixedone && havefixedzero )
216 assert( ! havefixedone );
218 for (j = orbitbegins[i]; j < orbitbegins[i+1]; ++j)
220 assert( 0 <= orbits[j] && orbits[j] < npermvars );
221 var = permvars[orbits[j]];
222 assert( var != NULL );
244 assert( ! havefixedzero );
246 for (j = orbitbegins[i]; j < orbitbegins[i+1]; ++j)
248 assert( 0 <= orbits[j] && orbits[j] < npermvars );
249 var = permvars[orbits[j]];
250 assert( var != NULL );
285 assert( scip != NULL );
286 assert( varmap != NULL );
287 assert( b1 != NULL );
288 assert( success != NULL );
310 assert( domchg != NULL );
314 for (i = 0; i < nboundchgs; ++i)
318 assert( boundchg != 0 );
344 assert( branchvaridx < nvars );
345 b1[branchvaridx] =
TRUE;
382 assert( scip != NULL );
383 assert( propdata != NULL );
384 assert( infeasible != NULL );
385 assert( nprop != NULL );
390 assert( propdata->permvars != NULL );
391 assert( propdata->npermvars > 0 );
392 assert( propdata->permvarmap != NULL );
393 assert( propdata->perms != NULL );
395 permvars = propdata->permvars;
396 npermvars = propdata->npermvars;
397 perms = propdata->perms;
398 nperms = propdata->nperms;
404 for (v = 0; v < npermvars; ++v)
420 assert( permvarsobj != NULL );
423 for (p = 0; p < nperms; ++p)
425 assert( perms[p] != NULL );
427 for (v = 0; v < npermvars; ++v)
436 assert(
SCIPisEQ(scip, permvarsobj[v], permvarsobj[img]) );
439 if ( b1[v] && ! b1[img] )
444 if ( v >= npermvars )
445 activeperms[p] =
TRUE;
447 activeperms[p] =
FALSE;
466 propdata->nfixedzero += nfixedzero;
467 propdata->nfixedone += nfixedone;
468 *nprop = nfixedzero + nfixedone;
470 SCIPdebugMsg(scip,
"Orbital fixings: %d 0s, %d 1s.\n", nfixedzero, nfixedone);
493 assert( prop != NULL );
498 assert( propdata != NULL );
513 assert( prop != NULL );
518 assert( propdata != NULL );
523 propdata->enabled =
TRUE;
526 propdata->enabled =
FALSE;
529 if ( propdata->enabled )
545 assert( prop != NULL );
548 assert( propdata != NULL );
550 if ( propdata->permvarmap != NULL )
556 propdata->nodenumber = -1;
557 propdata->nfixedzero = 0;
558 propdata->nfixedone = 0;
560 propdata->permvars = NULL;
561 propdata->npermvars = -1;
562 propdata->permvarmap = NULL;
574 assert(
scip != NULL );
575 assert( prop != NULL );
579 assert( propdata != NULL );
582 if ( ! propdata->enabled )
595 if ( propdata->npermvars < 0 )
599 if ( propdata->nperms <= 0 )
602 propdata->enabled =
FALSE;
609 assert( propdata->permvarmap == NULL );
613 for (j = 0; j < propdata->npermvars; ++j)
633 assert(
scip != NULL );
634 assert( result != NULL );
653 assert( propdata != NULL );
656 if ( ! propdata->enabled )
660 if ( propdata->npermvars == 0 || propdata->permvars == NULL )
665 if ( nodenumber == propdata->nodenumber )
667 propdata->nodenumber = nodenumber;
676 else if ( nprop > 0 )
694 assert( result != NULL );
714 propdata->nodenumber = -1;
715 propdata->nfixedzero = 0;
716 propdata->nfixedone = 0;
718 propdata->permvars = NULL;
719 propdata->npermvars = -1;
720 propdata->permvarmap = NULL;
734 tabledata->propdata = propdata;
736 NULL, tableFreeOrbitalfixing, NULL, NULL, NULL, NULL, tableOutputOrbitalfixing,
static SCIP_DECL_PROPINIT(propInitOrbitalfixing)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define TABLE_POSITION_ORBITALFIXING
SCIP_RETCODE SCIPincludeTable(SCIP *scip, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
public methods for branch and bound tree
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_NODE * SCIPnodeGetParent(SCIP_NODE *node)
static SCIP_DECL_PROPRESPROP(propRespropOrbitalfixing)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
enum SCIP_Retcode SCIP_RETCODE
static SCIP_RETCODE performOrbitalFixing(SCIP *scip, SCIP_VAR **permvars, int npermvars, int *orbits, int *orbitbegins, int norbits, SCIP_Bool *infeasible, int *nfixedzero, int *nfixedone)
SCIP_RETCODE SCIPcomputeGroupOrbitsSymbreak(SCIP *scip, SCIP_VAR **permvars, int npermvars, int **perms, int nperms, SCIP_Shortbool *activeperms, int *orbits, int *orbitbegins, int *norbits)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
presolver for adding symmetry breaking constraints
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPnodeGetDepth(SCIP_NODE *node)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
public methods for displaying statistic tables
static SCIP_DECL_PROPEXIT(propExitOrbitalfixing)
SCIP_STATUS SCIPgetStatus(SCIP *scip)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_DOMCHG * SCIPnodeGetDomchg(SCIP_NODE *node)
SCIP_RETCODE SCIPgetIntParam(SCIP *scip, const char *name, int *value)
static SCIP_DECL_PROPFREE(propFreeOrbitalfixing)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPregisterSymmetry(SCIP *scip, SYM_HANDLETYPE symtype, SYM_SPEC type, SYM_SPEC fixedtype)
static SCIP_RETCODE computeBranchingVariables(SCIP *scip, int nvars, SCIP_HASHMAP *varmap, SCIP_Shortbool *b1, SCIP_Bool *success)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetPropInit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINIT((*propinit)))
SCIP_BOUNDCHGTYPE SCIPboundchgGetBoundchgtype(SCIP_BOUNDCHG *boundchg)
static SCIP_DECL_PROPEXEC(propExecOrbitalfixing)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPincludePropOrbitalfixing(SCIP *scip)
SCIP_VAR * SCIPboundchgGetVar(SCIP_BOUNDCHG *boundchg)
propagator for orbital fixing
SCIP_BOUNDCHG * SCIPdomchgGetBoundchg(SCIP_DOMCHG *domchg, int pos)
static SCIP_DECL_PROPINITSOL(propInitsolOrbitalfixing)
static SCIP_DECL_TABLEFREE(tableFreeOrbitalfixing)
int SCIPgetNRuns(SCIP *scip)
#define TABLE_NAME_ORBITALFIXING
SCIP_Bool SCIPinProbing(SCIP *scip)
const char * SCIPpropGetName(SCIP_PROP *prop)
static SCIP_RETCODE propagateOrbitalFixing(SCIP *scip, SCIP_PROPDATA *propdata, SCIP_Bool *infeasible, int *nprop)
static SCIP_DECL_TABLEOUTPUT(tableOutputOrbitalfixing)
SCIP_RETCODE SCIPprintNodeRootPath(SCIP *scip, SCIP_NODE *node, FILE *file)
#define SYM_HANDLETYPE_ORBITALFIXING
SCIP_RETCODE SCIPsetPropResprop(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPRESPROP((*propresprop)))
SCIP_RETCODE SCIPgetPermvarsObjSymmetry(SCIP *scip, SCIP_Real **permvarsobj)
int SCIPdomchgGetNBoundchgs(SCIP_DOMCHG *domchg)
presolver for storing symmetry information about current problem
SCIP_RETCODE SCIPsetPropInitsol(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPINITSOL((*propinitsol)))
struct SCIP_PropData SCIP_PROPDATA
SCIP_Bool SCIPisStopped(SCIP *scip)
#define TABLE_EARLIEST_ORBITALFIXING
SCIP_TABLEDATA * SCIPtableGetData(SCIP_TABLE *table)
SCIP_RETCODE SCIPsetPropFree(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPFREE((*propfree)))
SCIP_PROPDATA * SCIPpropGetData(SCIP_PROP *prop)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define TABLE_DESC_ORBITALFIXING
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPsetPropExit(SCIP *scip, SCIP_PROP *prop, SCIP_DECL_PROPEXIT((*propexit)))
SCIP_RETCODE SCIPgetGeneratorsSymmetry(SCIP *scip, int *npermvars, SCIP_VAR ***permvars, int *nperms, int ***perms, SCIP_Real *log10groupsize)
struct SCIP_TableData SCIP_TABLEDATA
SCIP_RETCODE SCIPincludePropBasic(SCIP *scip, SCIP_PROP **propptr, const char *name, const char *desc, int priority, int freq, SCIP_Bool delay, SCIP_PROPTIMING timingmask, SCIP_DECL_PROPEXEC((*propexec)), SCIP_PROPDATA *propdata)