isTotallyUnimodular {deducorrect} | R Documentation |
Test for total unimodularity of a matrix.
Description
Check wether a matrix is totally unimodular.
Usage
isTotallyUnimodular(A)
Arguments
A |
An object of class |
Details
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.
Value
logical
References
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.
Examples
# 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)