A matrix is sparse if a high percentage of its elements are zero. “High”, of course, is a relative term, but if about 50% or more of the elements are zero the matrix may be considered sparse. With this percentage of null elements, use of data structures other than the standard two-dimensional array may result in a substantial saving of space or execution time, space because the storage of the zero elements is suppressed and time because we do no operations with them. Consider scahng the columns of an n x n matrix A. Mathematically, we do this by postmultiplying A by a diagonal matrix S of scale factors,
But no sane programmer would store S as an n x n matrix. He would store it as a vector, thus using only n memory locations. Likewise, he would not use a matrix multiplication routine for the product A· S. He would multiply all of the elements in the first column of A by the first scale factor, the second column by the second scale factor, and so forth. In this way only n2 arithmetic operations, rather than n3 as with matrix multiphcation, would be needed.
$$A' = A \cdot S \cdot$$
KeywordsExpense Sorting Imid
Unable to display preview. Download preview PDF.
- George, A. and Liu, J.W. (1981). Computer Solution of Large Sparse Positive Definite Systems (Prentice-Hall, Englewood Cliffs, NJ.).Google Scholar
- Horowitz, E. and Sahni, S. (1984). Fundamentals of Data Structures in PASCAL (Computer Science Press, Rockville, Md.).Google Scholar
- Knuth, D.E. (1973). Sorting and Searching: Vol. 3 of The Art of Computer Programming (Addison-Wesley, Reading, Mass.).Google Scholar
- Wirth, N. (1976). Algorithms + Data Structures = Programs (Prentice-Hall, Englewood Cliffs, N.J.). In 1985 a version of this book with programming examples in Modulo-2 instead of PASCAL appearedGoogle Scholar
© Springer-Verlag New York Inc. 1990