DetProbData

class pygcgopt.gcg.DetProbData

class to manage the detection process and data for one coefficient matrix of a MIP, usually there is one detprobdata for the original and one detprobdata for the presolved problem.

addCandidatesNBlocksNVotes(self, int candidate, int nvotes)

adds a candidate for block number and counts how often a candidate is added.

addConsPartition(self, ConsPart partition)

adds a constraint partition if it is no duplicate of an existing constraint partition.

addPartialdecToAncestor(self, PartialDecomposition partialdec)

adds a partialdec to ancestor partialdecs

Parameters

partialdec – partialdec that is added to the ancestor partialdecs.

addPartialdecToFinished(self, PartialDecomposition partialdec)

adds a partialdec to finished partialdecs

Parameters

partialdec – pointer of partialdec that is going to be added to the finished partialdecs (data structure to carry finished decompositions)

Returns

True if the partialdecs was successfully added (i.e. it is no duplicate of a known partialdec)

addPartialdecToFinishedUnchecked(self, PartialDecomposition partialdec)

adds a partialdec to finished partialdecs without checking for duplicates, dev has to check this on his own

Parameters

partialdec – pointer of partialdec that is going to be added unchecked to the finished partialdecs (data structure to carry finished decompositions)

addPartialdecToOpen(self, PartialDecomposition partialdec)

adds a partialdec to current partialdecs (data structure for partialdecs that are goin to processed in the propagation rounds)

Parameters

partialdec – pointer of partialdec to be added

Returns

True if the partialdecs was successfully added (i.e. it is no duplicate of a known partialdec)

addVarPartition(self, VarPart partition)

adds a variable partition if it is no duplicate of an existing variable partition

Parameters

partition – varpartition to be added.

candidatesNBlocks

candidate for the number of blocks, second int indicates how often a candidate was added.

classificationtime

time that was consumed by the classification of the constraint and variables classifiers.

clearAncestorPartialdecs(self)

clears ancestor partialdec data structure, .. note:: does not free the partialdecs themselves.

clearCurrentPartialdecs(self)

clears current partialdec data structure

Note

does not free the partialdecs themselves.

clearFinishedPartialdecs(self)

clears finished partialdec data structure

Note

does not free the partialdecs themselves.

conspartitioncollection

collection of different constraint class distributions.

createConssAdjacency(self)

create the constraint adjacency datastructure that is used (if created) for some methods to faster access the constarints that have variables in common.

freeTemporaryData(self)

frees temporary data that is only needed during the detection process.

getAncestorPartialdec(self, int partialdecindex)

returns a partialdec from ancestor partialdec data structure with given index

Returns

partialdec from ancestor partialdec data structure.

getCons(self, int consIndex)

returns the SCIP constraint related to a constraint index

Returns

the SCIP constraint related to a constraint index.

getConsPartition(self, int partitionIndex)

returns pointer to a constraint partition

Returns

pointer to a cosntraint partition with the given index.

getConssForCons(self, int consIndex)

return array of constraint indices that have a common variable with the given constraint

Returns

return vector of constraint indices that have a common variable with the given constraint

Note

constraint adjacency data structure has to initilized.

getConssForVar(self, int varIndex)

returns the constraint indices of the coefficient matrix for a variable

Returns

vector of constraint indices that have a nonzero entry with this variable.

getFinishedPartialdec(self, int partialdecindex)

returns a partialdec from finished partialdec data structure

Returns

partialdec from finished partialdec data structure.

getFinishedPartialdecs(self)

gets all finished partialdecs

Returns

all finished partialdecs.

getIndexForCons(self, Constraint cons)

returns the constraint index related to a SCIP constraint

Parameters

cons – the SCIP constraint pointer the index is asked for

Returns

the constraint index related to a SCIP constraint.

getModel(self)

returns the corresponding Model instance wrapping the scip data structure

Returns

the corresponding Model instance wrapping scip data structure.

getNAncestorPartialdecs(self)

returns size of ancestor partialdec data structure

Returns

size of ancestor partialdec data structure.

getNConsPartitions(self)

returns number of different constraint partitions

Returns

number of different constraint partitions.

getNConss(self)

returns the number of variables considered in the detprobdata

Returns

number of variables considered in the detprobdata.

getNConssForCons(self, int consIndex)

returns the number of constraints for a given constraint

Returns

the number of constraints for a given constraint.

getNConssForVar(self, int varIndex)

returns the number of constraints for a given variable where the var has a nonzero entry in

Returns

the number of constraints for a given variable.

getNFinishedPartialdecs(self)

size of finished partialdec data structure

Returns

size of finished partialdec data structure.

getNNonzeros(self)

returns the number of nonzero entries in the coefficient matrix

Returns

the number of nonzero entries in the coefficient matrix.

getNOpenPartialdecs(self)

returns size of current (open) partialdec data structure

Returns

size of current (open) partialdec data structure.

getNPartialdecs(self)

returns the number of stored partialdecs

Returns

number of stored partialdecs.

getNVarPartitions(self)

returns number of different variable partitions

Returns

number of different variable partitions.

getNVars(self)

return the number of variables considered in the detprobdata

Returns

the number of variables considered in the detprobdata.

getNVarsForCons(self, int consIndex)

returns the number of variables for a given constraint

Returns

the number of variables for a given constraint.

getOpenPartialdecs(self)

determines all partialdecs from current (open) partialdec data structure

Returns

all partialdecs in current (open) partialdec data structure

getOrigVarsFixedZero(self)

returns pointers to all orig vars that are fixed to zero

Returns

vector of vars.

getRelevantConss(self)

returns pointers to all constraints that are not marked as deleted or obsolete

Returns

vector of conss.

getRelevantVars(self)

returns pointers to all problem vars that are not fixed to 0

Returns

vector of vars.

getSortedCandidatesNBlocks(self, candidates)

gets the candidates for number of blocks added by the user followed by the found ones sorted in descending order by how often a candidate was proposed

Parameters

candidates – will contain the candidates for number of blocks sorted in descending order by how often a candidate was added.

getVal(self, int row, int col)

returns a coefficient from the coefficient matrix

Returns

a coefficient from the coefficient matrix.

getValsForCons(self, int consIndex)

returns the nonzero coefficients of the coefficient matrix for a constraint

Returns

vector of coefficients of in matrix for constraints

Note

same order as in getVarsForCons().

getVar(self, int varIndex)

returns SCIP variable related to a variable index

Returns

SCIP variable pointer related to a variable index.

getVarPartition(self, int partitionIndex)

returns pointer to a variable partition with given index

Returns

pointer to a variable partition with given index.

getVarPartitions(self)

returns vector to stored variable partitions

Returns

returns vector to stored variable partitions.

getVarsForCons(self, int consIndex)

returns the variable indices of the coefficient matrix for a constraint

Returns

the variable indices of the coefficient matrix for a constraint.

isAssignedToOrigProb(self)

returns True if the matrix structure corresponds to the presolved problem

Returns

True if the matrix structure corresponds to the presolved problem.

isConsCardinalityCons(self, int consindexd)

returns whether a constraint is a cardinality constraint, i.e. of the .. math::sum_{i} x_i = b

Parameters

consindexd – index of constraint that is be checked

Returns

returns whether a constraint is a cardinality constraint

isConsSetpp(self, int consindexd)

is cons with specified indec partitioning, or packing covering constraint?

Parameters

consindexd – index of the given cons

Returns

is cons with specified indec partitioning, or packing covering constraint.

isConsSetppc(self, int consindexd)

is cons with specified index partitioning packing, or covering constraint?

Parameters

consindexd – index of cons to be checked

Returns

whether a constraint is partitioning packing, or covering constraint?.

isConssAdjInitialized(self)

determines whether or not the constraint-constraint adjacency data structure is initilized

Returns

True iff the constraint-constraint adjacency data structure is initilized.

isPartialdecDuplicateofFinished(self, PartialDecomposition partialdec)

check if partialdec is a duplicate of an existing finished partialdec

Parameters

partialdec – partialdec to be checked

Returns

True iff partialdec is a duplicate of an existing finished partialdec.

nblockscandidatescalctime

time that was used to calulate the candidates of te block number.

partialdecIsNoDuplicateOfPartialdecs(self, PartialDecomposition comppartialdec, partialdecs, bool sort)

check if partialdec is a duplicate of any given partialdecs

Parameters
  • comppartialdec – partialdec to be checked

  • partialdecs – partialdecs to compare with

  • sort – sort the vars and conss data structures in the partialdecs by their indices

Returns

True iff partialdec is no duplicate of any given partialdecs.

postprocessingtime

time that was spent in postproceesing decomposigtions.

sortFinishedForScore(self)

sorts partialdecs in finished partialdecs data structure according to the current scoretype.

translatePartialdecs(self, DetProbData otherdata, otherpartialdecs)

translates partialdecs if the index structure of the problem has changed, e.g. due to presolving

Returns

translated partialdecs

translatingtime

time that was spent by transforming partialdecs between presolved and orig problem.

varpartitioncollection

collection of different variable class distributions.