1 #ifndef CMR_SEYMOUR_INTERNAL_H
2 #define CMR_SEYMOUR_INTERNAL_H
134 bool printParentElements,
137 bool printReductions,
231 size_t* pivotColumns,
257 size_t* columnsToChild,
258 size_t numChildBaseRows,
259 size_t numChildBaseColumns,
276 size_t* columnsToChild,
277 size_t numChildBaseRows,
278 size_t numChildBaseColumns,
295 size_t* columnsToChild,
296 size_t numChildBaseRows,
297 size_t numChildBaseColumns,
313 size_t* columnsToChild,
314 size_t numChildBaseRows,
315 size_t numChildBaseColumns,
int CMR_ELEMENT
Definition: element.h:20
CMR_ERROR
Type for return codes of library functions.
Definition: env.h:32
int CMR_GRAPH_EDGE
Reference to an edge of CMR_GRAPH.
Definition: graph.h:31
CMR_SEYMOUR_THREESUM_FLAG
Flags that indicate the type of -separation.
Definition: seymour.h:40
CMR_SEYMOUR_NODE_TYPE
Definition: seymour.h:212
Functionality for matroids.
Recognition of series-parallel matrices.
Functionality for Seymour decomposition.
CMR_ERROR CMRregularityNestedMinorSequenceSearchThreeSeparation(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Searches for 3-separations along the sequence of nested minors and decomposes as a 3-sum.
Definition: regularity_partition.c:733
CMR_ERROR CMRregularityTestGraphicness(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Tests matrix for graphicness/network and stores it in dec.
Definition: regularity_graphic.c:1792
CMR_ERROR CMRregularityTestR10(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Tests matrix for representing .
Definition: regularity_r10.c:8
CMR_ERROR CMRseymourAddMinor(CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_MINOR *minor)
Adds a minor to a Seymour decomposition node.
Definition: seymour.c:913
CMR_ERROR CMRregularityDecomposeThreeSum(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue, CMR_SEPA *separation)
Applies a 3-sum decomposition.
Definition: regularity_threesum.c:224
struct DecompositionQueue DecompositionQueue
CMR_ERROR CMRregularityInitNestedMinorSequence(CMR *cmr, DecompositionTask *task, CMR_SUBMAT *wheelSubmatrix)
Initializes a sequence of nested minors with one minor, for a given wheelSubmatrix.
Definition: regularity_nested_minor_sequence.c:1052
CMR_ERROR CMRregularityRefineDecomposition(CMR *cmr, size_t numNodes, CMR_SEYMOUR_NODE **nodes, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
Replaces the subtrees of several nodes of a matroid decomposition tree by new ones.
Definition: seymour.c:2352
CMR_ERROR CMRregularitySearchOneSum(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Performs a 1-sum decomposition of matrix and stores it in dec.
Definition: regularity_onesum.c:20
CMR_ERROR CMRseymourUpdateThreeSumCreateMixedFirstChild(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow1, size_t extraRow2, int8_t extraEntry)
Creates mixed first child of an initialized 3-sum node.
Definition: seymour.c:1508
CMR_ERROR CMRseymourCreateChildFromMatrices(CMR *cmr, CMR_SEYMOUR_NODE *parent, size_t childIndex, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose, CMR_ELEMENT *rowsToParent, CMR_ELEMENT *columnsToParent)
Creates a decomposition node as a child.
Definition: seymour.c:966
void CMRregularityQueueAdd(DecompositionQueue *queue, DecompositionTask *task)
Adds a task to a decomposition queue.
Definition: seymour.c:2138
CMR_ERROR CMRseymourUpdateViolator(CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SUBMAT *violator)
Initialize an existing unknown decomposition node to be irregular with a violator submatrix.
Definition: seymour.c:1051
CMR_ERROR CMRseymourSetNumChildren(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numChildren)
Sets the number of children and allocates memory accordingly.
Definition: seymour.c:945
DecompositionTask * CMRregularityQueueRemove(DecompositionQueue *queue)
Removes a task from a decomposition queue.
Definition: seymour.c:2128
CMR_ERROR CMRseymourUpdateSeriesParallel(CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SUBMAT *reducedSubmatrix)
Updates an existing unknown Seymour decomposition node to be a series-parallel node.
Definition: seymour.c:1068
CMR_ERROR CMRregularityTaskCreateRoot(CMR *cmr, CMR_SEYMOUR_NODE *dec, DecompositionTask **ptask, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, clock_t startClock, double timeLimit)
Creates a decomposition task for the root of the decomposition.
Definition: seymour.c:2050
CMR_ERROR CMRseymourDecompose(CMR *cmr, CMR_CHRMAT *matrix, bool ternary, CMR_SEYMOUR_NODE **proot, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
Tests ternary or binary linear matroid for regularity.
Definition: seymour.c:2234
CMR_ERROR CMRregularityQueueCreate(CMR *cmr, DecompositionQueue **pqueue)
Initializes a decomposition queue.
Definition: seymour.c:2085
CMR_ERROR CMRregularityExtendNestedMinorSequence(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Extends an incomplete sequence of nested 3-connected minors for the matrix of a decomposition node.
Definition: regularity_nested_minor_sequence.c:627
CMR_ERROR CMRregularityQueueFree(CMR *cmr, DecompositionQueue **pqueue)
Frees the decomposition queue.
Definition: seymour.c:2100
CMR_ERROR CMRseymourUpdateThreeSumInit(CMR *cmr, CMR_SEYMOUR_NODE *node)
Initialize an existing unknown decomposition node as a 3-sum node.
Definition: seymour.c:1209
CMR_ERROR CMRseymourUpdateThreeSumCreateMixedSecondChild(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
Creates mixed second child of an initialized 3-sum node.
Definition: seymour.c:1641
CMR_ERROR CMRseymourUpdateTwoSum(CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SEPA *separation)
Initialize an existing unknown decomposition node as a 2-separation node according to the given separ...
Definition: seymour.c:1090
CMR_ERROR CMRregularityNestedMinorSequenceGraphicness(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Tests each minor of the sequence of nested 3-connected minors for graphicness.
Definition: regularity_graphic.c:1623
CMR_ERROR CMRseymourUpdateOneSum(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numChildren)
Initialize an existing unknown decomposition node as a 1-sum with numChildren children.
Definition: seymour.c:1009
CMR_ERROR CMRseymourSetAttributes(CMR_SEYMOUR_NODE *node)
Set regularity and (co)graphicness attributes of a decomposition tree.
Definition: seymour.c:1799
CMR_ERROR CMRseymourUpdatePivots(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numPivots, size_t *pivotRows, size_t *pivotColumns, CMR_CHRMAT *matrix, CMR_CHRMAT *transpose)
Initialize an existing unknown decomposition node as a pivot node according to the given arrays of pi...
Definition: seymour.c:1173
CMR_ERROR CMRregularityNestedMinorSequenceCographicness(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Tests each minor of the sequence of nested 3-connected minors for graphicness.
Definition: regularity_graphic.c:1710
char * CMRseymourConsistency(CMR_SEYMOUR_NODE *node, bool recurse)
Checks a Seymour decomposition node for consistency.
CMR_ERROR CMRregularityTestCographicness(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Tests matrix for cographicness/conetwork and stores it in dec.
Definition: regularity_graphic.c:1877
CMR_ERROR CMRregularityCompleteDecomposition(CMR *cmr, CMR_SEYMOUR_NODE *subtree, CMR_SEYMOUR_PARAMS *params, CMR_SEYMOUR_STATS *stats, double timeLimit)
Replaces the subtree of a matroid decomposition tree by a new one.
Definition: seymour.c:2262
CMR_ERROR CMRseymourUpdateThreeSumCreateWideSecondChild(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
Creates wide second child of an initialized 3-sum node.
Definition: seymour.c:1362
bool CMRregularityQueueEmpty(DecompositionQueue *queue)
Returns whether a queue is empty.
Definition: seymour.c:2121
struct DecompositionTask DecompositionTask
CMR_ERROR CMRregularityTaskFree(CMR *cmr, DecompositionTask **ptask)
Frees a decomposition task.
Definition: seymour.c:2072
CMR_EXPORT CMR_ERROR CMRseymourPrintChild(CMR *cmr, CMR_SEYMOUR_NODE *child, CMR_SEYMOUR_NODE *parent, size_t childIndex, FILE *stream, size_t indent, bool printChildren, bool printParentElements, bool printMatrices, bool printGraphs, bool printReductions, bool printPivots)
Prints the decomposition child to stream.
Definition: seymour.c:353
CMR_ERROR CMRseymourUpdateThreeSumCreateWideFirstChild(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t *rowsToChild, size_t *columnsToChild, size_t numChildBaseRows, size_t numChildBaseColumns, size_t extraRow, size_t extraColumn1, size_t extraColumn2, int8_t extraEntry)
Creates wide first child of an initialized 3-sum node.
Definition: seymour.c:1220
CMR_ERROR CMRregularityDecomposeSeriesParallel(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue)
Splits off series-parallel elements from the matrix of the decomposition node.
Definition: regularity_series_parallel.c:10
Row-wise representation of sparse char matrix.
Definition: matrix.h:220
Definition: env_internal.h:45
A minor of a matroid.
Definition: matroid.h:121
Definition: separation.h:52
Parameters for Seymour decomposition algorithm.
Definition: seymour.h:93
Statistics for Seymour decomposition algorithm.
Definition: seymour.h:169
Represents a series-parallel reduction.
Definition: series_parallel.h:61
Row and column indices for a submatrix.
Definition: matrix.h:28
Definition: seymour_internal.h:354
bool foundNongraphicness
Whether non-graphiness was detected for some node.
Definition: seymour_internal.h:357
DecompositionTask * head
Next task to be processed.
Definition: seymour_internal.h:355
bool foundIrregularity
Whether irregularity was detected for some node.
Definition: seymour_internal.h:356
bool foundNoncographicness
Whether non-cographiness was detected for some node.
Definition: seymour_internal.h:358
Definition: seymour_internal.h:96
struct DecompositionTask * next
Next task in queue.
Definition: seymour_internal.h:98
CMR_SEYMOUR_STATS * stats
Statistics for the computation (may be NULL).
Definition: seymour_internal.h:100
clock_t startClock
Clock for the start time.
Definition: seymour_internal.h:101
CMR_SEYMOUR_NODE * node
Decomposition node that shall be processed.
Definition: seymour_internal.h:97
CMR_SEYMOUR_PARAMS * params
Parameters for the computation.
Definition: seymour_internal.h:99
double timeLimit
Time limit to impose.
Definition: seymour_internal.h:102
Dense matrix.
Definition: densematrix.h:17
Definition: seymour_internal.h:18
CMR_GRAPH * graph
Graph represented by this matrix.
Definition: seymour_internal.h:53
int8_t regularity
Matrix is (not) regular/totally unimodularity if positive (negative), or not determined if zero.
Definition: seymour_internal.h:23
CMR_GRAPH * cograph
Graph represented by the transpose of this matrix.
Definition: seymour_internal.h:58
CMR_ELEMENT * nestedMinorsColumnsOriginal
Maps columns of nestedMinorsDense to elements of matrix.
Definition: seymour_internal.h:88
size_t memMinors
Memory allocated for minors/submatrices.
Definition: seymour_internal.h:49
bool * cographArcsReversed
Array indicating which arcs of the cograph are reversed.
Definition: seymour_internal.h:61
CMR_SEYMOUR_THREESUM_FLAG threesumFlags
Type of 3-sum.
Definition: seymour_internal.h:31
CMR_CHRMAT * transpose
Tranpose of matrix representing this node.
Definition: seymour_internal.h:33
bool testedTwoConnected
Indicates that no 1-separation exists.
Definition: seymour_internal.h:22
size_t numPivots
Number of pivots.
Definition: seymour_internal.h:69
CMR_CHRMAT * nestedMinorsTranspose
Transpose of nestedMinorsMatrix.
Definition: seymour_internal.h:85
size_t numMinors
Number of minors/submatrices.
Definition: seymour_internal.h:50
size_t * columnsToChild
Array for mapping each column to a column of the child (if applicable).
Definition: seymour_internal.h:46
size_t numChildren
Number of child nodes.
Definition: seymour_internal.h:34
size_t nestedMinorsLength
Length of sequence of nested minors.
Definition: seymour_internal.h:79
int8_t cographicness
Matrix is (not) cographic/conetwork if positive (negative), or not determined if zero.
Definition: seymour_internal.h:27
CMR_ELEMENT * denseColumnsOriginal
Maps columns of denseMatrix to elements of matrix.
Definition: seymour_internal.h:74
bool * graphArcsReversed
Array indicating which arcs of the graph are reversed.
Definition: seymour_internal.h:56
size_t * nestedMinorsSequenceNumColumns
Number of columns of sequence of nested minors.
Definition: seymour_internal.h:81
bool testedR10
Matrix does not represent unless type indicates this.
Definition: seymour_internal.h:29
CMR_GRAPH_EDGE * cographForest
Array with edges of spanning forest of cograph.
Definition: seymour_internal.h:59
CMR_ELEMENT * denseRowsOriginal
Maps rows of denseMatrix to elements of matrix.
Definition: seymour_internal.h:73
CMR_MINOR ** minors
Array of minors/submatrices containing more information.
Definition: seymour_internal.h:51
size_t * nestedMinorsSequenceNumRows
Number of rows of sequence of nested minors.
Definition: seymour_internal.h:80
struct _CMR_SEYMOUR_NODE ** children
Array of child nodes.
Definition: seymour_internal.h:35
CMR_GRAPH_EDGE * graphForest
Array with edges of spanning forest of graph.
Definition: seymour_internal.h:54
int8_t graphicness
Matrix is (not) graphic/network if positive (negative), or not determined if zero.
Definition: seymour_internal.h:25
size_t * pivotRows
Rows of pivots.
Definition: seymour_internal.h:67
bool testedSeriesParallel
Already searched for series-parallel reductions.
Definition: seymour_internal.h:63
size_t numColumns
Length of columnsToChild.
Definition: seymour_internal.h:45
size_t * nestedMinorsRowsDense
Maps rows of nested minor sequence to rows of dense.
Definition: seymour_internal.h:75
size_t nestedMinorsLastGraphic
Last minor in sequence of nested minors that is graphic.
Definition: seymour_internal.h:91
size_t nestedMinorsLastCographic
Last minor in sequence of nested minors that is cographic.
Definition: seymour_internal.h:92
CMR_CHRMAT * nestedMinorsMatrix
Sparse support matrix that displays the sequence of nested minors. Rows and columns are permuted acco...
Definition: seymour_internal.h:83
CMR_ELEMENT ** childRowsToParent
Array for mapping a child index to array of child rows to elements of this node.
Definition: seymour_internal.h:36
CMR_SEYMOUR_NODE_TYPE type
Type of this node.
Definition: seymour_internal.h:20
CMR_ELEMENT ** childColumnsToParent
Array for mapping a child index to array of child columns to elements of this node.
Definition: seymour_internal.h:38
CMR_GRAPH_EDGE * cographCoforest
Array with edges of coforest of cograph.
Definition: seymour_internal.h:60
size_t numSeriesParallelReductions
Length of reductions.
Definition: seymour_internal.h:65
size_t used
Reference counter.
Definition: seymour_internal.h:19
DenseBinaryMatrix * denseMatrix
Dense support matrix for nested minors search. Rows and columns are not permuted, but pivots are appl...
Definition: seymour_internal.h:71
CMR_ELEMENT * nestedMinorsRowsOriginal
Maps rows of nestedMinorsMatrix to elements of matrix.
Definition: seymour_internal.h:86
size_t numRows
Length of rowsToChild.
Definition: seymour_internal.h:41
size_t * rowsToChild
Array for mapping each row to a row of the child (if applicable).
Definition: seymour_internal.h:42
size_t * nestedMinorsColumnsDense
Maps columns of nested minor sequence to columns of dense.
Definition: seymour_internal.h:76
bool isTernary
Indicates whether this node belongs to a ternary matrix.
Definition: seymour_internal.h:21
CMR_GRAPH_EDGE * graphCoforest
Array with edges of coforest of graph.
Definition: seymour_internal.h:55
CMR_CHRMAT * matrix
Matrix representing this node.
Definition: seymour_internal.h:32
CMR_SP_REDUCTION * seriesParallelReductions
Array of series-parallel reductions.
Definition: seymour_internal.h:64
size_t * pivotColumns
Columns of pivots.
Definition: seymour_internal.h:68