Skip to content

Commit

Permalink
Implemented TU test via Eulerian submatrices.
Browse files Browse the repository at this point in the history
  • Loading branch information
discopt committed Feb 21, 2024
1 parent 79a8e53 commit 224beac
Show file tree
Hide file tree
Showing 6 changed files with 444 additions and 89 deletions.
1 change: 1 addition & 0 deletions doc/changes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Change Log # {#changes}

- Revised the matroid decomposition structure.
- Fixed a bug in the code for printing dot-files for transposed graphic/network matrices; reported by Christopher Hojny.
- Added a `timeLimit` parameter to all potentially time intensive functions.
- Bugfix for the `timeLimit` parameter.
Expand Down
8 changes: 6 additions & 2 deletions doc/tu.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ determines whether the matrix given in file `IN-MAT` is totally unimodular.
- `-i FORMAT` Format of file `IN-MAT`, among `dense` for \ref dense-matrix and `sparse` for \ref sparse-matrix; default: dense.
- `-D OUT-DEC` Write a decomposition tree of the underlying regular matroid to file `OUT-DEC`; default: skip computation.
- `-N NON-SUB` Write a minimal non-totally-unimodular submatrix to file `NON-SUB`; default: skip computation.
- `-s` Print statistics about the computation to stderr.

**Advanced options:**
- `--stats` Print statistics about the computation to stderr.
- `--time-limit LIMIT` Allow at most LIMIT seconds for the computation.
- `--no-direct-graphic` Check only 3-connected matrices for regularity.
- `--no-series-parallel` Do not allow series-parallel operations in decomposition tree.
- `--algo ALGO` Use algorithm from {decomposition, submatrix, partition}; default: decomposition.

If `IN-MAT` is `-` then the matrix is read from stdin.
If `OUT-DEC` or `NON-SUB` is `-` then the decomposition tree (resp. the submatrix) is written to stdout.
Expand Down Expand Up @@ -54,6 +56,8 @@ In order to repeat experiments described in the paper above, the function can be

The corresponding function in the library is

- CMRtestTotalUnimodularity() tests a matrix for being totally unimodular.
- CMRtuTest() tests a matrix for being totally unimodular.

and is defined in \ref tu.h.
Its parameters also allow to choose one of the enumeration algorithms with exponential running time instead of the decomposition algorithm.

16 changes: 14 additions & 2 deletions include/cmr/tu.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ extern "C" {
typedef enum
{
CMR_TU_ALGORITHM_DECOMPOSITION = 0, /**< \brief Algorithm based on Seymour's decomposition of regular matroids. */
CMR_TU_ALGORITHM_SUBMATRIX = 1, /**< \brief Enumeration algorithm based on submatrices. */
CMR_TU_ALGORITHM_EULERIAN = 1, /**< \brief Enumeration algorithm based on Eulerian submatrices. */
CMR_TU_ALGORITHM_PARTITION = 2 /**< \brief Enumeration algorithm based on criterion of Ghouila-Houri. */
} CMR_TU_ALGORITHM;

Expand All @@ -47,7 +47,19 @@ CMR_ERROR CMRtuParamsInit(
* \brief Statistics for recognition algorithm for [totally unimodular](\ref tu) matrices.
*/

typedef CMR_REGULAR_STATS CMR_TU_STATS;
typedef struct
{
CMR_REGULAR_STATS decomposition; /**< Statistics for regular matroid decomposition algorithm. */

uint32_t enumerationRowSubsets; /**< Number of considered row subsets in enumeration algorithm. */
uint32_t enumerationColumnSubsets; /**< Number of considered column subsets in enumeration algorithm. */
double enumerationTime; /**< Total time of enumeration algorithm. */

uint32_t partitionRowSubsets; /**< Number of considered row subsets in partition algorithm. */
uint32_t partitionColumnSubsets; /**< Number of considered column subsets in partition algorithm. */
double partitionTime; /**< Total time of partition algorithm. */

} CMR_TU_STATS;

/**
* \brief Initializes all statistics for recognition algorithm for [totally unimodular](\ref tu) matrices.
Expand Down
Loading

0 comments on commit 224beac

Please sign in to comment.