1#ifndef CMR_SEYMOUR_INTERNAL_H
2#define CMR_SEYMOUR_INTERNAL_H
138 bool printParentElements,
141 bool printReductions,
237 size_t* pivotColumns,
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_DECOMPOSE_FLAG
Flags that indicate how to decompose as a -sum.
Definition seymour.h:40
CMR_SEYMOUR_NODE_TYPE
Definition seymour.h:176
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:966
CMR_ERROR CMRregularityDecomposeThreeSum(CMR *cmr, DecompositionTask *task, DecompositionQueue *queue, CMR_SEPA *separation)
Applies a 3-sum decomposition.
Definition regularity_threesum.c:27
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:1846
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:1023
void CMRregularityQueueAdd(DecompositionQueue *queue, DecompositionTask *task)
Adds a task to a decomposition queue.
Definition seymour.c:1623
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 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:1108
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:1147
CMR_ERROR CMRseymourSetNumChildren(CMR *cmr, CMR_SEYMOUR_NODE *node, size_t numChildren)
Sets the number of children and allocates memory accordingly.
Definition seymour.c:998
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:1125
char * CMRseymourConsistency(CMR_SEYMOUR_NODE *node, bool recurse)
Checks a Seymour decomposition node for consistency.
DecompositionTask * CMRregularityQueueRemove(DecompositionQueue *queue)
Removes a task from a decomposition queue.
Definition seymour.c:1613
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:1535
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:1719
CMR_ERROR CMRregularityQueueCreate(CMR *cmr, DecompositionQueue **pqueue)
Initializes a decomposition queue.
Definition seymour.c:1570
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:1585
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 CMRseymourSetAttributes(CMR_SEYMOUR_NODE *node)
Set regularity and (co)graphicness attributes of a decomposition tree.
Definition seymour.c:1272
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:1230
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
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:1748
bool CMRregularityQueueEmpty(DecompositionQueue *queue)
Returns whether a queue is empty.
Definition seymour.c:1606
CMR_ERROR CMRregularityTaskFree(CMR *cmr, DecompositionTask **ptask)
Frees a decomposition task.
Definition seymour.c:1557
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:1066
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:347
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:235
Definition env_internal.h:45
A minor of a matroid.
Definition matroid.h:157
Definition separation.h:52
Parameters for Seymour decomposition algorithm.
Definition seymour.h:68
Statistics for Seymour decomposition algorithm.
Definition seymour.h:133
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:275
bool foundNongraphicness
Whether non-graphiness was detected for some node.
Definition seymour_internal.h:278
DecompositionTask * head
Next task to be processed.
Definition seymour_internal.h:276
bool foundIrregularity
Whether irregularity was detected for some node.
Definition seymour_internal.h:277
bool foundNoncographicness
Whether non-cographiness was detected for some node.
Definition seymour_internal.h:279
Definition seymour_internal.h:100
struct DecompositionTask * next
Next task in queue.
Definition seymour_internal.h:102
CMR_SEYMOUR_STATS * stats
Statistics for the computation (may be NULL).
Definition seymour_internal.h:104
clock_t startClock
Clock for the start time.
Definition seymour_internal.h:105
CMR_SEYMOUR_NODE * node
Decomposition node that shall be processed.
Definition seymour_internal.h:101
CMR_SEYMOUR_PARAMS * params
Parameters for the computation.
Definition seymour_internal.h:103
double timeLimit
Time limit to impose.
Definition seymour_internal.h:106
Dense matrix.
Definition densematrix.h:17
Definition seymour_internal.h:18
CMR_GRAPH * graph
Graph represented by this matrix.
Definition seymour_internal.h:57
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:62
CMR_ELEMENT * nestedMinorsColumnsOriginal
Maps columns of nestedMinorsDense to elements of matrix.
Definition seymour_internal.h:92
size_t memMinors
Memory allocated for minors/submatrices.
Definition seymour_internal.h:53
bool * cographArcsReversed
Array indicating which arcs of the cograph are reversed.
Definition seymour_internal.h:65
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 ** childSpecialColumns
Array for mapping a child index to array of special child columns relevant for 2- and 3-sums.
Definition seymour_internal.h:42
size_t numPivots
Number of pivots.
Definition seymour_internal.h:73
CMR_CHRMAT * nestedMinorsTranspose
Transpose of nestedMinorsMatrix.
Definition seymour_internal.h:89
size_t numMinors
Number of minors/submatrices.
Definition seymour_internal.h:54
size_t * columnsToChild
Array for mapping each column to a column of the child (if applicable).
Definition seymour_internal.h:50
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:83
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:78
bool * graphArcsReversed
Array indicating which arcs of the graph are reversed.
Definition seymour_internal.h:60
size_t * nestedMinorsSequenceNumColumns
Number of columns of sequence of nested minors.
Definition seymour_internal.h:85
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:63
CMR_ELEMENT * denseRowsOriginal
Maps rows of denseMatrix to elements of matrix.
Definition seymour_internal.h:77
CMR_MINOR ** minors
Array of minors/submatrices containing more information.
Definition seymour_internal.h:55
size_t * nestedMinorsSequenceNumRows
Number of rows of sequence of nested minors.
Definition seymour_internal.h:84
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:58
CMR_SEYMOUR_DECOMPOSE_FLAG threesumFlags
Type of 3-sum.
Definition seymour_internal.h:31
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:71
bool testedSeriesParallel
Already searched for series-parallel reductions.
Definition seymour_internal.h:67
size_t numColumns
Length of columnsToChild.
Definition seymour_internal.h:49
size_t * nestedMinorsRowsDense
Maps rows of nested minor sequence to rows of dense.
Definition seymour_internal.h:79
size_t nestedMinorsLastGraphic
Last minor in sequence of nested minors that is graphic.
Definition seymour_internal.h:95
size_t nestedMinorsLastCographic
Last minor in sequence of nested minors that is cographic.
Definition seymour_internal.h:96
CMR_CHRMAT * nestedMinorsMatrix
Sparse support matrix that displays the sequence of nested minors. Rows and columns are permuted acco...
Definition seymour_internal.h:87
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:64
size_t numSeriesParallelReductions
Length of reductions.
Definition seymour_internal.h:69
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:75
size_t ** childSpecialRows
Array for mapping a child index to array of special child rows relevant for 2- and 3-sums.
Definition seymour_internal.h:40
CMR_ELEMENT * nestedMinorsRowsOriginal
Maps rows of nestedMinorsMatrix to elements of matrix.
Definition seymour_internal.h:90
size_t numRows
Length of rowsToChild.
Definition seymour_internal.h:45
size_t * rowsToChild
Array for mapping each row to a row of the child (if applicable).
Definition seymour_internal.h:46
size_t * nestedMinorsColumnsDense
Maps columns of nested minor sequence to columns of dense.
Definition seymour_internal.h:80
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:59
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:68
size_t * pivotColumns
Columns of pivots.
Definition seymour_internal.h:72