Sparse Matrix Article Index for
Sparse
Website Links For
Sparse
 

Information About

Sparse Matrix




In the Mathematical subfield of Numerical Analysis a sparse matrix is a Matrix populated primarily with zeros.

Conceptually, sparsity corresponds to systems which are loosely coupled. Consider a line of balls connected by springs from one to the next; this is a sparse system. By contrast, if the same line of balls had springs connecting every ball to every other ball, the system would be represented by a dense matrix. The concept of sparsity is useful in Combinatorics and application areas such as Network Theory , of a low density of significant data or connections.

Huge sparse matrices often appear in Science or Engineering when solving Partial Differential Equations .

When storing and manipulating sparse matrices on a Computer , it is beneficial and often necessary to use specialized algorithms and data structures that take advantage of the sparse structure of the matrix. Operations using standard matrix structures and algorithms are slow and consume large amounts of memory when applied to large sparse matrices. Sparse data is by nature easily Compressed , and this compression almost always results in significantly less Memory usage. Indeed, some very large sparse matrices are impossible to manipulate with the standard algorithms.


STORING A SPARSE MATRIX


  • ''m'') / 8 bytes to represent the matrix when assuming 1 bit for each entry.


A sparse matrix contains many (often mostly) zero entries. The basic idea when storing sparse matrices is to only store the non-zero entries as opposed to storing all entries. Depending on the number and distribution of the non-zero entries, different Data Structure s can be used and yield huge savings in Memory when compared to a naive approach.

One example of such a sparse matrix format is the (old) Yale Sparse Matrix Format {Link without Title} . It stores an initial sparse ''N''×''N'' matrix ''M'' in row form using three arrays, ''A'', ''IA'', ''JA''. ''NZ'' denotes the number of nonzero entries in matrix ''M''.
The array ''A'' then is of length ''NZ'' and holds all nonzero entries of ''M''. The array ''IA'' stores at ''IA(i)'' the position of the first element of row ''i'' in the sparse array ''A''. The length of row ''i'' is determined by ''IA(i+1) - IA(i)''. Therefore ''IA'' needs to be of length ''N'' + 1. In array ''JA'', the column index of the element ''A(j)'' is stored. ''JA'' is of length ''NZ''.

Another possibility is to use Quadtrees .


Example


A Bitmap image having only 2 colors, with one of them dominant (say a file that stores a handwritten Signature ) can be encoded as a sparse matrix that contains only row and column numbers for Pixels with the non-dominant color.


Diagonal matrices

A very efficient structure for a Diagonal Matrix is to store just the entries in the main diagonal as a one dimensional array so a diagonal ''n''×''n'' matrix requires we need only ''n'' entries.


BANDWIDTH


The ''lower bandwidth'' of a matrix ''A'' is the smallest number ''p'' such that the entry ''a''''ij'' vanishes whenever ''i'' > ''j'' + p. Similarly, the ''upper bandwidth'' is the smallest ''p'' such that ''a''''ij'' = 0 whenever ''i'' < ''j'' − ''p'' . For example, a Tridiagonal Matrix has lower bandwidth 1 and upper bandwidth 1.


Reducing bandwidth


The Cuthill-McKee Algorithm can be used to reduce the bandwidth of a sparse Symmetric Matrix . There are however matrices for which the Reverse Cuthill-McKee Algorithm performs better.

The National Geodetic Survey (NGS) uses Dr. Richard Snay's "Banker's" Algorithm because on realistic sparse matrices used in Geodesy work it has better performance.

There are many other methods in use.


REDUCING FILL-IN


"Fill-in" redirects here. For the puzzle, see Fill-In (puzzle) .


The fill-in of a matrix are those entries which change from an initial zero to a non-zero value during the execution of an algorithm. To reduce the memory requirements and the number of arithmetic operations used during an algorithm it is useful to minimize the fill-in by switching rows and columns in the matrix. The Symbolic Cholesky Decomposition can be used to calculate the worst possible fill-in before doing the actual Cholesky Decomposition .

There are other methods than the Cholesky Decomposition in use. Orthogonalization methods (such as QR factorization) are common, for example, when solving problems by least squares methods. While the theoretical fill-in is still the same, in practical terms the "false non-zeros" can be different for different methods. And symbolic versions of those algorithms can be used in the same manner as the symbolic Cholesky to compute worst case fill-in.


SOLVING SPARSE MATRIX EQUATIONS


Both Iterative and direct methods exist for sparse matrix solving. One popular iterative method is the Conjugate Gradient method.


SEE ALSO



REFERENCES

  • Tewarson, Reginald P , Sparse Matrices (Part of the Mathematics in Science & Engineering series), Academic Press Inc., May 1973. (This book, by a professor at the State University of New York at Stony Book, was the first book exclusevely dedicated to Sparse Matrices. Graduate courses using this as a textbook were offered at that University in the early 1980s).

  • Sparse Matrix Multiplication Package, Randolph E. Bank, Craig C. Douglas {Link without Title}

  • Pissanetzky, Sergio 1984, "Sparse Matrix Technology", Academic Press

  • R. A. Snay. Reducing the profile of sparse symmetric matrices. Bulletin Géodésique, 50:341–352, 1976. Also NOAA Technical Memorandum NOS NGS-4, National Geodetic Survey, Rockville, MD.



FURTHER READING




SEE ALSO