What is Sparse Matrix ? Sparse matrix is a matrix in which most of the element are zero. By contrast if the most element are non zero then matrix is Dense. Sparsity of sparse matrix is the number of zero valued elements divided by total no. of element. The following sparse matrix contains only 16 nonzero elements, with 84 zero elements. Its sparsity is 84 %, and its density is 16%. Sparse matrix
Storing Sparse Matrix in memory A matrix is typically stored as a two-dimensional array . In the case of a sparse matrix, Reduction of substantial memory requirement can be realized by storing only the non-zero entries . There are different format in data structure to store Sparse matrix. Sparse matrix is stored in three one-dimensional arrays (using CSR format) Most of the general format for storing sparse matrix is CSR(compressed Row Storage)