Check wether a matrix is totally unimodular.

1 |

`A` |
An object of class |

A matrix for which the determinant of every square submatrix equals *-1*, *0* or *1*
is called *totally unimodular*. This function tests if a matrix with
coefficients in *\{-1,0,1\}* is totally unimodular. It tries to reduce the matrix
using the reduction method described in Scholtus (2008). Next, a test based
on Heller and Tompkins (1956) or Raghavachari is performed.

logical

Heller I and Tompkins CB (1956). An extension of a theorem of Danttzig's In kuhn HW and Tucker AW (eds.), pp. 247-254. Princeton University Press.

Raghavachari M (1976). A constructive method to recognize the total unimodularity of a matrix. _Zeitschrift fur operations research_, *20*, pp. 59-61.

Scholtus S (2008). Algorithms for correcting some obvious inconsistencies and rounding errors in business survey data. Technical Report 08015, Netherlands.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ```
# Totally unimodular matrix, reduces to nothing
A <- matrix(c(
1,1,0,0,0,
-1,0,0,1,0,
0,0,01,1,0,
0,0,0,-1,1),nrow=5)
isTotallyUnimodular(A)
# Totally unimodular matrix, by Heller-Tompson criterium
A <- matrix(c(
1,1,0,0,
0,0,1,1,
1,0,1,0,
0,1,0,1),nrow=4)
isTotallyUnimodular(A)
# Totally unimodular matrix, by Raghavachani recursive criterium
A <- matrix(c(
1,1,1,
1,1,0,
1,0,1))
isTotallyUnimodular(A)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.