Short Notes: Sparse Matrices | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE) PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 1


SPARSE MATRICES
> A sparse matrix is a matrix in which most of the elements of the array are 0.
> There is no exact definition of how many zeroes should be there for a matrix to be called a 
sparse matrix.
> The following matrix can be considered sparse.
0 22 0 1 0 0 0 0 55
0 0 0 0 0 1 55 0 9
0 8 2 0 0 4 0 0 0
4 0 0 0 3 0 0 0 0
78 0 0 0 0 0 0 4 9
0 4 0 2 0 71 3 0 0
> A sparse matrix can be represented as a general matrix. But considering the fact that most 
of the elements are zero, we can use a different representations that uses less amount of 
space.
> One such representation is 3-tuple form.
> In three tuple form, each element is represented by three fields. The first field is row 
number, second is column number and the third is the value.
> But we need not store the three tuple form of zeroes.
> The three tuple form of the above matrix (first three rows) is as follows:
int sparse[][]={ 0,1,22,
0,3,1,
0,8,55,
1,5,1,
1,6,55,
1,8,9,
2,1,8, // And so on
};
> Consider an n X m matrix. Let the number of non-zero elements be x. In 3-tuple form, we 
need 3*x number of storage. So if
3*x < n*m
then 3-tuple form saves space. Otherwise, this method is not very efficient.
Read More
90 docs

Top Courses for Computer Science Engineering (CSE)

Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

Exam

,

video lectures

,

ppt

,

past year papers

,

Viva Questions

,

study material

,

Short Notes: Sparse Matrices | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

mock tests for examination

,

Sample Paper

,

Previous Year Questions with Solutions

,

Semester Notes

,

practice quizzes

,

Objective type Questions

,

MCQs

,

Short Notes: Sparse Matrices | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

Important questions

,

Free

,

shortcuts and tricks

,

pdf

,

Short Notes: Sparse Matrices | Short Notes for Computer Science Engineering - Computer Science Engineering (CSE)

,

Extra Questions

,

Summary

;