GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
dec_stairheur.cpp File Reference

Detailed Description

detector for staircase structures via ROC algorithms

Author
Martin Bergner
Mathias Luers

This detector is based on Jayakumar, Maliyakal D., and Ranga V. Ramasesh. A clustering heuristic to detect staircase structures in large scale linear programming models. European journal of operational research 76.1 (1994): 229-239.

Definition in file dec_stairheur.cpp.

#include <cassert>
#include <cstring>
#include <algorithm>
#include <vector>
#include <iostream>
#include "gcg/dec_stairheur.h"
#include "gcg/cons_decomp.h"
#include "gcg/struct_decomp.h"
#include "gcg/pub_decomp.h"
#include "gcg/scip_misc.h"
#include "scip/pub_misc.h"
#include "scip/struct_var.h"
#include "gcg/gcg.h"
#include "gcg/class_partialdecomp.h"
#include "gcg/class_detprobdata.h"
#include "scip/clock.h"

Go to the source code of this file.

Data Structures

struct  IndexMap
struct  GCG_DetectorData

Macros

#define DEC_NAME   "stairheur"
#define DEC_DESC   "detects staircase matrices via matrix reordering"
#define DEC_PRIORITY   1200
#define DEC_FREQCALLROUND   1
#define DEC_MAXCALLROUND   INT_MAX
#define DEC_MINCALLROUND   0
#define DEC_FREQCALLROUNDORIGINAL   1
#define DEC_MAXCALLROUNDORIGINAL   INT_MAX
#define DEC_MINCALLROUNDORIGINAL   0
#define DEC_DECCHAR   's'
#define DEC_ENABLED   FALSE
#define DEC_ENABLEDFINISHING   FALSE
#define DEC_ENABLEDPOSTPROCESSING   FALSE
#define DEC_SKIP   FALSE
#define DEC_USEFULRECALL   FALSE
#define DEFAULT_NCONSSPERBLOCK   32
#define DEFAULT_MAXBLOCKS   20
#define DEFAULT_MINBLOCKS   2
#define DEFAULT_DESIREDBLOCKS   0
#define DEFAULT_DYNAMICBLOCKING   FALSE
#define DEFAULT_STATICBLOCKING   TRUE
#define DEFAULT_BLOCKINGASSOONASPOSSIBLE   FALSE
#define DEFAULT_MULTIPLEDECOMPS   TRUE
#define DEFAULT_MAXITERATIONSROC   1000000
#define detectorExitStairheur   NULL
#define detectorFinishPartialdecStairheur   NULL
#define detectorPostprocessPartialdecStairheur   NULL

Functions

void printnested (vector< vector< int > > l)
void printvector (vector< int > l)
static vector< int > SCIPvectorCreateInt (int from, int to)
static void SCIPvectorRearrange (vector< vector< int > > &l, vector< int > order)
static SCIP_RETCODE indexmapCreate (SCIP *scip, INDEXMAP **indexmap, int nconss, int nvars)
static void indexmapFree (SCIP *scip, INDEXMAP **indexmap)
static SCIP_RETCODE indexmapInit (INDEXMAP *indexmap, gcg::PARTIALDECOMP *partialdec, int *hashmapindices)
static SCIP_RETCODE initData (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata)
static SCIP_RETCODE freeData (SCIP *scip, GCG_DETECTORDATA *detectordata)
static SCIP_RETCODE createRowindexList (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, SCIP_HASHMAP *indexcons, SCIP_HASHMAP *varindex, vector< vector< int > > &rowindices)
static SCIP_RETCODE createColumnindexList (SCIP *scip, gcg::PARTIALDECOMP *partialdec, vector< vector< int > > &rowindices, vector< vector< int > > &columnindices)
static vector< int > rowOrdering (SCIP *scip, vector< vector< int > > &columnindices, int nrows)
static SCIP_RETCODE formIndexArray (int *begin, int *end, vector< vector< int > > &indices)
static SCIP_Bool arraysAreEqual (int *new_array, int *old_array, int num_elements)
static SCIP_RETCODE rankOrderClusteringIteration (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, INDEXMAP *inputmap, INDEXMAP *outputmap)
static SCIP_RETCODE rankOrderClustering (SCIP *scip, gcg::PARTIALDECOMP *partialdec, gcg::DETPROBDATA *detprobdata, GCG_DETECTORDATA *detectordata, int max_iterations, int *iterations)
static SCIP_RETCODE rowsWithConstriction (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata)
static SCIP_RETCODE assignConsToBlock (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata, int block, int first_cons, int last_cons)
static int getMaxColIndex (GCG_DETECTORDATA *detectordata, int from_row, int to_row)
static int getMinColIndex (GCG_DETECTORDATA *detectordata, int row)
static SCIP_Bool isValidBlocking (GCG_DETECTORDATA *detectordata, int prev_block_first_row, int prev_block_last_row, int block_at_row)
static vector< int >::iterator findBlockingCandidate (vector< int >::iterator it_constrictions, vector< int > *it_vector, int min_block_size, int prev_block_last_row)
static vector< int >::iterator nextRowToBlockAt (GCG_DETECTORDATA *detectordata, vector< int >::iterator it_constrictions, vector< int > *it_vector, int min_block_size, int prev_block_first_row, int prev_block_last_row)
static int calculateNdecompositions (GCG_DETECTORDATA *detectordata)
static void checkParameterConsistency (SCIP *scip, GCG_DETECTORDATA *detectordata, SCIP_RESULT *result)
static SCIP_RETCODE blockingDynamic (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata, int tau, int nvars)
static SCIP_RETCODE blockingStatic (SCIP *scip, gcg::PARTIALDECOMP *partialdec, GCG_DETECTORDATA *detectordata)
static SCIP_RETCODE blockingAsSoonAsPossible (SCIP *scip, GCG_DETECTORDATA *detectordata, int desired_blocks, int nvars)
static SCIP_RETCODE resetDetectordata (SCIP *scip, GCG_DETECTORDATA *detectordata)
static SCIP_RETCODE blocking (SCIP *scip, GCG_DETECTORDATA *detectordata, gcg::PARTIALDECOMP *partialdec, PARTIALDEC_DETECTION_DATA *detectiondata, SCIP_Real time, int maxndecs, SCIP_RESULT *result)
static GCG_DECL_FREEDETECTOR (detectorFreeStairheur)
static GCG_DECL_INITDETECTOR (detectorInitStairheur)
static GCG_DECL_PROPAGATEPARTIALDEC (detectorPropagatePartialdecStairheur)
static GCG_DECL_SETPARAMFAST (setParamAggressiveStairheur)
static GCG_DECL_SETPARAMFAST (setParamDefaultStairheur)
static GCG_DECL_SETPARAMFAST (setParamFastStairheur)
SCIP_RETCODE GCGincludeDetectorStairheur (GCG *gcg)

Macro Definition Documentation

◆ DEC_NAME

#define DEC_NAME   "stairheur"

name of the detector

Definition at line 60 of file dec_stairheur.cpp.

◆ DEC_DESC

#define DEC_DESC   "detects staircase matrices via matrix reordering"

detector description

Definition at line 61 of file dec_stairheur.cpp.

◆ DEC_PRIORITY

#define DEC_PRIORITY   1200

priority of the detector

Definition at line 62 of file dec_stairheur.cpp.

◆ DEC_FREQCALLROUND

#define DEC_FREQCALLROUND   1

frequency the detector gets called in detection loop ,ie it is called in round r if and only if minCallRound <= r <= maxCallRound AND (r - minCallRound) mod freqCallRound == 0

Definition at line 63 of file dec_stairheur.cpp.

◆ DEC_MAXCALLROUND

#define DEC_MAXCALLROUND   INT_MAX

last round the detector gets called

Definition at line 64 of file dec_stairheur.cpp.

◆ DEC_MINCALLROUND

#define DEC_MINCALLROUND   0

first round the detector gets called

Definition at line 65 of file dec_stairheur.cpp.

◆ DEC_FREQCALLROUNDORIGINAL

#define DEC_FREQCALLROUNDORIGINAL   1

frequency the detector gets called in detection loop while detecting the original problem

Definition at line 66 of file dec_stairheur.cpp.

◆ DEC_MAXCALLROUNDORIGINAL

#define DEC_MAXCALLROUNDORIGINAL   INT_MAX

last round the detector gets called while detecting the original problem

Definition at line 67 of file dec_stairheur.cpp.

◆ DEC_MINCALLROUNDORIGINAL

#define DEC_MINCALLROUNDORIGINAL   0

first round the detector gets called while detecting the original problem

Definition at line 68 of file dec_stairheur.cpp.

◆ DEC_DECCHAR

#define DEC_DECCHAR   's'

display character of detector

Definition at line 69 of file dec_stairheur.cpp.

◆ DEC_ENABLED

#define DEC_ENABLED   FALSE

should detector be called by default

Definition at line 70 of file dec_stairheur.cpp.

◆ DEC_ENABLEDFINISHING

#define DEC_ENABLEDFINISHING   FALSE

should the finishing be enabled

Definition at line 71 of file dec_stairheur.cpp.

◆ DEC_ENABLEDPOSTPROCESSING

#define DEC_ENABLEDPOSTPROCESSING   FALSE

should the postprocessing be enabled

Definition at line 72 of file dec_stairheur.cpp.

◆ DEC_SKIP

#define DEC_SKIP   FALSE

should detector be skipped if others found detections

Definition at line 73 of file dec_stairheur.cpp.

◆ DEC_USEFULRECALL

#define DEC_USEFULRECALL   FALSE

is it useful to call this detector on a descendant of the propagated partialdec

Definition at line 74 of file dec_stairheur.cpp.

◆ DEFAULT_NCONSSPERBLOCK

#define DEFAULT_NCONSSPERBLOCK   32

number of constraints per block (static blocking only)

Definition at line 77 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_MAXBLOCKS

#define DEFAULT_MAXBLOCKS   20

value for the maximum number of blocks to be considered

Definition at line 78 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_MINBLOCKS

#define DEFAULT_MINBLOCKS   2

value for the minimum number of blocks to be considered

Definition at line 79 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_DESIREDBLOCKS

#define DEFAULT_DESIREDBLOCKS   0

value for the desired number of blocks (for all blocking types). Set to zero for self determination of block number

Definition at line 80 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_DYNAMICBLOCKING

#define DEFAULT_DYNAMICBLOCKING   FALSE

Enable blocking type 'dynamic'

Definition at line 81 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_STATICBLOCKING

#define DEFAULT_STATICBLOCKING   TRUE

Enable blocking type 'static'

Definition at line 82 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_BLOCKINGASSOONASPOSSIBLE

#define DEFAULT_BLOCKINGASSOONASPOSSIBLE   FALSE

Enable blocking type 'as soon as possible'

Definition at line 83 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_MULTIPLEDECOMPS

#define DEFAULT_MULTIPLEDECOMPS   TRUE

Enables multiple decompositions for all enabled blocking types. Ranging from minblocks to maxblocks'

Definition at line 84 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ DEFAULT_MAXITERATIONSROC

#define DEFAULT_MAXITERATIONSROC   1000000

The maximum of iterations of the ROC-algorithm. -1 for no iteration limit

Definition at line 85 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ detectorExitStairheur

#define detectorExitStairheur   NULL

Definition at line 1794 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ detectorFinishPartialdecStairheur

#define detectorFinishPartialdecStairheur   NULL

Definition at line 1795 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

◆ detectorPostprocessPartialdecStairheur

#define detectorPostprocessPartialdecStairheur   NULL

Definition at line 1796 of file dec_stairheur.cpp.

Referenced by GCGincludeDetectorStairheur().

Typedef Documentation

◆ INDEXMAP

typedef struct IndexMap INDEXMAP

Definition at line 110 of file dec_stairheur.cpp.

Function Documentation

◆ printnested()

void printnested ( vector< vector< int > > l)

Definition at line 148 of file dec_stairheur.cpp.

References printnested().

Referenced by printnested().

◆ printvector()

void printvector ( vector< int > l)

Definition at line 167 of file dec_stairheur.cpp.

References printvector().

Referenced by printvector().

◆ SCIPvectorCreateInt()

vector< int > SCIPvectorCreateInt ( int from,
int to )
static

TODO: currently, all vars from the first column where a linking var appears until the end of the block are considered as linking vars, although there might be empty columns. This could be changed so that these empty columns are considered as subscipvars and not linking vars.

In some cases a block can consist of linking vars exclusively. This makes no real sense.

For some instances the assertion regarding the consistency of the arrays ibegin and jbegin fails creates a list with integers running from 'from' to 'to'.

Parameters
fromStart index
toEnd index

Definition at line 190 of file dec_stairheur.cpp.

References i, and SCIPvectorCreateInt().

Referenced by rowOrdering(), and SCIPvectorCreateInt().

◆ SCIPvectorRearrange()

void SCIPvectorRearrange ( vector< vector< int > > & l,
vector< int > order )
static

rearranges elements of vector according to the ordering of order.

example: vector = (a b c d); order = (3 2 4 1) after calling SCIPvectorRearrange(vector, order): vector = (c b d a) both vectors must have the same size order must have elements from 1 to vector->size

Definition at line 212 of file dec_stairheur.cpp.

References SCIPvectorRearrange().

Referenced by rankOrderClusteringIteration(), and SCIPvectorRearrange().

◆ indexmapCreate()

SCIP_RETCODE indexmapCreate ( SCIP * scip,
INDEXMAP ** indexmap,
int nconss,
int nvars )
static

allocates memory for an indexmap.

Parameters
scipSCIP data structure
indexmapaddress of the pointer which shall store the index map
nconssnumber of constraints
nvarsnumber of variables

Definition at line 231 of file dec_stairheur.cpp.

References assert(), IndexMap::consindex, IndexMap::indexcons, indexmapCreate(), IndexMap::indexvar, nvars, SCIP_CALL(), and IndexMap::varindex.

Referenced by indexmapCreate(), initData(), and rankOrderClustering().

◆ indexmapFree()

void indexmapFree ( SCIP * scip,
INDEXMAP ** indexmap )
static

deallocates memory of indexmap.

Parameters
scipSCIP data structure
indexmapindex map

Definition at line 256 of file dec_stairheur.cpp.

References indexmapFree(), and SCIPfreeMemory().

Referenced by freeData(), indexmapFree(), and rankOrderClustering().

◆ indexmapInit()

SCIP_RETCODE indexmapInit ( INDEXMAP * indexmap,
gcg::PARTIALDECOMP * partialdec,
int * hashmapindices )
static

initialization method for the indexmap for partialdecs

Parameters
indexmapindex map
partialdecpartial decomposition to create indexmap for
hashmapindicesindices of variables and constraints

Definition at line 271 of file dec_stairheur.cpp.

References assert(), IndexMap::consindex, gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), gcg::PARTIALDECOMP::getOpenconss(), gcg::PARTIALDECOMP::getOpenvars(), i, IndexMap::indexcons, indexmapInit(), IndexMap::indexvar, nvars, SCIP_CALL(), var, and IndexMap::varindex.

Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), indexmapInit(), and rankOrderClustering().

◆ initData()

◆ freeData()

◆ createRowindexList()

SCIP_RETCODE createRowindexList ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
gcg::DETPROBDATA * detprobdata,
GCG_DETECTORDATA * detectordata,
SCIP_HASHMAP * indexcons,
SCIP_HASHMAP * varindex,
vector< vector< int > > & rowindices )
static

creates a nested vector with the indices of the nonzero entries of each row.

example: constraint matrix:

1 1 0 1 0

0 1 1 0 0

0 0 0 0 1

resulting vector: ( (1 2 4) (2 3) (5) )

Parameters
scipSCIP data structure
partialdecpartial decomposition to use for matrix
detprobdatadetection process information and data
detectordatadetector data data structure
indexconshashmap index -> constraint
varindexhashmap variable -> index
rowindicesvector to store the row indices vector

Definition at line 582 of file dec_stairheur.cpp.

References createRowindexList(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::DETPROBDATA::getNVarsForCons(), gcg::DETPROBDATA::getVarsForCons(), GCG_DetectorData::hashmapindices, i, gcg::PARTIALDECOMP::isVarOpenvar(), j, SCIP_CALL(), and SCIPfreeBufferArray().

Referenced by createRowindexList(), GCG_DECL_PROPAGATEPARTIALDEC(), rankOrderClustering(), and rankOrderClusteringIteration().

◆ createColumnindexList()

SCIP_RETCODE createColumnindexList ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
vector< vector< int > > & rowindices,
vector< vector< int > > & columnindices )
static

creates a nested vector with the indices of the nonzero entries of each column.

example:

constraint matrix:

1 1 0 1 0

0 1 1 0 0

0 0 0 0 1

resulting vector: ( (1) (1 2) (2) (1) (3) )

Parameters
scipSCIP data structure
partialdecpartial decomposition to create column index for
rowindicesA vector with the row indices (achieved from calling rowindices_vector() )
columnindicesvector to store the column indices vector

Definition at line 658 of file dec_stairheur.cpp.

References createColumnindexList(), gcg::PARTIALDECOMP::getNOpenvars(), i, and nvars.

Referenced by createColumnindexList(), GCG_DECL_PROPAGATEPARTIALDEC(), rankOrderClustering(), and rankOrderClusteringIteration().

◆ rowOrdering()

vector< int > rowOrdering ( SCIP * scip,
vector< vector< int > > & columnindices,
int nrows )
static

does the row ordering of the ROC2 algorithm.

It also works for the column ordering. In this case the terms row<->column have to be exchanged.

Returns
A vector with the new row order. E.g. (2 3 1) means the second row comes first now, and so on.
Parameters
scipSCIP data structure
columnindicesA vector of the nonzero entries in each column
nrowsThe number of rows of the constraint matrix (=number of relevant constraints)

Definition at line 699 of file dec_stairheur.cpp.

References rowOrdering(), and SCIPvectorCreateInt().

Referenced by rankOrderClusteringIteration(), and rowOrdering().

◆ formIndexArray()

SCIP_RETCODE formIndexArray ( int * begin,
int * end,
vector< vector< int > > & indices )
static

stores the first and last entry of the i-th column(row) in begin[i] and end[i] respectively.

Parameters
beginArray to store the first nonzero entry of the i-th column (row)
endArray to store the last nonzero entry of the i-th column (row)
indicescolumnindices vector (rowindices vector)

Definition at line 738 of file dec_stairheur.cpp.

References assert(), formIndexArray(), and i.

Referenced by formIndexArray(), GCG_DECL_PROPAGATEPARTIALDEC(), and rankOrderClustering().

◆ arraysAreEqual()

SCIP_Bool arraysAreEqual ( int * new_array,
int * old_array,
int num_elements )
static

returns FALSE if at least one entry of new_array and old_array are different.

Parameters
new_arraynew array
old_arrayold array
num_elementslength of arrays

Definition at line 768 of file dec_stairheur.cpp.

References arraysAreEqual(), and i.

Referenced by arraysAreEqual(), and rankOrderClustering().

◆ rankOrderClusteringIteration()

SCIP_RETCODE rankOrderClusteringIteration ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
gcg::DETPROBDATA * detprobdata,
GCG_DETECTORDATA * detectordata,
INDEXMAP * inputmap,
INDEXMAP * outputmap )
static

permutes the order of rows and columns in inputmap and stores the result in outputmap.

One call of this function is equivalent to one iteration of the ROC2-algortihm.

Parameters
scipSCIP data structure
partialdecpartial decomposition to use for permutation
detprobdatadetection process information and data
detectordatadetector data data structure
inputmapindexmap for input
outputmapindexmap for output

Definition at line 791 of file dec_stairheur.cpp.

References assert(), IndexMap::consindex, createColumnindexList(), createRowindexList(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, i, IndexMap::indexcons, IndexMap::indexvar, nvars, rankOrderClusteringIteration(), rowOrdering(), SCIP_CALL(), SCIPdebugMessage(), SCIPvectorRearrange(), var, and IndexMap::varindex.

Referenced by rankOrderClustering(), and rankOrderClusteringIteration().

◆ rankOrderClustering()

SCIP_RETCODE rankOrderClustering ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
gcg::DETPROBDATA * detprobdata,
GCG_DETECTORDATA * detectordata,
int max_iterations,
int * iterations )
static
Parameters
scipSCIP data structure
partialdecpartial decomposition to use for clustering
detprobdatadetection process information and data
detectordatadetector data structure
max_iterationsnumber of maximal iterations
iterationsnumber of performed iterations

Definition at line 871 of file dec_stairheur.cpp.

References arraysAreEqual(), assert(), createColumnindexList(), createRowindexList(), formIndexArray(), gcg::PARTIALDECOMP::getNOpenconss(), gcg::PARTIALDECOMP::getNOpenvars(), GCG_DetectorData::hashmapindices, i, GCG_DetectorData::ibegin, GCG_DetectorData::iend, IndexMap::indexcons, GCG_DetectorData::indexmap, indexmapCreate(), indexmapFree(), indexmapInit(), GCG_DetectorData::jbegin, GCG_DetectorData::jend, nvars, rankOrderClustering(), rankOrderClusteringIteration(), SCIP_CALL(), SCIPdebugMessage(), and IndexMap::varindex.

Referenced by GCG_DECL_PROPAGATEPARTIALDEC(), and rankOrderClustering().

◆ rowsWithConstriction()

SCIP_RETCODE rowsWithConstriction ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
GCG_DETECTORDATA * detectordata )
static

finds rows with local minima regarding the number of linking variables and stores them in detectordata->rowsWithConstrictions

Parameters
scipSCIP data structure
partialdecpartial decomposition to use
detectordatadetector data structure

Definition at line 961 of file dec_stairheur.cpp.

References gcg::PARTIALDECOMP::getNOpenconss(), i, GCG_DetectorData::minV, rowsWithConstriction(), and GCG_DetectorData::rowsWithConstrictions.

Referenced by blocking(), and rowsWithConstriction().

◆ assignConsToBlock()

SCIP_RETCODE assignConsToBlock ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
GCG_DETECTORDATA * detectordata,
int block,
int first_cons,
int last_cons )
static

assigns constraints in the interval [first_cons, last_cons] to 'block'. (for partialdecs)

Parameters
scipSCIP data structure
partialdecpartial decomposition to use
detectordatadetector data structure
blockid of block
first_consindex of first constraint to assign
last_consindex of last constraint to assign

Definition at line 984 of file dec_stairheur.cpp.

References assert(), assignConsToBlock(), GCG_DetectorData::blockedAfterrow, GCG_DetectorData::constoblock, GCG_DetectorData::hashmapindices, i, IndexMap::indexcons, GCG_DetectorData::indexmap, and SCIP_CALL().

Referenced by assignConsToBlock(), blockingDynamic(), and blockingStatic().

◆ getMaxColIndex()

int getMaxColIndex ( GCG_DETECTORDATA * detectordata,
int from_row,
int to_row )
static

returns the largest column index of a nonzero entry between rows [from_row, to_row]

Parameters
detectordatadetector data structure
from_rowindex of starting row to check
to_rowindex of last row to check

Definition at line 1010 of file dec_stairheur.cpp.

References getMaxColIndex(), and GCG_DetectorData::iend.

Referenced by blockingDynamic(), getMaxColIndex(), and isValidBlocking().

◆ getMinColIndex()

int getMinColIndex ( GCG_DETECTORDATA * detectordata,
int row )
static

returns the column index of the first nonzero entry in 'row'. Rows start counting at 1, not 0.

Parameters
detectordatadetector data structure
rowindex of row

Definition at line 1022 of file dec_stairheur.cpp.

References getMinColIndex(), and GCG_DetectorData::ibegin.

Referenced by blockingDynamic(), getMinColIndex(), and isValidBlocking().

◆ isValidBlocking()

SCIP_Bool isValidBlocking ( GCG_DETECTORDATA * detectordata,
int prev_block_first_row,
int prev_block_last_row,
int block_at_row )
static

determines if a blocking at 'block_at_row' is a valid blocking

Returns
TRUE if blocking is valid, else FALSE
Parameters
detectordatadetector data structure
prev_block_first_rowfirst row of the previous block
prev_block_last_rowlast row of the previous block
block_at_rowthe row for which you want to determine if the blocking is valid

Definition at line 1035 of file dec_stairheur.cpp.

References getMaxColIndex(), getMinColIndex(), and isValidBlocking().

Referenced by isValidBlocking(), and nextRowToBlockAt().

◆ findBlockingCandidate()

vector< int >::iterator findBlockingCandidate ( vector< int >::iterator it_constrictions,
vector< int > * it_vector,
int min_block_size,
int prev_block_last_row )
static

this functions looks for rows to block at, which creates block of size min_block_size or bigger

Returns
Iterator pointing to a node which contains a suitable row for blocking; If the iterator points after the last element, no candidate was found
Parameters
it_constrictionsIterator pointing to a vector of constraints (detectordata->rowsWithConstrictions)
it_vectorminimum number of rows to be in a block
min_block_sizethe last row of the preceding block
prev_block_last_rowthe last row of the preceding block

Definition at line 1060 of file dec_stairheur.cpp.

References findBlockingCandidate().

Referenced by findBlockingCandidate(), and nextRowToBlockAt().

◆ nextRowToBlockAt()

vector< int >::iterator nextRowToBlockAt ( GCG_DETECTORDATA * detectordata,
vector< int >::iterator it_constrictions,
vector< int > * it_vector,
int min_block_size,
int prev_block_first_row,
int prev_block_last_row )
static

this functions determines the next row to block at

Returns
Iterator pointing to a node which contains a suitable row for blocking; If the iterator points after the last element, no row was found
Parameters
detectordatadetector data structure
it_constrictionsIterator pointing to a vector of constraints (detectordata->rowsWithConstrictions)
it_vectorvector of constrictions
min_block_sizeminimum number of rows to be in a block
prev_block_first_rowthe first row of the preceding block
prev_block_last_rowthe last row of the preceding block

Definition at line 1089 of file dec_stairheur.cpp.

References findBlockingCandidate(), isValidBlocking(), and nextRowToBlockAt().

Referenced by blockingDynamic(), and nextRowToBlockAt().

◆ calculateNdecompositions()

int calculateNdecompositions ( GCG_DETECTORDATA * detectordata)
static

calculate the number of decompositions in order to allocate decomps array

Parameters
detectordatadetector data structure

Definition at line 1134 of file dec_stairheur.cpp.

References GCG_DetectorData::blockingassoonaspossible, calculateNdecompositions(), GCG_DetectorData::dynamicblocking, GCG_DetectorData::maxblocks, GCG_DetectorData::minblocks, GCG_DetectorData::multipledecomps, and GCG_DetectorData::staticblocking.

Referenced by calculateNdecompositions(), and GCG_DECL_PROPAGATEPARTIALDEC().

◆ checkParameterConsistency()

void checkParameterConsistency ( SCIP * scip,
GCG_DETECTORDATA * detectordata,
SCIP_RESULT * result )
static

check the consistency of the parameters

Parameters
scipSCIP data structure
detectordatadetector data structure
resultpointer to store result

Definition at line 1171 of file dec_stairheur.cpp.

References GCG_DetectorData::blockingassoonaspossible, checkParameterConsistency(), GCG_DetectorData::dynamicblocking, GCG_DetectorData::maxblocks, GCG_DetectorData::minblocks, GCG_DetectorData::multipledecomps, result, and GCG_DetectorData::staticblocking.

Referenced by checkParameterConsistency(), and GCG_DECL_PROPAGATEPARTIALDEC().

◆ blockingDynamic()

SCIP_RETCODE blockingDynamic ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
GCG_DETECTORDATA * detectordata,
int tau,
int nvars )
static

tries to dynamically divide the problem into subproblems (blocks)

Parameters
scipSCIP data structure
partialdecpartial decomposition to use
detectordatadetector data data structure
taudesired number of blocks
nvarsnumber of variables in the problem

Definition at line 1198 of file dec_stairheur.cpp.

References assert(), assignConsToBlock(), GCG_DetectorData::blockedAfterrow, blockingDynamic(), GCG_DetectorData::blocks, getMaxColIndex(), getMinColIndex(), gcg::PARTIALDECOMP::getNOpenconss(), GCG_DetectorData::maxblocks, nextRowToBlockAt(), nvars, GCG_DetectorData::rowsWithConstrictions, SCIP_CALL(), and SCIPdebugMessage().

Referenced by blocking(), and blockingDynamic().

◆ blockingStatic()

SCIP_RETCODE blockingStatic ( SCIP * scip,
gcg::PARTIALDECOMP * partialdec,
GCG_DETECTORDATA * detectordata )
static

creates blocks with the same number of rows (for partialdecs)

Parameters
scipSCIP data structure
partialdecpartial decomposition to create block in
detectordatadetector data data structure

Definition at line 1274 of file dec_stairheur.cpp.

References assert(), assignConsToBlock(), GCG_DetectorData::blockedAfterrow, blockingStatic(), GCG_DetectorData::blocks, gcg::PARTIALDECOMP::getNOpenconss(), GCG_DetectorData::nconssperblock, SCIP_CALL(), and SCIPdebugMessage().

Referenced by blocking(), and blockingStatic().

◆ blockingAsSoonAsPossible()

SCIP_RETCODE blockingAsSoonAsPossible ( SCIP * scip,
GCG_DETECTORDATA * detectordata,
int desired_blocks,
int nvars )
static
Parameters
scipSCIP data structure
detectordatadetector data data structure
desired_blocksdesired number of blocks
nvarsnumber of variables in the problem

Definition at line 1332 of file dec_stairheur.cpp.

References blockingAsSoonAsPossible(), GCG_DetectorData::blocks, and nvars.

Referenced by blocking(), and blockingAsSoonAsPossible().

◆ resetDetectordata()

SCIP_RETCODE resetDetectordata ( SCIP * scip,
GCG_DETECTORDATA * detectordata )
static

resets detectordata such that it can be used for the next decomposition

Parameters
scipSCIP data structure
detectordatadetector data structure

Definition at line 1348 of file dec_stairheur.cpp.

References GCG_DetectorData::constoblock, resetDetectordata(), and SCIP_CALL().

Referenced by blocking(), and resetDetectordata().

◆ blocking()

◆ GCG_DECL_FREEDETECTOR()

GCG_DECL_FREEDETECTOR ( detectorFreeStairheur )
static

destructor of detector to free user data (called when GCG is exiting)

Definition at line 1624 of file dec_stairheur.cpp.

References assert(), GCG_DetectorData::constoblock, DEC_NAME, GCG_DECL_FREEDETECTOR, GCGdetectorGetData(), GCGdetectorGetName(), GCGgetOrigprob(), and SCIPfreeMemory().

◆ GCG_DECL_INITDETECTOR()

◆ GCG_DECL_PROPAGATEPARTIALDEC()

◆ GCG_DECL_SETPARAMFAST() [1/3]

GCG_DECL_SETPARAMFAST ( setParamAggressiveStairheur )
static

◆ GCG_DECL_SETPARAMFAST() [2/3]

GCG_DECL_SETPARAMFAST ( setParamDefaultStairheur )
static

◆ GCG_DECL_SETPARAMFAST() [3/3]

GCG_DECL_SETPARAMFAST ( setParamFastStairheur )
static

◆ GCGincludeDetectorStairheur()