class_partialdecomp.h
Go to the documentation of this file.
36 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
59 * @brief enumeration to display if a decomposition was given by the user and if so, how it was processed after adding
66 COMPLETED_CONSTOMASTER = - 3 /**< this partialdec was partially given by the user and then completed by setting all missing constraints to the master*/
87 std::vector<int> mastervars; /**< vector containing indices of master variables (these variables are supposed to have all nonzero entries in master constraints) */
88 std::vector<std::vector<int>> conssforblocks; /**< conssforblocks[k] contains a vector of indices of all
90 std::vector<std::vector<int>> varsforblocks; /**< varsforblocks[k] contains a vector of indices of all
93 std::vector<std::vector<int>> stairlinkingvars; /**< vector containing indices of staircase linking variables
102 std::vector<bool> isvarmaster; /**< whether ith variable is assigned to be a only-master variable */
103 std::vector<bool> isconsmaster; /**< whether ith constraint is assigned to be a master constraint */
109 std::vector<std::vector<int>> ncoeffsforblockformastercons; /**< number of coeffs a block has in a certain master constraint */
112 bool stairlinkingvarsforblocksorted; /**< bool to store if the stairlinkingvarsforblock datastructure is sorted atm */
113 bool conssforblocksorted; /**< bool to store if the conssforblock datastructure is sorted atm */
116 bool masterconsssorted; /**< bool to store if the masterconsssorted datastructure is sorted atm */
118 unsigned long hashvalue; /**< hash value of this partial decomposition, decompositions with same has value are considered to be identical */
119 bool hvoutdated; /**< true if the internal structure changed such that the hash value needs to be recalculated */
123 bool isagginfoalreadytoexpensive; /**< is agginfo already known to be to expensive to calculate*/
128 bool isfinishedbyfinisher; /**< was this partialdec finished by the finishpartialdec() method of a detector */
132 std::vector<std::vector<int>> reptoblocks; /**< translation of the block representatives to (old) blocks */
133 std::vector<int> blockstorep; /**< translation of the (old) blocks to the block representatives */
134 std::vector<std::vector<std::vector<int> > > pidtopidvarmaptofirst; /**< [nrepblocks][blockstorep[k].size()][nvarsforprob] collection of varmaps of probindices from k-th subproblem to the zeroth block that is represented */
137 std::vector<DEC_DETECTOR*> detectorchain; /**< vector containing detectors that worked on that partialdec */
138 std::vector<std::string> detectorchaininfo; /**< vector containing information about the detector call */
140 std::vector<SCIP_Real> pctvarstoborder; /**< vector containing the fraction of variables assigned to the
142 std::vector<SCIP_Real> pctvarstoblock; /**< vector containing the fraction of variables assigned to a block
144 std::vector<SCIP_Real> pctvarsfromfree; /**< vector containing the fraction of variables that are not longer
146 std::vector<SCIP_Real> pctconsstoborder; /**< vector containing the fraction of constraints assigned to the
148 std::vector<SCIP_Real> pctconsstoblock; /**< vector containing the fraction of constraints assigned to a block
150 std::vector<SCIP_Real> pctconssfromfree; /**< vector containing the fraction of constraints that are not longer
152 std::vector<int> nnewblocks; /**< vector containing information how many new blocks a detector has assigned */
154 std::vector<IndexPartition*> usedpartition; /**< vector containing pointer to the cons- or varpartitions
157 std::vector<std::vector<int>> classestomaster; /**< vector containing the vector of classindices that were assigned
160 std::vector<std::vector<int>> classestolinking; /**< vector containing the vector of classindices that were assigned
164 std::vector<int> listofancestorids; /**< vector containing decomposition indices that are ancestors of this partialdec */
173 SCIP_Real maxforeseeingwhitescore; /**< maximum foreseeing white area score (i.e. maximize fraction of white area score considering problem with copied linking variables and corresponding master constraints; white area is nonblock and nonborder area, stairlinking variables count as linking) */
174 SCIP_Real setpartfwhitescore; /**< setpartitioning maximum foreseeing white area score (i.e. convex combination of maximum foreseeing white area score and a boolean score rewarding a master containing only setppc and cardinality constraints )*/
175 SCIP_Real maxforeseeingwhitescoreagg; /**< maximum foreseeing white area score with respect to aggregatable blocks (i.e. maximize fraction of white area score considering problem with copied linking variables and corresponding master constraints; white area is nonblock and nonborder area, stairlinking variables count as linking) */
176 SCIP_Real setpartfwhitescoreagg; /**< setpartitioning maximum foreseeing white area score with respect to aggregateable (i.e. convex combination of maximum foreseeing white area score and a boolean score rewarding a master containing only setppc and cardinality constraints )*/
180 /* datastructure to store information if this partialdec stems from a partialdec concerning the orig problem */
181 bool stemsfromorig; /**< partialdec has at least one ancestor that is a partialdec from orig problem */
183 bool isfinishedbyfinisherorig; /**< was the ancestor partialdec for the unpresolved problem finished by the
202 std::vector<int>& varmap, /**< maps variable indices (corresponding to detprobdata indices) of block 2 to block 1 */
203 SCIP_HASHMAP* varmap2, /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
220 std::vector<int>& varmap, /**< maps variable indices (corresponding to detprobdata indices) of prob2 to prob1 */
221 SCIP_HASHMAP* varmap2, /**< maps variable pointers of block 2 to those of block 1 if both blocks (problems) are identical*/
245 bool originalProblem /**< true iff partialdec is for presolved problem (else for original problem) */
297 * bookkeeping information: adds number of new blocks created by a detector added to detector chain
306 * bookkeeping information: fraction of constraints that are not longer open for a detector added to detector chain
315 * bookkeeping information: adds fraction of constraints assigned to a block for a detector added to detector chain
324 * bookkeeping information: adds fraction of constraints assigned to the border for a detector added to detector chain
333 * bookkeeping information: adds fraction of variables that are not longer open for a detector added to detector chain
343 * bookkeeping information: adds fraction of variables assigned to a block for a detector added to detector chain
352 * bookkeeping information: adds fraction of variables assigned to the border for a detector added to detector chain
367 * assigns open constraints to master according to the cons assignment information given in constoblock hashmap
369 * @note for conss assigned to blocks according to constoblock there is no assignment \see assignPartialdecFromConstoblock
373 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
402 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices */
415 std::vector<int> constoblock, /**< vector containing an assignment of conss to a block or to master */
438 * if all vars that connect exactly two blocks have a staircase structure, all of them become stairlinkingvars
475 * strategy: assigns all open conss and vars to blocks if they can be refined there, otherwise to the master
477 * @note partialdecomps should usually be completed by a detector, only use this function if you know what you are doing.
546 * @param variables if true, then blocks with no constraints but at least one variable are considered to be nonempty
609 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
621 * @note precondition: no cons or var is already assigned to a block and constoblock contains information for every cons */
624 SCIP_HASHMAP* constoblock, /**< hashmap assigning cons indices (not SCIP_Cons*) to block indices
692 * @brief returns the time that the detector related to the given detectorchainindex needed for detecting
700 * @brief returns a vector of the clock times that each detector needed that was involved in this partialdec
721 * @brief returns true iff this partialdec was finished by finishPartialdec() method of a detector
787 * @brief checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
788 * @return TRUE iff all master constraints set partitioning, set packing, set cover, or cardinality constraints
794 * @brief checks iff all master constraints set partitioning, set packing, or set cover constraints
978 * @return vector of fractions of variables assigned to the border for detectors in detectorchain
1008 * @return vector or fractions of variables that are not longer open for detectors in detectorchain
1023 * @return vector of fractions of constraints assigned to the border for detectors in detectorchain
1037 * @return vector of fractions of constraints assigned to a block for detectors in detectorchain
1051 * @return vector of fractions of constraints that are not longer open for detectors in detectorchain
1067 * Var map is vector for represenative repid and the blockrepid-th block that is represented by repid
1070 * @return the represenation varmap as vector for represenative repid and the blockrepid-th block that is represented by repid
1086 * @note if a stairlinking variable links block i and i+1 it is only stored in vector of block i
1152 * @brief method to check whether this partialdec is equal to a given other partialdec ( \see isEqual(PARTIALDECOMP*))
1262 * (without respect to open vars and conss @see assignHittingOpenconss(), @see assignHittingOpenvars())
1283 std::vector<int>& consclassesmaster /**< vector of classindices that were assigned to master */
1318 * @brief adds a constraint to the master constraints, does not delete this cons from list of open conss
1329 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1338 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1347 * @warning This method modifies the vector PARTIALDECOMP::openconss! Hence, any kind of iterator might be invalid afterwards!
1381 * @note does not add the detector to the detectorchain and does not modify partition statistics
1396 * @brief sets whether this partialdec was finished by a finishing detector in the original problem
1443 std::vector<int>& varclasseslinking, /**< vector of classindices that were assigned to linking */
1448 * @brief adds a variable to the linking variables, does not delete this var from list of open vars
1472 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1480 * @brief adds a variable to the linking variables, does not delete this var from list of open vars
1499 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1505 /** @brief adds a variable to the master variables, does not delete this var from list of open vars
1525 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1532 * @brief adds a variable to the stairlinking variables, does not delete this var from list of open vars
1547 * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
1558 * @param firstblock stairlinking variables hit exactly two consecutive blocks, this is the index of the first of these blocks
1560 * @warning This method modifies the vector PARTIALDECOMP::openvars! Hence, any kind of iterator might be invalid afterwards!
1626 * @param outputformat The format of the gnuplot output. Should match the file extension of outname
1639 * @param outputformat The format of the gnuplot output. Should match the file extension of outname
1667 * @brief set statistical vector of fractions of constraints set to blocks per involved detector
1675 * @brief set statistical vector of fractions of constraints that are not longer open per involved detector
1676 * @param newvector vector of fractions of constraints that are not longer open per involved detector
1683 * @brief set statistical vector of fractions of constraints assigned to the border per involved detector
1684 * @param newvector vector of fractions of constraints assigned to the border per involved detector
1691 * @brief set statistical vector of fraction of variables assigned to the border per involved detector
1692 * @param newvector vector of fractions of variables assigned to the border per involved detector
1699 * @brief set statistical vector of fractions of variables assigned to a block per involved detector
1708 * @param newvector vector of fractions of variables that are not longer open per involved detector
1715 * @brief set statistical vector of the times that the detectors needed for detecting per involved detector
1716 * @param newvector vector of the times that the detectors needed for detecting per involved detector
1750 * "maximum white score" is fraction of the area of the decomposed matrix that is neither block or border
1801 /** @brief gets the setpartitioning maximum foreseeing white area score with respect to aggregateable
1808 /** @brief set the setpartitioning maximum foreseeing white area score with respect to aggregateable
1855 * checks if aggregation of sub problems is possible and stores the corresponding aggregation information
1857 * @param ignoreDetectionLimits Set to true if computation should ignore detection limits. This parameter is ignored if the patched bliss version is not present.
1877 * @brief creates a detector chain short string for this partialdec, is built from detector chain
1886 * @brief adds empty entries for all partition statistics for a detector added to the detector chain
1896 * - to the block with the lowest number of conss if it hits a stairlinking var and there are blocks the cons may be
1926 * @brief assigns open conss/vars that hit exactly one block and at least one open var/cons to border
1955 * counts for each pair of block and master constraint, how many nonzero entries the variables of the blocks
1964 * changes the block order in a way such that all linking vars that are potentially stairlinking
2010 std::vector<int>& consclassesmaster /**< a vector containing all indices of the consclasses assigned to master
2030 bool displayConssVars /**< pass true if constraints and variables of the respective classes should be displayed */
2046 std::vector<int>& varclasseslinking, /**< a vector containing all indices of the varclasses assigned to linking (set by method) */
void addClockTime(SCIP_Real clocktime)
adds detection time of one detector
Definition: class_partialdecomp.cpp:286
void removeAncestorID(int ancestorid)
Definition: class_partialdecomp.cpp:3625
void setFinishedByFinisher(bool finished)
sets whether this partialdec was finished by a finishing detector
Definition: class_partialdecomp.cpp:5009
bool aggInfoCalculated()
Checks if the aggregation information was already calculated.
Definition: class_partialdecomp.cpp:5634
SCIP_Bool hasSetppMaster()
checks iff all master constraints set partitioning, or set packing constraints
Definition: class_partialdecomp.cpp:3250
std::vector< int > & getMastervars()
Gets array containing all master vars indices.
Definition: class_partialdecomp.cpp:3998
bool isVarStairlinkingvar(int var)
Checks whether the var is a stairlinking var.
Definition: class_partialdecomp.cpp:4730
std::vector< int > & getVarsForBlock(int block)
Gets array containing vars of a block.
Definition: class_partialdecomp.cpp:4470
void fixVarToMaster(int var)
adds a variable to the master variables
Definition: class_partialdecomp.cpp:5210
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:5234
int getNOpenvars()
Gets size of vector containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4198
std::vector< int > & getOpenvarsVec()
Definition: class_partialdecomp.cpp:4265
void copyPartitionStatistics(const PARTIALDECOMP *otherpartialdec)
copies the given partialdec's partition statistics
Definition: class_partialdecomp.cpp:2784
std::vector< int >::const_iterator fixConsToMaster(std::vector< int >::const_iterator itr)
fixes a constraint to the master constraints
Definition: class_partialdecomp.cpp:4938
class representing a partition of a set of variables
void setMaxForWhiteAggScore(SCIP_Real score)
set the maximum foreseeing white area score with respect to aggregatable blocks
Definition: class_partialdecomp.cpp:5575
void addDetectorChainInfo(const char *decinfo)
add information about the detector chain
Definition: class_partialdecomp.cpp:315
void setAncestorList(std::vector< int > &newlist)
Definition: class_partialdecomp.cpp:3608
USERGIVEN
enumeration to display if a decomposition was given by the user and if so, how it was processed after...
Definition: class_partialdecomp.h:61
SCIP_Real getPctVarsFromFree(int detectorchainindex)
Gets fraction of variables that are not longer open for a detector.
Definition: class_partialdecomp.cpp:4320
SCIP_Real getPctConssFromFree(int detectorchainindex)
Gets fraction of constraints that are not longer open for a detector.
Definition: class_partialdecomp.cpp:4392
void setNBlocks(int nblocks)
sets number of blocks, only increasing number allowed
Definition: class_partialdecomp.cpp:5025
void setFinishedByFinisherOrig(bool finished)
sets whether this partialdec was finished by a finishing detector in the original problem
Definition: class_partialdecomp.cpp:5017
std::vector< int > & getOpenconssVec()
Gets a vector containing constraint ids not assigned yet as vector.
Definition: class_partialdecomp.cpp:4253
bool checkAllConssAssigned()
checks if all conss are assigned
Definition: class_partialdecomp.cpp:1511
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:5198
SCIP_Real getMaxForWhiteAggScore()
gets the maximum foreseeing white area score with respect to aggregatable blocks
Definition: class_partialdecomp.cpp:5570
void displayInfo(int detailLevel)
displays the relevant information of the partialdec
Definition: class_partialdecomp.cpp:2933
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:5416
int getNCoeffsForMaster()
Definition: class_partialdecomp.cpp:4015
bool isVarOpenvar(int var)
Checks whether the var is an open var.
Definition: class_partialdecomp.cpp:4721
std::vector< SCIP_Real > & getPctConssToBlockVector()
Gets fraction of constraints assigned to a block for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4378
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:4312
int getVarProbindexForBlock(int varid, int block)
Gets index in variables array of a block for a variable.
Definition: class_partialdecomp.cpp:4479
bool isVarBlockvarOfBlock(int var, int block)
Checks whether the var is assigned to the block.
Definition: class_partialdecomp.cpp:4683
Definition: class_conspartition.cpp:43
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:5143
void findVarsLinkingToStairlinking()
reassigns variables classified as linking to stairlinking if appropriate
Definition: class_partialdecomp.cpp:3457
void addPctConssToBorder(SCIP_Real pct)
adds percentage of constraints assigned to border
Definition: class_partialdecomp.cpp:358
std::vector< int > & getMasterconss()
Gets array containing all master conss indices.
Definition: class_partialdecomp.cpp:3992
bool isComplete()
Gets whether this partialdec is complete, i.e. it has no more open constraints and variables.
Definition: class_partialdecomp.cpp:4494
class representing a partition of a set of constraints
Definition: class_conspartition.h:53
void fixVarToLinking(int var)
adds a variable to the linking variables
Definition: class_partialdecomp.cpp:5154
type definition for score type
void setTranslatedpartialdecid(int decid)
Definition: class_partialdecomp.cpp:5644
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:3675
std::vector< SCIP_Real > & getPctVarsToBlockVector()
returns fraction of variables assigned to a block for detectors in detectorchain
Definition: class_partialdecomp.cpp:4305
USERGIVEN getUsergiven()
Gets the USERGIVEN status of this partialdecs.
Definition: class_partialdecomp.cpp:4097
int getNVarsForBlock(int block)
Gets size of the vector containing vars assigned to a block.
Definition: class_partialdecomp.cpp:4226
void setDetectorchain(std::vector< DEC_DETECTOR * > &givenDetectorChain)
sets the detectorchain with the given vector of detector pointers
Definition: class_partialdecomp.cpp:4974
SCIP_RETCODE filloutBorderFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
every constraint is either assigned to master or open
Definition: class_partialdecomp.cpp:3274
void showVisualization()
generates and opens a gp visualization of the partialdec
Definition: class_partialdecomp.cpp:5359
bool getFinishedByFinisher()
returns true iff this partialdec was finished by finishPartialdec() method of a detector
Definition: class_partialdecomp.cpp:3967
std::vector< int > getNNewBlocksVector()
gets number of blocks the detectors in the detectorchain added
Definition: class_partialdecomp.cpp:4164
void setMaxForWhiteScore(SCIP_Real score)
set the maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5549
void complete()
assigns all open constraints and open variables trivially
Definition: class_partialdecomp.cpp:2125
bool fixVarToMasterByName(const char *varname)
assigns a variable with given name as master
Definition: class_partialdecomp.cpp:5331
data structures for detectors
void addPctVarsFromFree(SCIP_Real pct)
adds percentage of closed variables
Definition: class_partialdecomp.cpp:366
SCIP_Real getSetPartForWhiteScore()
gets the setpartitioning maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5557
int getNTotalStairlinkingvars()
Gets total number of stairlinking vars.
Definition: class_partialdecomp.cpp:4182
void fixVarToStairlinking(int var, int firstblock)
adds a variable to the stairlinking variables
Definition: class_partialdecomp.cpp:5255
void deleteOpencons(int opencons)
deletes a cons from list of open conss
Definition: class_partialdecomp.cpp:2865
void completeByConnected()
assigns all open constraints and open variables
Definition: class_partialdecomp.cpp:2157
Definition: class_varpartition.h:54
void buildDecChainString(char *buffer)
creates a detector chain short string for this partialdec, is built from detector chain
Definition: class_partialdecomp.cpp:5480
void addAncestorID(int ancestor)
Definition: class_partialdecomp.cpp:3616
bool fixVarToLinkingByName(const char *varname)
assigns a variable by name to the linking variables
Definition: class_partialdecomp.cpp:5345
void setSetPartForWhiteScore(SCIP_Real score)
set the setpartitioning maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5562
void setMaxWhiteScore(SCIP_Real score)
set the maximum white area score
Definition: class_partialdecomp.cpp:5536
SCIP_Real getMaxWhiteScore()
gets the maximum white area score
Definition: class_partialdecomp.cpp:5531
void setUsergiven(USERGIVEN usergiven)
sets whether this partialdec is user given
Definition: class_partialdecomp.cpp:5063
bool isConsMastercons(int cons)
Gets whether the cons is a master cons.
Definition: class_partialdecomp.cpp:4515
SCIP_Bool hasSetppccardMaster()
checks if all master constraints set partitioning, set packing, set cover, or cardinality constraints
Definition: class_partialdecomp.cpp:3197
std::vector< int > & getRepVarmap(int repid, int blockrepid)
Gets the represenation varmap.
Definition: class_partialdecomp.cpp:4415
void setDetectorFinished(DEC_DETECTOR *detector)
sets detector that finished the partialdec
Definition: class_partialdecomp.cpp:4991
void calcStairlinkingVars()
reassigns linking vars to stairlinkingvars if possible
Definition: class_partialdecomp.cpp:1322
int getNStairlinkingvars(int block)
Gets size of the vector containing stairlinking vars.
Definition: class_partialdecomp.cpp:4210
int getNConssForBlock(int block)
Gets size of the vector containing conss assigned to a block.
Definition: class_partialdecomp.cpp:4121
static SCIP_RETCODE partition(SCIP *scip, SCIP_VAR **J, int *Jsize, SCIP_Longint *priority, SCIP_VAR **F, int Fsize, SCIP_VAR **origvar, SCIP_Real *median)
Definition: branch_generic.c:832
void deleteOpenvar(int openvar)
deletes a var from the list of open vars
Definition: class_partialdecomp.cpp:2887
SCIP_Bool hasSetppcMaster()
checks iff all master constraints set partitioning, set packing, or set cover constraints
Definition: class_partialdecomp.cpp:3226
void setStrongDecompScore(SCIP_Real score)
set the strong decomposition score
Definition: class_partialdecomp.cpp:5613
SCIP_Bool shouldCompletedByConsToMaster()
Checks whether this partialdec is a userpartialdec that should be completed.
Definition: class_partialdecomp.cpp:5439
SCIP_Real getPctConssToBorder(int detectorchainindex)
Gets fraction of constraints assigned to the border for a detector.
Definition: class_partialdecomp.cpp:4344
void addDecChangesFromAncestor(PARTIALDECOMP *ancestor)
adds the statistical differences to an ancestor
Definition: class_partialdecomp.cpp:294
void exportVisualization()
generates a gp visualization of the partialdec without compilation or opening
Definition: class_partialdecomp.cpp:5427
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:4879
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:4287
SCIP_RETCODE filloutPartialdecFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
assigns all conss to master or a block
Definition: class_partialdecomp.cpp:3313
Definition: struct_detector.h:46
void addPctVarsToBorder(SCIP_Real pct)
adds percentage of variables assigned to border
Definition: class_partialdecomp.cpp:382
void addPctConssToBlock(SCIP_Real pct)
adds percentage of constraints assigned to blocks
Definition: class_partialdecomp.cpp:350
SCIP_Real getPctConssToBlock(int detectorchainindex)
Gets fraction of constraints assigned to a block for a detector.
Definition: class_partialdecomp.cpp:4368
bool isVarStairlinkingvarOfBlock(int var, int block)
Checks whether the var is a stairlinkingvar of a specified block.
Definition: class_partialdecomp.cpp:4744
SCIP_Real getSetPartForWhiteAggScore()
gets the setpartitioning maximum foreseeing white area score with respect to aggregateable
Definition: class_partialdecomp.cpp:5583
void completeGreedily()
assigns all open constraints and open variables
Definition: class_partialdecomp.cpp:2382
SCIP_RETCODE assignBorderFromConstoblock(SCIP_HASHMAP *constoblock, int givenNBlocks)
assigns open conss to master
Definition: class_partialdecomp.cpp:399
void setStemsFromOrig(bool fromorig)
sets whether this partialdec stems from an orig problem partialdec
Definition: class_partialdecomp.cpp:5055
int getRepForBlock(int blockid)
Gets index of the representative block for a block, this might be blockid itself.
Definition: class_partialdecomp.cpp:4408
int getNLinkingvars()
Gets size of the vector containing linking vars.
Definition: class_partialdecomp.cpp:4148
bool assignCurrentStairlinking()
assigns open vars to stairlinking if appropriate
Definition: class_partialdecomp.cpp:429
void setConsPartitionStatistics(int detectorchainindex, ConsPartition *partition, std::vector< int > &consclassesmaster)
registers statistics for a used conspartition
Definition: class_partialdecomp.cpp:4860
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:4360
bool sort()
sorts the vars and conss data structures by their indices
Definition: class_partialdecomp.cpp:5445
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:4438
SCIP_Real getStrongDecompScore()
gets the strong decomposition score
Definition: class_partialdecomp.cpp:5608
std::vector< SCIP_Real > & getPctConssFromFreeVector()
Gets fraction of constraints that are not longer open for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4402
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:4926
void printPartitionInformation(SCIP *givenscip, FILE *file)
prints partition information as described in
Definition: class_partialdecomp.cpp:4767
const int * getStairlinkingvars(int block)
Gets array containing stairlinking vars,.
Definition: class_partialdecomp.cpp:4446
void findVarsLinkingToMaster()
reassigns linking variables to master if appropriate
Definition: class_partialdecomp.cpp:3413
SCIP_Real getPctVarsToBorder(int detectorchainindex)
Gets fraction of variables assigned to the border for a detector.
Definition: class_partialdecomp.cpp:4271
const int * getOpenconss()
Gets array containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4247
void assignSmallestComponentsButOneConssAdjacency()
computes components by connectedness of conss and vars
Definition: class_partialdecomp.cpp:928
Definition: class_detprobdata.h:106
const std::vector< int > & getBlocksForRep(int repid)
get a vector of block ids that are identical to block with id repid
Definition: class_partialdecomp.cpp:3602
int getNNewBlocks(int detectorchainindex)
Gets number of blocks a detector added.
Definition: class_partialdecomp.cpp:4154
unsigned long getHashValue()
returns the calculated hash value of this partialdec
Definition: class_partialdecomp.cpp:3973
int getTranslatedpartialdecid() const
Definition: class_partialdecomp.cpp:5639
std::vector< SCIP_Real > & getPctConssToBorderVector()
Gets fraction of constraints assigned to the border for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4354
void setSelected(bool selected)
set the selection status of this partialdecs
Definition: class_partialdecomp.cpp:5047
void addNNewBlocks(int nnewblocks)
adds how many new blocks were introduced
Definition: class_partialdecomp.cpp:334
int getAncestorID(int ancestorindex)
gets partialdec id of given ancestor id
Definition: class_partialdecomp.cpp:3587
bool checkConsistency()
Checks whether the assignments in the partialdec are consistent.
Definition: class_partialdecomp.cpp:1546
int getNDetectors()
Gets the number of detectors the partialdec is propagated by.
Definition: class_partialdecomp.cpp:4136
void setBorderAreaScore(SCIP_Real score)
set the border area score
Definition: class_partialdecomp.cpp:5523
std::vector< std::string > & getDetectorchainInfo()
Gets the detectorchain info vector.
Definition: class_partialdecomp.cpp:4130
int getNCoeffsForBlock(int blockid)
Gets the number of nonzero coeffs in a certain block.
Definition: class_partialdecomp.cpp:4004
void setPctConssToBlockVector(std::vector< SCIP_Real > &newvector)
set statistical vector of fractions of constraints set to blocks per involved detector
Definition: class_partialdecomp.cpp:4384
PARTIALDECOMP(SCIP *scip, bool originalProblem)
Standard constructor, creates empty partialdec with unique id.
Definition: class_partialdecomp.cpp:90
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:3656
std::vector< int > & getConssForBlock(int block)
returns array containing constraints assigned to a block
Definition: class_partialdecomp.cpp:3693
Definition: graph_gcg.h:57
int getNVarsForBlocks()
Gets overall number of vars assigned to a block.
Definition: class_partialdecomp.cpp:4235
bool fixConsToMasterByName(const char *consname)
assgins a constraint by name as master
Definition: class_partialdecomp.cpp:5317
bool isVarMastervar(int var)
Checks whether the var is a master var.
Definition: class_partialdecomp.cpp:4699
miscellaneous graph methods for structure detection
void fixVarToBlock(int var, int block)
adds a variable to the linking variables
Definition: class_partialdecomp.cpp:5109
SCIP_Real getScore(SCORETYPE type)
returns the score of the partialdec (depending on used scoretype)
Definition: class_partialdecomp.cpp:4025
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:5094
DETPROBDATA * getDetprobdata()
Gets the corresponding detprobdata.
Definition: class_partialdecomp.cpp:4424
void removeMastercons(int consid)
removes the given cons from master
Definition: class_partialdecomp.cpp:2588
SCIP_RETCODE assignPartialdecFromConstoblockVector(std::vector< int > constoblock, int additionalNBlocks)
assigns conss structure according to given vector
Definition: class_partialdecomp.cpp:881
bool isVarLinkingvar(int var)
Checks whether the var is a linking var.
Definition: class_partialdecomp.cpp:4708
void setVarPartitionStatistics(int detectorchainindex, VarPartition *partition, std::vector< int > &varclasseslinking, std::vector< int > &varclassesmaster)
registers statistics for a used varpartition
Definition: class_partialdecomp.cpp:5071
void setSetPartForWhiteAggScore(SCIP_Real score)
set the setpartitioning maximum foreseeing white area score with respect to aggregateable
Definition: class_partialdecomp.cpp:5588
std::vector< int > & getLinkingvars()
returns array containing all linking vars indices
Definition: class_partialdecomp.cpp:3986
void addPctConssFromFree(SCIP_Real pct)
adds percentage of closed constraints
Definition: class_partialdecomp.cpp:342
bool fixVarToBlockByName(const char *varname, int blockid)
assigns a variable by name to a block
Definition: class_partialdecomp.cpp:5299
Implementation of the graph which supports both node and edge weights.
int getNOpenconss()
Gets size of vector containing constraints not assigned yet.
Definition: class_partialdecomp.cpp:4192
SCIP_RETCODE assignPartialdecFromConstoblock(SCIP_HASHMAP *constoblock, int additionalNBlocks)
assigns conss structure according to given hashmap
Definition: class_partialdecomp.cpp:835
bool isConsOpencons(int cons)
Gets whether the cons is an open cons.
Definition: class_partialdecomp.cpp:4524
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:4539
bool isPropagatedBy(DEC_DETECTOR *detector)
Gets whether this partialdec was propagated by specified detector.
Definition: class_partialdecomp.cpp:4649
void addPctVarsToBlock(SCIP_Real pct)
adds percentage of variables assigned to blocks
Definition: class_partialdecomp.cpp:374
void setPctVarsFromFreeVector(std::vector< SCIP_Real > &newvector)
set statistical vector of variables that are not longer open per involved detector
Definition: class_partialdecomp.cpp:4336
void calcAggregationInformation(bool ignoreDetectionLimits)
computes if aggregation of sub problems is possible
Definition: class_partialdecomp.cpp:1105
bool fixConsToBlockByName(const char *consname, int blockid)
assigns a constraint by name to a block
Definition: class_partialdecomp.cpp:5283
void setDetectorPropagated(DEC_DETECTOR *detector)
sets partialdec to be propagated by a detector
Definition: class_partialdecomp.cpp:4982
SCIP_Real getPctVarsToBlock(int detectorchainindex)
Gets fraction of variables assigned to a block for a detector.
Definition: class_partialdecomp.cpp:4295
std::vector< int > & getAncestorList()
get ancestor ids as vector
Definition: class_partialdecomp.cpp:3597
GP file reader writing decompositions to gnuplot files.
bool alreadyAssignedConssToBlocks()
method to check if at least one constraint is assigned to some block
Definition: class_partialdecomp.cpp:390
std::vector< DEC_DETECTOR * > & getDetectorchain()
returns detector chain as vector of detector pointers
Definition: class_partialdecomp.cpp:3702
bool isTrivial()
Gets whether this partialdec is considered to be trivial.
Definition: class_partialdecomp.cpp:4659
int getNMasterconss()
Gets size of the vector containing master conss.
Definition: class_partialdecomp.cpp:4170
bool isAssignedToOrigProb()
Gets whether the partialdec is from the presolved problem.
Definition: class_partialdecomp.cpp:4533
std::vector< SCIP_Real > & getPctVarsToBorderVector()
Gets fraction of variables assigned to the border for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4281
const int * getOpenvars()
Gets array containing variables not assigned yet.
Definition: class_partialdecomp.cpp:4259
SCIP_Real getDetectorClockTime(int detectorchainindex)
returns the time that the detector related to the given detectorchainindex needed for detecting
Definition: class_partialdecomp.cpp:3646
void setDetectorFinishedOrig(DEC_DETECTOR *detectorID)
sets detector that finished the partialdec in the original problem
Definition: class_partialdecomp.cpp:5001
void deleteEmptyBlocks(bool variables)
deletes empty blocks and sets nblocks accordingly
Definition: class_partialdecomp.cpp:2794
int getNMastervars()
Gets size of the vector containing master vars.
Definition: class_partialdecomp.cpp:4176
std::vector< SCIP_Real > & getPctVarsFromFreeVector()
Gets fraction of variables that are not longer open for detectors in detectorchain.
Definition: class_partialdecomp.cpp:4330
void fixConsToBlock(int cons, int block)
adds a constraint to a block
Definition: class_partialdecomp.cpp:4894
void completeByConnectedConssAdjacency()
assigns all open constraints and open variables
Definition: class_partialdecomp.cpp:2273
SCIP_Real getMaxForWhiteScore()
gets the maximum foreseeing white area score
Definition: class_partialdecomp.cpp:5544
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:5389
std::vector< std::vector< int > > & getConssForBlocks()
Definition: class_partialdecomp.cpp:5629