Loading...
Searching...
No Matches
class_partialdecomp.h
Go to the documentation of this file.
39/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
65 * @brief enumeration to display if a decomposition was given by the user and if so, how it was processed after adding
72 COMPLETED_CONSTOMASTER = - 3 /**< this partialdec was partially given by the user and then completed by setting all missing constraints to the master*/
88 * The new partialdec is created using the constraint and variable names of a pricing problem created by GCG.
91 DETPROBDATA* parentdetprobdata, /**< parent detprobdata (the one that fits to the stored con/var ids) */
104 std::vector<std::vector<int>> blockconss; /**< vector of vectors (for each block) containing the block constraints */
105 std::vector<BLOCK_STRUCTURE*> blockstructures; /**< vector containing pointers to block structures for each block (if available) */
106 std::vector<int> symmetricalblocks; /**< vector containing for each block an id of a block that is symmetrical */
107 std::unordered_map<int, int> symmetryvardata; /**< symmetry information of variables (mapping) */
128 std::vector<int> mastervars; /**< vector containing indices of master variables (these variables are supposed to have all nonzero entries in master constraints) */
129 std::vector<std::vector<int>> conssforblocks; /**< conssforblocks[k] contains a vector of indices of all
131 std::vector<std::vector<int>> varsforblocks; /**< varsforblocks[k] contains a vector of indices of all
134 std::vector<std::vector<int>> linkingvarsforblocks; /**< vector of vectors containing indices of linking variables for each block */
135 std::vector<std::vector<int>> stairlinkingvars; /**< vector containing indices of staircase linking variables
144 std::vector<bool> isvarmaster; /**< whether ith variable is assigned to be a only-master variable */
145 std::vector<bool> isconsmaster; /**< whether ith constraint is assigned to be a master constraint */
150 std::vector<std::vector<int>> ncoeffsforblockformastercons; /**< number of coeffs a block has in a certain master constraint */
153 bool stairlinkingvarsforblocksorted; /**< bool to store if the stairlinkingvarsforblock datastructure is sorted atm */
154 bool conssforblocksorted; /**< bool to store if the conssforblock datastructure is sorted atm */
157 bool masterconsssorted; /**< bool to store if the masterconsssorted datastructure is sorted atm */
159 unsigned long hashvalue; /**< hash value of this partial decomposition, decompositions with same has value are considered to be identical */
160 bool hvoutdated; /**< true if the internal structure changed such that the hash value needs to be recalculated */
164 bool isagginfoalreadytoexpensive; /**< is agginfo already known to be to expensive to calculate*/
169 bool isfinishedbyfinisher; /**< was this partialdec finished by the finishpartialdec() method of a detector */
173 std::vector<std::vector<int>> eqclasstoblocks; /**< translation of the equivalence classes to blocks (first block at index 0 is the representative block of the class) */
174 std::vector<int> blockstoeqclasses; /**< translation of the blocks to the equivalence classes */
175 std::vector<std::vector<std::vector<int>>> eqclassesvarmappings; /**< stores for each equivalence class (first index) and for each block of the class (second index) a mapping that maps the indices of the probvars (third index) of the block to the indices of the probvars (actual value) of the representative block */
178 std::vector<GCG_DETECTOR*> detectorchain; /**< vector containing detectors that worked on that partialdec */
179 std::vector<std::string> detectorchaininfo; /**< vector containing information about the detector call */
181 std::vector<SCIP_Real> pctvarstoborder; /**< vector containing the fraction of variables assigned to the
183 std::vector<SCIP_Real> pctvarstoblock; /**< vector containing the fraction of variables assigned to a block
185 std::vector<SCIP_Real> pctvarsfromfree; /**< vector containing the fraction of variables that are not longer
187 std::vector<SCIP_Real> pctconsstoborder; /**< vector containing the fraction of constraints assigned to the
189 std::vector<SCIP_Real> pctconsstoblock; /**< vector containing the fraction of constraints assigned to a block
191 std::vector<SCIP_Real> pctconssfromfree; /**< vector containing the fraction of constraints that are not longer
193 std::vector<int> nnewblocks; /**< vector containing information how many new blocks a detector has assigned */
195 std::vector<IndexPartition*> usedpartition; /**< vector containing pointer to the cons- or varpartitions
198 std::vector<std::vector<int>> classestomaster; /**< vector containing the vector of classindices that were assigned
201 std::vector<std::vector<int>> classestolinking; /**< vector containing the vector of classindices that were assigned
205 std::vector<int> listofancestorids; /**< vector containing decomposition indices that are ancestors of this partialdec */
209 /* datastructure to store the score values of a score ( SCIP_INVALID iff score not computed yet) */
212 /* datastructure to store information if this partialdec stems from a partialdec concerning the orig problem */
213 bool stemsfromorig; /**< partialdec has at least one ancestor that is a partialdec from orig problem */
215 bool isfinishedbyfinisherorig; /**< was the ancestor partialdec for the unpresolved problem finished by the
220 std::vector<BLOCK_STRUCTURE*> blockstructures; /**< structure information for each block (empty iff decomposition is not nested)*/
235 std::vector<int>& varmap, /**< maps variable indices (corresponding to detprobdata indices) of block 2 to block 1 */
236 SCIP_HASHMAP* varmap2, /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
252 std::vector<int>& varmap, /**< maps variable indices (corresponding to detprobdata indices) of prob2 to prob1 */
253 SCIP_HASHMAP* varmap2, /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
278 bool originalProblem /**< true iff partialdec is for presolved problem (else for original problem) */
336 * bookkeeping information: adds number of new blocks created by a detector added to detector chain
346 * bookkeeping information: fraction of constraints that are not longer open for a detector added to detector chain
356 * bookkeeping information: adds fraction of constraints assigned to a block for a detector added to detector chain
366 * bookkeeping information: adds fraction of constraints assigned to the border for a detector added to detector chain
376 * bookkeeping information: adds fraction of variables that are not longer open for a detector added to detector chain
387 * bookkeeping information: adds fraction of variables assigned to a block for a detector added to detector chain
397 * bookkeeping information: adds fraction of variables assigned to the border for a detector added to detector chain
414 * assigns open constraints to master according to the cons assignment information given in constoblock hashmap
416 * @note for conss assigned to blocks according to constoblock there is no assignment \see assignPartialdecFromConstoblock
421 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
451 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
465 std::vector<int> constoblock, /**< vector containing an assignment of conss to a block or to master */
488 * if all vars that connect exactly two blocks have a staircase structure, all of them become stairlinkingvars
490 * call PARTIALDEC::findVarsLinkingToStairlinking afterwards (this is also done by PARTIALDEC::prepare())
527 * strategy: assigns all open conss and vars to blocks if they can be refined there, otherwise to the master
529 * @note partialdecomps should usually be completed by a detector, only use this function if you know what you are doing.
600 * @param variables if true, then blocks with no constraints but at least one variable are considered to be nonempty
670 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
682 * @note precondition: no cons or var is already assigned to a block and constoblock contains information for every cons */
685 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
768 * @brief returns the time that the detector related to the given detectorchainindex needed for detecting
777 * @brief returns a vector of the clock times that each detector needed that was involved in this partialdec
801 * @brief returns true iff this partialdec was finished by finishPartialdec() method of a detector
911 * @brief checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
912 * @return TRUE iff all master constraints set partitioning, set packing, set cover, or cardinality constraints
919 * @brief checks iff all master constraints set partitioning, set packing, or set cover constraints
1125 * @return vector of fractions of variables assigned to the border for detectors in detectorchain
1159 * @return vector or fractions of variables that are not longer open for detectors in detectorchain
1175 * @return vector of fractions of constraints assigned to the border for detectors in detectorchain
1191 * @return vector of fractions of constraints assigned to a block for detectors in detectorchain
1207 * @return vector of fractions of constraints that are not longer open for detectors in detectorchain
1223 * @brief Returns a vector that maps probvar indices of a block contained in an equivalence class to the probvar indices of the representative block of the class
1244 * @note if a stairlinking variable links block i and i+1 it is only stored in vector of block i
1264 * @brief Gets the index of a variable in the vector returned by PARTIALDECOMP::getVarsForBlock.
1325 * @brief method to check whether this partialdec is equal to a given other partialdec ( \see isEqual(PARTIALDECOMP*))
1461 * (without respect to open vars and conss @see assignHittingOpenconss(), @see assignHittingOpenvars())
1483 std::vector<int>& consclassesmaster /**< vector of classindices that were assigned to master */
1521 * @brief adds a constraint to the master constraints, does not delete this cons from list of open conss
1533 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1543 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1553 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1590 * @note does not add the detector to the detectorchain and does not modify partition statistics
1606 * @brief sets whether this partialdec was finished by a finishing detector in the original problem
1667 std::vector<int>& varclasseslinking, /**< vector of classindices that were assigned to linking */
1672 * @brief adds a variable to the linking variables, does not delete this var from list of open vars
1698 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1707 * @brief adds a variable to the linking variables, does not delete this var from list of open vars
1728 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1735 /** @brief adds a variable to the master variables, does not delete this var from list of open vars
1757 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1765 * @brief adds a variable to the stairlinking variables, does not delete this var from list of open vars
1781 * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
1793 * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
1795 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1868 * @param outputformat The format of the gnuplot output. Should match the file extension of outname
1882 * @param outputformat The format of the gnuplot output. Should match the file extension of outname
1914 * @brief set statistical vector of fractions of constraints set to blocks per involved detector
1923 * @brief set statistical vector of fractions of constraints that are not longer open per involved detector
1924 * @param newvector vector of fractions of constraints that are not longer open per involved detector
1932 * @brief set statistical vector of fractions of constraints assigned to the border per involved detector
1933 * @param newvector vector of fractions of constraints assigned to the border per involved detector
1941 * @brief set statistical vector of fraction of variables assigned to the border per involved detector
1942 * @param newvector vector of fractions of variables assigned to the border per involved detector
1950 * @brief set statistical vector of fractions of variables assigned to a block per involved detector
1960 * @param newvector vector of fractions of variables that are not longer open per involved detector
1968 * @brief set statistical vector of the times that the detectors needed for detecting per involved detector
1969 * @param newvector vector of the times that the detectors needed for detecting per involved detector
1978 * "maximum white score" is fraction of the area of the decomposed matrix that is neither block or border
2001 * checks if aggregation of sub problems is possible and stores the corresponding aggregation information
2003 * @param ignoreDetectionLimits Set to true if computation should ignore detection limits. This parameter is ignored if the patched bliss version is not present.
2027 * @brief creates a detector chain short string for this partialdec, is built from detector chain
2043 * @brief creates a detector chain short string for this partialdec, is built from detector chain
2051 * Each block b must be mapped to its representative block rb with rb <= b. Furthermore, rb must be mapped to itself.
2052 * It is assumed that a variable assigned to a representative block is mapped to itself (varmapping does not have
2056 * @param varmapping function that maps tuples (block, variable index (in the block)) to the indices of the representative variables (in their blocks)
2069 * @brief adds empty entries for all partition statistics for a detector added to the detector chain
2079 * - to the block with the lowest number of conss if it hits a stairlinking var and there are blocks the cons may be
2106 * @brief assigns open conss/vars that hit exactly one block and at least one open var/cons to border
2132 * counts for each pair of block and master constraint, how many nonzero entries the variables of the blocks
2140 * changes the block order in a way such that all linking vars that are potentially stairlinking
2190 std::vector<int>& consclassesmaster /**< a vector containing all indices of the consclasses assigned to master
2210 bool displayConssVars /**< pass true if constraints and variables of the respective classes should be displayed */
2226 std::vector<int>& varclasseslinking, /**< a vector containing all indices of the varclasses assigned to linking (set by method) */
class representing a partition of a set of constraints
class representing a partition of a set of variables
Definition class_conspartition.h:60
Definition class_detprobdata.h:110
Definition graph_gcg.h:59
GCG_EXPORT std::vector< SCIP_Real > & getPctVarsToBorderVector()
Gets fraction of variables assigned to the border for detectors in detectorchain.
Definition class_partialdecomp.cpp:4580
GCG_EXPORT SCIP_Real getDetectorClockTime(int detectorchainindex)
returns the time that the detector related to the given detectorchainindex needed for detecting
Definition class_partialdecomp.cpp:3921
GCG_EXPORT int getNMasterconss()
Gets size of the vector containing master conss.
Definition class_partialdecomp.cpp:4481
GCG_EXPORT bool fixVarToMasterByName(const char *varname)
assigns a variable with given name as master
Definition class_partialdecomp.cpp:5687
GCG_EXPORT SCIP_Bool shouldCompletedByConsToMaster()
Checks whether this partialdec is a userpartialdec that should be completed.
Definition class_partialdecomp.cpp:5801
GCG_EXPORT SCIP_Bool hasSetppcMaster()
checks iff all master constraints set partitioning, set packing, or set cover constraints
Definition class_partialdecomp.cpp:3444
GCG_EXPORT bool isVarStairlinkingvarOfBlock(int var, int block)
Checks whether the var is a stairlinkingvar of a specified block.
Definition class_partialdecomp.cpp:5071
GCG_EXPORT bool fixConsToMasterByName(const char *consname)
assgins a constraint by name as master
Definition class_partialdecomp.cpp:5673
GCG_EXPORT std::vector< GCG_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
Definition class_partialdecomp.cpp:3977
GCG_EXPORT void fixVarToStairlinking(int var, int firstblock)
adds a variable to the stairlinking variables
Definition class_partialdecomp.cpp:5611
GCG_EXPORT int getNEquivalenceClasses()
Gets the number of blockrepresentatives.
Definition class_partialdecomp.cpp:4515
GCG_EXPORT void assignSmallestComponentsButOneConssAdjacency()
computes components by connectedness of conss and vars
Definition class_partialdecomp.cpp:1094
GCG_EXPORT bool isConsMastercons(int cons)
Gets whether the cons is a master cons.
Definition class_partialdecomp.cpp:4817
GCG_EXPORT SCIP_RETCODE filloutBorderFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
every constraint is either assigned to master or open
Definition class_partialdecomp.cpp:3492
GCG_EXPORT std::vector< int > & getStairlinkingvars(int block)
Gets vector containing stairlinking vars,.
Definition class_partialdecomp.cpp:4747
GCG_EXPORT void setVarToBlock(int varToBlock, int block)
adds a variable to the linking variables, does not delete this var from list of open vars
Definition class_partialdecomp.cpp:5442
GCG_EXPORT void setAncestorList(std::vector< int > &newlist)
Definition class_partialdecomp.cpp:3883
GCG_EXPORT SCIP_Real getScore(GCG_SCORE *score)
returns the score of the partialdec
Definition class_partialdecomp.cpp:4347
GCG_EXPORT void completeByConnectedConssAdjacency()
assigns all open constraints and open variables
Definition class_partialdecomp.cpp:2437
GCG_EXPORT void setTranslatedpartialdecid(int decid)
Definition class_partialdecomp.cpp:5912
GCG_EXPORT void setPctVarsToBlockVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fractions of variables assigned to a block per involved detector
Definition class_partialdecomp.cpp:4611
GCG_EXPORT void refineToMaster()
refine partialdec with focus on master
Definition class_partialdecomp.cpp:5178
GCG_EXPORT int getAncestorID(int ancestorindex)
gets partialdec id of given ancestor id
Definition class_partialdecomp.cpp:3853
GCG_EXPORT void setVarToStairlinking(int varToStairLinking, int block1, int block2)
adds a variable to the stairlinking variables, does not delete this var from list of open vars
Definition class_partialdecomp.cpp:5590
GCG_EXPORT SCIP_Real getPctConssToBorder(int detectorchainindex)
Gets fraction of constraints assigned to the border for a detector.
Definition class_partialdecomp.cpp:4643
GCG_EXPORT void setVarToLinking(int varToLinking)
adds a variable to the linking variables, does not delete this var from list of open vars
Definition class_partialdecomp.cpp:5491
GCG_EXPORT bool checkConsistency()
Checks whether the assignments in the partialdec are consistent.
Definition class_partialdecomp.cpp:1722
GCG_EXPORT void setSelected(bool selected)
set the selection status of this partialdecs
Definition class_partialdecomp.cpp:5395
GCG_EXPORT void setPctVarsToBorderVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fraction of variables assigned to the border per involved detector
Definition class_partialdecomp.cpp:4586
GCG_EXPORT void addAncestorID(int ancestor)
Definition class_partialdecomp.cpp:3891
GCG_EXPORT SCIP_Real getPctVarsToBorder(int detectorchainindex)
Gets fraction of variables assigned to the border for a detector.
Definition class_partialdecomp.cpp:4570
GCG_EXPORT int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
Definition class_partialdecomp.cpp:4521
GCG_EXPORT void exportVisualization()
generates a gp visualization of the partialdec without compilation or opening
Definition class_partialdecomp.cpp:5789
GCG_EXPORT bool fixConsToBlockByName(const char *consname, int blockid)
assigns a constraint by name to a block
Definition class_partialdecomp.cpp:5639
GCG_EXPORT std::vector< SCIP_Real > & getPctConssToBlockVector()
Gets fraction of constraints assigned to a block for detectors in detectorchain.
Definition class_partialdecomp.cpp:4677
GCG_EXPORT USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
Definition class_partialdecomp.cpp:4408
GCG_EXPORT void setNBlocks(int nblocks)
sets number of blocks, only increasing number allowed
Definition class_partialdecomp.cpp:5350
GCG_EXPORT std::vector< SCIP_Real > & getDetectorClockTimes()
returns a vector of the clock times that each detector needed that was involved in this partialdec
Definition class_partialdecomp.cpp:3931
GCG_EXPORT bool isAssignedToPresolvedProb()
Gets whether the partialdec is from the presolved problem.
Definition class_partialdecomp.cpp:4841
GCG_EXPORT bool fixVarToLinkingByName(const char *varname)
assigns a variable by name to the linking variables
Definition class_partialdecomp.cpp:5701
std::vector< BLOCK_STRUCTURE * > & getBlockStructures()
Returns the structure information of all blocks.
Definition class_partialdecomp.cpp:4328
GCG_EXPORT void fixConsToBlock(int cons, int block)
adds a constraint to a block
Definition class_partialdecomp.cpp:5220
GCG_EXPORT int getNOpenvars()
Gets size of vector containing variables not assigned yet.
Definition class_partialdecomp.cpp:4509
GCG_EXPORT void displayInfo(int detailLevel)
displays the relevant information of the partialdec
Definition class_partialdecomp.cpp:3163
GCG_EXPORT bool isVarLinkingvar(int var)
Checks whether the var is a linking var.
Definition class_partialdecomp.cpp:5018
GCG_EXPORT int getNCoeffsForBlock(int blockid)
Gets the number of nonzero coeffs in a certain block.
Definition class_partialdecomp.cpp:4298
GCG_EXPORT bool fixVarToBlockByName(const char *varname, int blockid)
assigns a variable by name to a block
Definition class_partialdecomp.cpp:5655
GCG_EXPORT void removeAncestorID(int ancestorid)
Definition class_partialdecomp.cpp:3900
GCG_EXPORT int getVarProbindexForBlock(int varid, int block)
Gets the index of a variable in the vector returned by PARTIALDECOMP::getVarsForBlock.
Definition class_partialdecomp.cpp:4780
GCG_EXPORT bool setSymmetryInformation(std::function< int(int)> blockmapping, std::function< int(int, int)> varmapping)
sets symmetry information
Definition class_partialdecomp.cpp:5929
GCG_EXPORT unsigned long getHashValue()
returns the calculated hash value of this partialdec
Definition class_partialdecomp.cpp:4248
GCG_EXPORT std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
Definition class_partialdecomp.cpp:4286
GCG_EXPORT PARTIALDECOMP(GCG *gcgstruct, bool originalProblem)
Standard constructor, creates empty partialdec with unique id.
Definition class_partialdecomp.cpp:244
GCG_EXPORT bool checkAllConssAssigned()
checks if all conss are assigned
Definition class_partialdecomp.cpp:1687
GCG_EXPORT void addPctVarsToBorder(SCIP_Real pct)
adds percentage of variables assigned to border
Definition class_partialdecomp.cpp:549
GCG_EXPORT int getNDetectors()
Gets the number of detectors the partialdec is propagated by.
Definition class_partialdecomp.cpp:4447
GCG_EXPORT void completeGreedily()
assigns all open constraints and open variables
Definition class_partialdecomp.cpp:2537
GCG_EXPORT bool alreadyAssignedConssToBlocks()
method to check if at least one constraint is assigned to some block
Definition class_partialdecomp.cpp:557
GCG_EXPORT std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
Definition class_partialdecomp.cpp:3968
GCG_EXPORT const std::vector< int > & getBlocksForEqClass(int eqclass)
get a vector of block ids that are contained in the equivalence class eqclass
Definition class_partialdecomp.cpp:3868
GCG_EXPORT void setVarToMaster(int varToMaster)
adds a variable to the master variables, does not delete this var from list of open vars
Definition class_partialdecomp.cpp:5554
GCG_EXPORT void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
Definition class_partialdecomp.cpp:5842
GCG_EXPORT void addDetectorChainInfo(const char *decinfo)
add information about the detector chain
Definition class_partialdecomp.cpp:482
GCG_EXPORT void removeMastercons(int consid)
removes the given cons from master
Definition class_partialdecomp.cpp:2784
void setBlockStructure(int block, BLOCK_STRUCTURE *blockstructure)
sets structure information of a specific block
Definition class_partialdecomp.cpp:5378
GCG_EXPORT DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
Definition class_partialdecomp.cpp:4725
GCG_EXPORT bool isComplete()
Gets whether this partialdec is complete, i.e. it has no more open constraints and variables.
Definition class_partialdecomp.cpp:4796
GCG_EXPORT void setFinishedByFinisher(bool finished)
sets whether this partialdec was finished by a finishing detector
Definition class_partialdecomp.cpp:5334
GCG_EXPORT void setPctConssFromFreeVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fractions of constraints that are not longer open per involved detector
Definition class_partialdecomp.cpp:4739
GCG_EXPORT void addPctVarsFromFree(SCIP_Real pct)
adds percentage of closed variables
Definition class_partialdecomp.cpp:533
int getNVarsOfBlockInMasterCons(int masterconsindex, int block)
returns the number of block vars contained in a master constraint
Definition class_partialdecomp.cpp:5919
GCG_EXPORT SCIP_Real getPctVarsToBlock(int detectorchainindex)
Gets fraction of variables assigned to a block for a detector.
Definition class_partialdecomp.cpp:4594
GCG_EXPORT bool isVarMastervar(int var)
Checks whether the var is a master var.
Definition class_partialdecomp.cpp:5009
GCG_EXPORT int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition class_partialdecomp.cpp:4503
GCG_EXPORT void calcAggregationInformation(bool ignoreDetectionLimits)
computes if aggregation of sub problems is possible
Definition class_partialdecomp.cpp:1270
bool isNested()
Checks whether this is a nested decomposition.
Definition class_partialdecomp.cpp:4957
GCG_EXPORT int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
Definition class_partialdecomp.cpp:4537
GCG_EXPORT bool isVarOpenvar(int var)
Checks whether the var is an open var.
Definition class_partialdecomp.cpp:5048
GCG_EXPORT void setDetectorFinished(GCG_DETECTOR *detector)
sets detector that finished the partialdec
Definition class_partialdecomp.cpp:5317
GCG_EXPORT void fixVarToLinking(int var)
adds a variable to the linking variables
Definition class_partialdecomp.cpp:5502
GCG_EXPORT bool aggInfoCalculated()
Checks if the aggregation information was already calculated.
Definition class_partialdecomp.cpp:5902
GCG_EXPORT std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
Definition class_partialdecomp.cpp:4261
SCIP_Real calcBlockAreaScore()
gets an intermediate score value for the blocks of a partialdec
Definition class_partialdecomp.cpp:4388
GCG_EXPORT void fixVarToMaster(int var)
adds a variable to the master variables
Definition class_partialdecomp.cpp:5566
GCG_EXPORT void addPctConssToBorder(SCIP_Real pct)
adds percentage of constraints assigned to border
Definition class_partialdecomp.cpp:525
GCG_EXPORT void assignOpenConssToMaster()
assigns open conss to master
Definition class_partialdecomp.cpp:847
GCG_EXPORT int getEqClassForBlock(int blockid)
Gets index of the representative block for a block, this might be blockid itself.
Definition class_partialdecomp.cpp:4707
GCG_EXPORT SCIP_Bool hasSetppccardMaster()
checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
Definition class_partialdecomp.cpp:3415
GCG_EXPORT bool isAssignedToOrigProb()
Gets whether the partialdec is from the original problem.
Definition class_partialdecomp.cpp:4835
GCG_EXPORT void setDetectorPropagated(GCG_DETECTOR *detector)
sets partialdec to be propagated by a detector
Definition class_partialdecomp.cpp:5308
GCG_EXPORT void addPctConssToBlock(SCIP_Real pct)
adds percentage of constraints assigned to blocks
Definition class_partialdecomp.cpp:517
GCG_EXPORT void completeByConnected()
assigns all open constraints and open variables
Definition class_partialdecomp.cpp:2327
GCG_EXPORT SCIP_RETCODE isEqual(PARTIALDECOMP *otherpartialdec, SCIP_Bool *isequal, bool sortpartialdecs)
method to check whether this partialdec is equal to a given other partialdec (
Definition class_partialdecomp.cpp:4847
GCG_EXPORT std::vector< int > & getMastervars()
Gets array containing all master vars indices.
Definition class_partialdecomp.cpp:4292
GCG_EXPORT void setStemsFromOrig(bool fromorig)
sets whether this partialdec stems from an orig problem partialdec
Definition class_partialdecomp.cpp:5403
GCG_EXPORT void setUsergiven(USERGIVEN usergiven)
sets whether this partialdec is user given
Definition class_partialdecomp.cpp:5411
GCG_EXPORT std::vector< SCIP_Real > & getPctConssToBorderVector()
Gets fraction of constraints assigned to the border for detectors in detectorchain.
Definition class_partialdecomp.cpp:4653
GCG_EXPORT SCIP_RETCODE assignPartialdecFromConstoblock(SCIP_HASHMAP *constoblock, int additionalNBlocks)
assigns conss structure according to given hashmap
Definition class_partialdecomp.cpp:1001
GCG_EXPORT void setDetectorFinishedOrig()
sets detector that finished the partialdec in the original problem
Definition class_partialdecomp.cpp:5327
GCG_EXPORT SCIP_Real getPctConssToBlock(int detectorchainindex)
Gets fraction of constraints assigned to a block for a detector.
Definition class_partialdecomp.cpp:4667
GCG_EXPORT int getNLinkingvars()
Gets size of the vector containing linking vars.
Definition class_partialdecomp.cpp:4459
GCG_EXPORT std::vector< SCIP_Real > & getPctVarsFromFreeVector()
Gets fraction of variables that are not longer open for detectors in detectorchain.
Definition class_partialdecomp.cpp:4629
GCG_EXPORT void deleteEmptyBlocks(bool variables)
deletes empty blocks and sets nblocks accordingly
Definition class_partialdecomp.cpp:3019
GCG_EXPORT void refineToBlocks()
refine partialdec with focus on blocks
Definition class_partialdecomp.cpp:5167
GCG_EXPORT SCIP_Real getMaxWhiteScore()
gets the maximum white area score
Definition class_partialdecomp.cpp:5874
GCG_EXPORT SCIP_Real getPctVarsFromFree(int detectorchainindex)
Gets fraction of variables that are not longer open for a detector.
Definition class_partialdecomp.cpp:4619
GCG_EXPORT void setVarPartitionStatistics(int detectorchainindex, VarPartition *partition, std::vector< int > &varclasseslinking, std::vector< int > &varclassesmaster)
registers statistics for a used varpartition
Definition class_partialdecomp.cpp:5419
GCG_EXPORT void setConsToBlock(int consToBlock, int block)
adds a constraint to a block, does not delete this cons from list of open conss
Definition class_partialdecomp.cpp:5205
GCG_EXPORT std::vector< int > & getRepVarmap(int eqclass, int eqclassblock)
Returns a vector that maps probvar indices of a block contained in an equivalence class to the probva...
Definition class_partialdecomp.cpp:4715
GCG_EXPORT void setDetectorClockTimes(std::vector< SCIP_Real > &newvector)
set statistical vector of the times that the detectors needed for detecting per involved detector
Definition class_partialdecomp.cpp:3950
void setScore(GCG_SCORE *score, SCIP_Real scorevalue)
sets the scorevalue of score
Definition class_partialdecomp.cpp:4334
GCG_EXPORT void deleteOpencons(int opencons)
deletes a cons from list of open conss
Definition class_partialdecomp.cpp:3090
GCG_EXPORT SCIP_RETCODE assignPartialdecFromConstoblockVector(std::vector< int > constoblock, int additionalNBlocks)
assigns conss structure according to given vector
Definition class_partialdecomp.cpp:1047
GCG_EXPORT SCIP_RETCODE filloutPartialdecFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
assigns all conss to master or a block
Definition class_partialdecomp.cpp:3531
GCG_EXPORT void generateVisualization(char *filename, char *outname, GP_OUTPUT_FORMAT outputformat=GP_OUTPUT_FORMAT_PDF)
generates a visualization of the partialdec using gnuplot
Definition class_partialdecomp.cpp:5751
GCG_EXPORT void setDetectorchain(std::vector< GCG_DETECTOR * > &givenDetectorChain)
sets the detectorchain with the given vector of detector pointers
Definition class_partialdecomp.cpp:5300
GCG_EXPORT void addNNewBlocks(int nnewblocks)
adds how many new blocks were introduced
Definition class_partialdecomp.cpp:501
GCG_EXPORT void findVarsLinkingToMaster()
reassigns linking variables to master if appropriate
Definition class_partialdecomp.cpp:3631
GCG_EXPORT bool isVarLinkingvarOfBlock(int var, int block)
Checks whether the var is a linking var contained by the block.
Definition class_partialdecomp.cpp:5027
GCG_EXPORT int getNAncestors()
Gets number of ancestor partialdecs.
Definition class_partialdecomp.cpp:4414
GCG_EXPORT SCIP_RETCODE assignBorderFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
assigns open conss to master
Definition class_partialdecomp.cpp:566
GCG_EXPORT std::vector< SCIP_Real > & getPctConssFromFreeVector()
Gets fraction of constraints that are not longer open for detectors in detectorchain.
Definition class_partialdecomp.cpp:4701
GCG_EXPORT bool getFinishedByFinisher()
returns true iff this partialdec was finished by finishPartialdec() method of a detector
Definition class_partialdecomp.cpp:4242
GCG_EXPORT int getReprBlockForEqClass(int eqclass)
get the representative block of the given equivalence class
Definition class_partialdecomp.cpp:3875
GCG_EXPORT void considerImplicits()
: assigns every open cons/var
Definition class_partialdecomp.cpp:2806
GCG_EXPORT int getNNewBlocks(int detectorchainindex)
Gets number of blocks a detector added.
Definition class_partialdecomp.cpp:4465
GCG_EXPORT std::vector< std::vector< int > > & getConssForBlocks()
gets vector of indices of all constraints assigned to blocks
Definition class_partialdecomp.cpp:5897
GCG_EXPORT int getNCoeffsForMaster()
Definition class_partialdecomp.cpp:4309
GCG_EXPORT int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
Definition class_partialdecomp.cpp:4493
GCG_EXPORT int getNMastervars()
Gets size of the vector containing master vars.
Definition class_partialdecomp.cpp:4487
GCG_EXPORT int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
Definition class_partialdecomp.cpp:4432
GCG_EXPORT void showVisualization()
generates and opens a gp visualization of the partialdec
Definition class_partialdecomp.cpp:5715
GCG_EXPORT void addDecChangesFromAncestor(PARTIALDECOMP *ancestor)
adds the statistical differences to an ancestor
Definition class_partialdecomp.cpp:461
GCG_EXPORT void addPctConssFromFree(SCIP_Real pct)
adds percentage of closed constraints
Definition class_partialdecomp.cpp:509
GCG_EXPORT void setConsPartitionStatistics(int detectorchainindex, ConsPartition *partition, std::vector< int > &consclassesmaster)
registers statistics for a used conspartition
Definition class_partialdecomp.cpp:5186
GCG_EXPORT void setFinishedByFinisherOrig(bool finished)
sets whether this partialdec was finished by a finishing detector in the original problem
Definition class_partialdecomp.cpp:5342
GCG_EXPORT bool isVarBlockvarOfBlock(int var, int block)
Checks whether the var is assigned to the block.
Definition class_partialdecomp.cpp:4997
GCG_EXPORT int getID()
returns the unique id of the partialdec
Definition class_partialdecomp.cpp:4255
GCG_EXPORT void addClockTime(SCIP_Real clocktime)
adds detection time of one detector
Definition class_partialdecomp.cpp:453
GCG_EXPORT int getTranslatedpartialdecid() const
Definition class_partialdecomp.cpp:5907
GCG_EXPORT SCIP_Real getPctConssFromFree(int detectorchainindex)
Gets fraction of constraints that are not longer open for a detector.
Definition class_partialdecomp.cpp:4691
GCG_EXPORT void setPctVarsFromFreeVector(std::vector< SCIP_Real > &newvector)
set statistical vector of variables that are not longer open per involved detector
Definition class_partialdecomp.cpp:4635
GCG_EXPORT SCIP_Bool hasSetppMaster()
checks iff all master constraints set partitioning, or set packing constraints
Definition class_partialdecomp.cpp:3468
GCG_EXPORT std::vector< int > & getOpenconss()
Gets vector containing constraints not assigned yet.
Definition class_partialdecomp.cpp:4558
GCG_EXPORT std::vector< std::string > & getDetectorchainInfo()
Gets the detectorchain info vector.
Definition class_partialdecomp.cpp:4441
GCG_EXPORT void writeVisualizationFile(char *filename, char *outname, GP_OUTPUT_FORMAT outputformat=GP_OUTPUT_FORMAT_PDF)
writes a gp visualization of the partialdec to a file
Definition class_partialdecomp.cpp:5778
GCG_EXPORT void copyPartitionStatistics(const PARTIALDECOMP *otherpartialdec)
copies the given partialdec's partition statistics
Definition class_partialdecomp.cpp:3009
GCG_EXPORT bool isConsOpencons(int cons)
Gets whether the cons is an open cons.
Definition class_partialdecomp.cpp:4826
GCG_EXPORT void findVarsLinkingToStairlinking()
reassigns variables classified as linking to stairlinking if appropriate
Definition class_partialdecomp.cpp:3685
GCG_EXPORT int getNVarsForBlocks()
Gets overall number of vars assigned to a block.
Definition class_partialdecomp.cpp:4546
GCG_EXPORT void reorderBlocksForStairlinkingVars()
reorders blocks for making a maximum number of linking vars stairlinking
Definition class_partialdecomp.cpp:1459
GCG_EXPORT void printPartitionInformation(FILE *file)
prints partition information as described in
Definition class_partialdecomp.cpp:5094
GCG_EXPORT std::vector< SCIP_Real > & getPctVarsToBlockVector()
returns fraction of variables assigned to a block for detectors in detectorchain
Definition class_partialdecomp.cpp:4604
GCG_EXPORT std::vector< int >::const_iterator fixConsToMaster(std::vector< int >::const_iterator itr)
fixes a constraint to the master constraints
Definition class_partialdecomp.cpp:5264
GCG_EXPORT void deleteOpenvar(int openvar)
deletes a var from the list of open vars
Definition class_partialdecomp.cpp:3114
GCG_EXPORT bool isTrivial()
Gets whether this partialdec is considered to be trivial.
Definition class_partialdecomp.cpp:4973
GCG_EXPORT void setPctConssToBlockVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fractions of constraints set to blocks per involved detector
Definition class_partialdecomp.cpp:4683
GCG_EXPORT bool sort()
sorts the vars and conss data structures by their indices
Definition class_partialdecomp.cpp:5807
GCG_EXPORT bool isVarStairlinkingvar(int var)
Checks whether the var is a stairlinking var.
Definition class_partialdecomp.cpp:5057
BLOCK_STRUCTURE * getBlockStructure(int block)
Returns the structure information of a specific block.
Definition class_partialdecomp.cpp:4319
GCG_EXPORT std::vector< int > getNNewBlocksVector()
gets number of blocks the detectors in the detectorchain added
Definition class_partialdecomp.cpp:4475
GCG_EXPORT std::vector< int > & getOpenvars()
Gets vector containing variables not assigned yet.
Definition class_partialdecomp.cpp:4564
GCG_EXPORT std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
Definition class_partialdecomp.cpp:4771
GCG_EXPORT void addPctVarsToBlock(SCIP_Real pct)
adds percentage of variables assigned to blocks
Definition class_partialdecomp.cpp:541
GCG_EXPORT void complete()
assigns all open constraints and open variables trivially
Definition class_partialdecomp.cpp:2301
GCG_EXPORT bool isPropagatedBy(GCG_DETECTOR *detector)
Gets whether this partialdec was propagated by specified detector.
Definition class_partialdecomp.cpp:4963
GCG_EXPORT void setPctConssToBorderVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fractions of constraints assigned to the border per involved detector
Definition class_partialdecomp.cpp:4659
GCG_EXPORT bool assignCurrentStairlinking()
assigns open vars to stairlinking if appropriate
Definition class_partialdecomp.cpp:596
GCG_EXPORT void fixVarToBlock(int var, int block)
adds a variable to the linking variables
Definition class_partialdecomp.cpp:5457
GCG_EXPORT void setConsToMaster(int consToMaster)
adds a constraint to the master constraints, does not delete this cons from list of open conss
Definition class_partialdecomp.cpp:5252
GCG_EXPORT std::vector< int > & getAncestorList()
get ancestor ids as vector
Definition class_partialdecomp.cpp:3863
GCG_EXPORT std::vector< int > & getLinkingvarsForBlock(int block)
returns vector of all linking var indices contained by the block
Definition class_partialdecomp.cpp:4267
Definition class_varpartition.h:61
#define SCIP_Bool
#define SCIP_Real
miscellaneous graph methods for structure detection
Implementation of the graph which supports both node and edge weights.
Definition class_conspartition.cpp:44
USERGIVEN
enumeration to display if a decomposition was given by the user and if so, how it was processed after...
Definition class_partialdecomp.h:68
GP file reader writing decompositions to gnuplot files.
data structures for detectors
Definition class_partialdecomp.h:82
BLOCK_STRUCTURE * translateStructure(std::vector< int > &rowmapping, std::vector< int > &colmapping, SCIP_Bool translatesymmetry)
Definition class_partialdecomp.cpp:193
std::vector< std::vector< int > > blockconss
Definition class_partialdecomp.h:104
std::unordered_map< int, int > symmetryvardata
Definition class_partialdecomp.h:107
std::vector< int > symmetricalblocks
Definition class_partialdecomp.h:106
PARTIALDECOMP * createPartialdec(DETPROBDATA *parentdetprobdata, DETPROBDATA *newdetprobdata, int probnr)
Definition class_partialdecomp.cpp:99
std::vector< BLOCK_STRUCTURE * > blockstructures
Definition class_partialdecomp.h:105
struct SCIP_Cons SCIP_CONS
struct SCIP_HashMap SCIP_HASHMAP
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
type definitions for score