CMR  1.3.0
Loading...
Searching...
No Matches
seymour.h
Go to the documentation of this file.
1#ifndef CMR_SEYMOUR_H
2#define CMR_SEYMOUR_H
3
12#include <cmr/env.h>
13#include <cmr/matrix.h>
14#include <cmr/matroid.h>
15#include <cmr/graph.h>
16#include <cmr/network.h>
17#include <cmr/series_parallel.h>
18
19#include <stdio.h>
20#include <stdint.h>
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
62
116
123CMR_EXPORT
125 CMR_SEYMOUR_PARAMS* params
126);
127
147
148
153CMR_EXPORT
155 CMR_SEYMOUR_STATS* stats
156);
157
162CMR_EXPORT
164 FILE* stream,
165 CMR_SEYMOUR_STATS* stats,
166 const char* prefix
167);
168
169
170
171struct _CMR_SEYMOUR_NODE;
172
174
204
209CMR_EXPORT
211 CMR_SEYMOUR_NODE* node
212);
213
218CMR_EXPORT
220 CMR_SEYMOUR_NODE* node
221);
222
227CMR_EXPORT
229 CMR_SEYMOUR_NODE* node
230);
231
236CMR_EXPORT
238 CMR_SEYMOUR_NODE* node
239);
240
245CMR_EXPORT
247 CMR_SEYMOUR_NODE* node
248);
249
254CMR_EXPORT
256 CMR_SEYMOUR_NODE* node
257);
258
263CMR_EXPORT
265 CMR_SEYMOUR_NODE* node
266);
267
272CMR_EXPORT
274 CMR_SEYMOUR_NODE* node,
275 size_t childIndex
276);
277
282CMR_EXPORT
284 CMR_SEYMOUR_NODE* node
285);
286
291CMR_EXPORT
293 CMR_SEYMOUR_NODE* node
294);
295
300CMR_EXPORT
302 CMR_SEYMOUR_NODE* node,
303 size_t minorIndex
304);
305
313CMR_EXPORT
315 CMR_SEYMOUR_NODE* node
316);
317
325CMR_EXPORT
327 CMR_SEYMOUR_NODE* node
328);
329
337CMR_EXPORT
339 CMR_SEYMOUR_NODE* node
340);
341
346CMR_EXPORT
347size_t CMRseymourNumRows(
348 CMR_SEYMOUR_NODE* node
349);
350
355CMR_EXPORT
357 CMR_SEYMOUR_NODE* node
358);
359
364CMR_EXPORT
366 CMR_SEYMOUR_NODE* node,
367 size_t childIndex
368);
369
374CMR_EXPORT
376 CMR_SEYMOUR_NODE* node,
377 size_t childIndex
378);
379
384CMR_EXPORT
386 CMR_SEYMOUR_NODE* node,
387 size_t childIndex
388);
389
394CMR_EXPORT
396 CMR_SEYMOUR_NODE* node,
397 size_t childIndex
398);
399
404CMR_EXPORT
406 CMR_SEYMOUR_NODE* node
407);
408
413CMR_EXPORT
415 CMR_SEYMOUR_NODE* node
416);
417
422CMR_EXPORT
424 CMR_SEYMOUR_NODE* dec
425);
426
431CMR_EXPORT
433 CMR_SEYMOUR_NODE* node
434);
435
440CMR_EXPORT
442 CMR_SEYMOUR_NODE* node
443);
444
449CMR_EXPORT
451 CMR_SEYMOUR_NODE* node
452);
453
458CMR_EXPORT
460 CMR_SEYMOUR_NODE* node
461);
462
467CMR_EXPORT
469 CMR_SEYMOUR_NODE* node
470);
471
476CMR_EXPORT
478 CMR_SEYMOUR_NODE* node
479);
480
485CMR_EXPORT
487 CMR_SEYMOUR_NODE* node
488);
489
494CMR_EXPORT
496 CMR_SEYMOUR_NODE* node
497);
498
503CMR_EXPORT
505 CMR_SEYMOUR_NODE* node
506);
507
512CMR_EXPORT
514 CMR_SEYMOUR_NODE* node
515);
516
521CMR_EXPORT
522size_t* CMRseymourPivotRows(
523 CMR_SEYMOUR_NODE* node
524);
525
530CMR_EXPORT
532 CMR_SEYMOUR_NODE* node
533);
534
539CMR_EXPORT
540size_t CMRseymourGetUsed(
541 CMR_SEYMOUR_NODE* node
542);
543
548CMR_EXPORT
550 CMR* cmr,
551 CMR_SEYMOUR_NODE* node,
552 FILE* stream,
553 bool printChildren,
554 bool printParentElements,
555 bool printMatrices,
556 bool printGraphs,
557 bool printReductions,
558 bool printPivots
559);
560
565CMR_EXPORT
567 CMR* cmr,
568 CMR_SEYMOUR_NODE* node
569);
570
578CMR_EXPORT
580 CMR* cmr,
581 CMR_SEYMOUR_NODE** pnode
582);
583
588CMR_EXPORT
590 CMR* cmr,
591 CMR_SEYMOUR_NODE** pnode,
592 bool isTernary,
594 bool copyMatrix
595);
596
602CMR_EXPORT
604 CMR* cmr,
605 CMR_SEYMOUR_NODE* node,
606 CMR_SEYMOUR_NODE** pclone
607);
608
616CMR_EXPORT
617CMR_ERROR CMRseymourCloneSubtrees(CMR* cmr, size_t numSubtrees, CMR_SEYMOUR_NODE** subtreeRoots,
618 CMR_SEYMOUR_NODE** clonedSubtrees);
619
622#ifdef __cplusplus
623}
624#endif
625
626#endif /* CMR_SEYMOUR_H */
int CMR_ELEMENT
Definition element.h:20
Basic functionality of the software library.
CMR_ERROR
Type for return codes of library functions.
Definition env.h:32
Functionality for graphs.
int CMR_GRAPH_EDGE
Reference to an edge of CMR_GRAPH.
Definition graph.h:31
CMR_EXPORT bool CMRseymourHasTranspose(CMR_SEYMOUR_NODE *node)
Returns true iff the transposed matrix of the decomposition node dec is stored.
Definition seymour.c:102
CMR_EXPORT int8_t CMRseymourCographicness(CMR_SEYMOUR_NODE *node)
Indicates cographicness/being conetwork.
Definition seymour.c:146
CMR_EXPORT CMR_GRAPH_EDGE * CMRseymourCographForest(CMR_SEYMOUR_NODE *node)
Returns the forest of the cograph (if available).
Definition seymour.c:283
CMR_EXPORT size_t CMRseymourNumPivots(CMR_SEYMOUR_NODE *node)
Returns the number of pivots (if available).
Definition seymour.c:318
CMR_EXPORT size_t CMRseymourNumRows(CMR_SEYMOUR_NODE *node)
Returns the number of rows.
Definition seymour.c:160
CMR_EXPORT CMR_GRAPH * CMRseymourCograph(CMR_SEYMOUR_NODE *node)
Returns the cograph (if available).
Definition seymour.c:262
CMR_EXPORT size_t CMRseymourGetUsed(CMR_SEYMOUR_NODE *node)
Returns node's reference counter.
Definition seymour.c:339
CMR_SEYMOUR_DECOMPOSE_FLAG
Flags that indicate how to decompose as a -sum.
Definition seymour.h:40
CMR_EXPORT size_t CMRseymourCographSizeForest(CMR_SEYMOUR_NODE *node)
Returns the number of edges of the cograph's forest (if available).
Definition seymour.c:269
CMR_EXPORT bool CMRseymourIsTernary(CMR_SEYMOUR_NODE *node)
Returns true iff the decomposition is over .
Definition seymour.c:88
CMR_EXPORT CMR_GRAPH_EDGE * CMRseymourGraphForest(CMR_SEYMOUR_NODE *node)
Returns the forest of the graph (if available).
Definition seymour.c:213
CMR_EXPORT CMR_ERROR CMRseymourRelease(CMR *cmr, CMR_SEYMOUR_NODE **pnode)
Releases a decomposition node, freeing it if this was the last reference.
Definition seymour.c:635
CMR_EXPORT size_t CMRseymourNumChildren(CMR_SEYMOUR_NODE *node)
Returns the number of children of the decomposition node dec.
Definition seymour.c:116
CMR_EXPORT CMR_ERROR CMRseymourCapture(CMR *cmr, CMR_SEYMOUR_NODE *node)
Increases the reference counter by 1.
Definition seymour.c:623
CMR_EXPORT CMR_ELEMENT * CMRseymourChildRowsToParent(CMR_SEYMOUR_NODE *node, size_t childIndex)
Returns the mapping of rows of child childIndex to this node's elements.
Definition seymour.c:167
CMR_EXPORT CMR_GRAPH_EDGE * CMRseymourGraphCoforest(CMR_SEYMOUR_NODE *node)
Returns the coforest of the graph (if available).
Definition seymour.c:234
CMR_EXPORT int8_t CMRseymourGraphicness(CMR_SEYMOUR_NODE *node)
Indicates graphicness/being network.
Definition seymour.c:139
CMR_EXPORT size_t CMRseymourCographSizeCoforest(CMR_SEYMOUR_NODE *node)
Returns the number of edges of the cograph's coforest (if available).
Definition seymour.c:290
CMR_EXPORT CMR_CHRMAT * CMRseymourGetTranspose(CMR_SEYMOUR_NODE *node)
Returns the transposed matrix of the decomposition node dec (or NULL if it is not stored).
Definition seymour.c:109
CMR_EXPORT CMR_ELEMENT * CMRseymourChildColumnsToParent(CMR_SEYMOUR_NODE *node, size_t childIndex)
Returns the mapping of columns of child childIndex to this node's elements.
Definition seymour.c:175
CMR_EXPORT CMR_ERROR CMRseymourPrint(CMR *cmr, CMR_SEYMOUR_NODE *node, FILE *stream, bool printChildren, bool printParentElements, bool printMatrices, bool printGraphs, bool printReductions, bool printPivots)
Prints the decomposition dec to stream.
Definition seymour.c:611
CMR_EXPORT size_t CMRseymourNumColumns(CMR_SEYMOUR_NODE *node)
Returns the number of columns.
Definition seymour.c:199
CMR_EXPORT bool CMRseymourThreeSumConcentratedRank(CMR_SEYMOUR_NODE *node)
Returns true iff the 3-sum decomposition node has -separation with one rank-2 matrix.
CMR_EXPORT bool * CMRseymourCographArcsReversed(CMR_SEYMOUR_NODE *node)
Returns an array that indicates for the cograph's edges whether they must be reversed (if available).
Definition seymour.c:311
CMR_EXPORT CMR_SEYMOUR_NODE_TYPE CMRseymourType(CMR_SEYMOUR_NODE *node)
Returns the type of a decomposition node dec.
Definition seymour.c:131
CMR_SEYMOUR_NODE_TYPE
Definition seymour.h:176
CMR_EXPORT bool * CMRseymourGraphArcsReversed(CMR_SEYMOUR_NODE *node)
Returns an array that indicates for the graph's edges whether they must be reversed (if available).
Definition seymour.c:255
CMR_EXPORT CMR_GRAPH * CMRseymourGraph(CMR_SEYMOUR_NODE *node)
Returns the graph (if available).
Definition seymour.c:206
CMR_EXPORT size_t CMRseymourGraphSizeCoforest(CMR_SEYMOUR_NODE *node)
Returns the number of edges of the graph's coforest (if available).
Definition seymour.c:241
CMR_EXPORT CMR_ERROR CMRseymourCloneUnknown(CMR *cmr, CMR_SEYMOUR_NODE *node, CMR_SEYMOUR_NODE **pclone)
Clones a decomposition node node into *pclone which represents the same matrix but has type CMR_SEYMO...
Definition seymour.c:808
CMR_EXPORT CMR_ERROR CMRseymourStatsInit(CMR_SEYMOUR_STATS *stats)
Initializes all statistics for Seymour decomposition computations.
Definition seymour.c:35
CMR_EXPORT CMR_ERROR CMRseymourParamsInit(CMR_SEYMOUR_PARAMS *params)
Initializes the default parameters for regularity testing.
Definition seymour.c:15
CMR_EXPORT CMR_GRAPH_EDGE * CMRseymourCographCoforest(CMR_SEYMOUR_NODE *node)
Returns the coforest of the cograph (if available).
Definition seymour.c:304
CMR_EXPORT size_t CMRseymourNumMinors(CMR_SEYMOUR_NODE *node)
Returns the number of minors of the decomposition node.
Definition seymour.c:983
CMR_EXPORT int8_t CMRseymourRegularity(CMR_SEYMOUR_NODE *node)
Indicates regularity/total unimodularity.
Definition seymour.c:153
CMR_EXPORT CMR_ERROR CMRseymourStatsPrint(FILE *stream, CMR_SEYMOUR_STATS *stats, const char *prefix)
Prints statistics for Seymour decomposition computations.
Definition seymour.c:55
CMR_EXPORT size_t CMRseymourGraphSizeForest(CMR_SEYMOUR_NODE *dec)
Returns the number of edges of the graph's forest (if available).
Definition seymour.c:220
CMR_EXPORT bool CMRseymourThreeSumDistributedRanks(CMR_SEYMOUR_NODE *node)
Returns true iff the 3-sum decomposition node has -separation with two rank-1 matrices.
CMR_EXPORT size_t * CMRseymourChildSpecialColumns(CMR_SEYMOUR_NODE *node, size_t childIndex)
Returns the array of special columns of child childIndex.
Definition seymour.c:191
CMR_EXPORT size_t * CMRseymourPivotRows(CMR_SEYMOUR_NODE *node)
Returns the array with the pivot rows (if available).
Definition seymour.c:325
CMR_EXPORT CMR_MINOR * CMRseymourMinor(CMR_SEYMOUR_NODE *node, size_t minorIndex)
Returns a minor of the decomposition node.
Definition seymour.c:990
CMR_EXPORT size_t * CMRseymourChildSpecialRows(CMR_SEYMOUR_NODE *node, size_t childIndex)
Returns the array of special rows of child childIndex.
Definition seymour.c:183
CMR_EXPORT CMR_ERROR CMRseymourCreate(CMR *cmr, CMR_SEYMOUR_NODE **pnode, bool isTernary, CMR_CHRMAT *matrix, bool copyMatrix)
Creates an unknown decomposition node as a root.
Definition seymour.c:950
CMR_EXPORT size_t * CMRseymourPivotColumns(CMR_SEYMOUR_NODE *node)
Returns the array with the pivot columns (if available).
Definition seymour.c:332
CMR_EXPORT CMR_ERROR CMRseymourCloneSubtrees(CMR *cmr, size_t numSubtrees, CMR_SEYMOUR_NODE **subtreeRoots, CMR_SEYMOUR_NODE **clonedSubtrees)
Clones the union of subtrees of a Seymour decomposition, returning the copies.
Definition seymour.c:1507
CMR_EXPORT CMR_SEYMOUR_NODE * CMRseymourChild(CMR_SEYMOUR_NODE *node, size_t childIndex)
Returns a child of the decomposition node dec.
Definition seymour.c:123
CMR_EXPORT CMR_CHRMAT * CMRseymourGetMatrix(CMR_SEYMOUR_NODE *node)
Returns the matrix of the decomposition node dec (or NULL if it is not stored).
Definition seymour.c:95
@ CMR_SEYMOUR_DECOMPOSE_FLAG_CONCENTRATED_THREESUM
Definition seymour.h:53
@ CMR_SEYMOUR_DECOMPOSE_FLAG_DISTRIBUTED_YSUM
Definition seymour.h:47
@ CMR_SEYMOUR_DECOMPOSE_FLAG_CONCENTRATED_MASK
Definition seymour.h:49
@ CMR_SEYMOUR_DECOMPOSE_FLAG_CONCENTRATED_PIVOT
Definition seymour.h:51
@ CMR_SEYMOUR_DECOMPOSE_FLAG_TRUEMPER
Definition seymour.h:58
@ CMR_SEYMOUR_DECOMPOSE_FLAG_DISTRIBUTED_PIVOT
Definition seymour.h:43
@ CMR_SEYMOUR_DECOMPOSE_FLAG_DISTRIBUTED_DELTASUM
Definition seymour.h:45
@ CMR_SEYMOUR_DECOMPOSE_FLAG_DISTRIBUTED_MASK
Definition seymour.h:41
@ CMR_SEYMOUR_DECOMPOSE_FLAG_SEYMOUR
Definition seymour.h:55
@ CMR_SEYMOUR_NODE_TYPE_UNKNOWN
Definition seymour.h:179
@ CMR_SEYMOUR_NODE_TYPE_SERIES_PARALLEL
Definition seymour.h:181
@ CMR_SEYMOUR_NODE_TYPE_PLANAR
Definition seymour.h:189
@ CMR_SEYMOUR_NODE_TYPE_PIVOTS
Definition seymour.h:183
@ CMR_SEYMOUR_NODE_TYPE_R10
Definition seymour.h:191
@ CMR_SEYMOUR_NODE_TYPE_YSUM
Definition seymour.h:201
@ CMR_SEYMOUR_NODE_TYPE_DELTASUM
Definition seymour.h:197
@ CMR_SEYMOUR_NODE_TYPE_IRREGULAR
Definition seymour.h:177
@ CMR_SEYMOUR_NODE_TYPE_ONESUM
Definition seymour.h:193
@ CMR_SEYMOUR_NODE_TYPE_THREESUM
Definition seymour.h:199
@ CMR_SEYMOUR_NODE_TYPE_TWOSUM
Definition seymour.h:195
@ CMR_SEYMOUR_NODE_TYPE_GRAPH
Definition seymour.h:185
@ CMR_SEYMOUR_NODE_TYPE_COGRAPH
Definition seymour.h:187
Functionality for sparse matrices.
Functionality for matroids.
Computation and recognition of network matrices and conetwork matrices.
Recognition of series-parallel matrices.
Row-wise representation of sparse char matrix.
Definition matrix.h:235
Definition env_internal.h:45
Statistics for graphicness test.
Definition graphic.h:34
Definition graph.h:49
A minor of a matroid.
Definition matroid.h:157
Statistics for recognition algorithm for network matrices.
Definition network.h:36
Parameters for Seymour decomposition algorithm.
Definition seymour.h:68
bool planarityCheck
Whether minors identified as graphic should still be checked for cographicness; default: false.
Definition seymour.h:81
bool constructLeafGraphs
Whether to construct (co)graphs for all leaf nodes that are (co)graphic or (co)network.
Definition seymour.h:111
bool stopWhenNongraphic
Whether to stop decomposing once non-graphicness (or being non-network) is determined.
Definition seymour.h:71
bool preferGraphicness
Whether to first test for (co)graphicness (or being (co)network) before applying series-parallel redu...
Definition seymour.h:85
bool stopWhenNoncographic
Whether to stop decomposing once non-cographicness (or being non-conetwork) is determined.
Definition seymour.h:73
bool directGraphicness
Whether to use fast graphicness routines; default: true.
Definition seymour.h:83
bool seriesParallel
Whether to allow series-parallel operations in the decomposition tree; default: true.
Definition seymour.h:79
bool stopWhenNeitherGraphicNorCoGraphic
Whether to stop decomposing once non-graphicness and non-cographicness (or not being network and not ...
Definition seymour.h:75
bool constructAllGraphs
Whether to construct (co)graphs for all nodes that are (co)graphic or (co)network.
Definition seymour.h:113
bool stopWhenIrregular
Whether to stop decomposing once irregularity is determined.
Definition seymour.h:69
int decomposeStrategy
How to deal with 3-separations.
Definition seymour.h:88
Statistics for Seymour decomposition algorithm.
Definition seymour.h:133
CMR_NETWORK_STATISTICS network
Definition seymour.h:138
CMR_SP_STATISTICS seriesParallel
Definition seymour.h:136
double sequenceGraphicTime
Definition seymour.h:142
double sequenceExtensionTime
Definition seymour.h:140
uint32_t enumerationCandidatesCount
Definition seymour.h:145
double enumerationTime
Definition seymour.h:144
double totalTime
Definition seymour.h:135
uint32_t enumerationCount
Definition seymour.h:143
uint32_t sequenceGraphicCount
Definition seymour.h:141
CMR_GRAPHIC_STATISTICS graphic
Definition seymour.h:137
uint32_t sequenceExtensionCount
Definition seymour.h:139
uint32_t totalCount
Definition seymour.h:134
Statistics for series-parallel recognition algorithm.
Definition series_parallel.h:25
Definition seymour_internal.h:18
bool isTernary
Indicates whether this node belongs to a ternary matrix.
Definition seymour_internal.h:21
CMR_CHRMAT * matrix
Matrix representing this node.
Definition seymour_internal.h:32