nocad.structural.structural_rank#

nocad.structural.structural_rank(M)[source]#

Generic (structural) rank of a matrix: the size of a maximum matching between its rows and columns through non-zero entries.

Examples

>>> structural_rank([[1, 1], [1, 1]]), structural_rank([[1, 0], [1, 0]])
(2, 1)