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

mock tests for examination

,

MCQs

,

practice quizzes

,

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

,

Summary

,

Sample Paper

,

shortcuts and tricks

,

past year papers

,

pdf

,

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

,

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

,

study material

,

Free

,

Important questions

,

Objective type Questions

,

Viva Questions

,

video lectures

,

Previous Year Questions with Solutions

,

ppt

,

Extra Questions

,

Semester Notes

,

Exam

;