Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views9 pages

Addition of Sparse Matrices

Sparse matrices are matrices with many zero elements, allowing for memory-efficient storage and improved performance in computations. The addition of sparse matrices involves converting them to triplet form, merging, and adding values at the same positions. This technique is widely applicable in fields such as machine learning, image processing, and graph algorithms.

Uploaded by

rishabsood109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views9 pages

Addition of Sparse Matrices

Sparse matrices are matrices with many zero elements, allowing for memory-efficient storage and improved performance in computations. The addition of sparse matrices involves converting them to triplet form, merging, and adding values at the same positions. This technique is widely applicable in fields such as machine learning, image processing, and graph algorithms.

Uploaded by

rishabsood109
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Addition of Sparse Matrices

Concept, Representation & Examples


Presented by: [Your Name]
Introduction to Sparse Matrices
• A sparse matrix is a matrix with a large
number of zero elements.
• Useful in memory-efficient storage and
computation.
Why Use Sparse Matrices?
• Saves memory
• Improves performance
• Common in scientific computing, machine
learning, etc.
Representing Sparse Matrices
• Original Matrix:
• [0 0 5]
• [0 8 0]
• [0 0 3]
• Triplet: (0, 2, 5), (1, 1, 8), (2, 2, 3)
Addition of Sparse Matrices
• 1. Convert both matrices to triplet form
• 2. Merge triplets
• 3. Add values at same position
• 4. Convert back to matrix (if needed)
Example – Sparse Matrix Addition
• Matrix A: [0 0 3], [0 4 0], [0 0 5]
• Matrix B: [0 2 0], [0 0 0], [6 0 0]
• Triplet A: (0, 2, 3), (1, 1, 4), (2, 2, 5)
• Triplet B: (0, 1, 2), (2, 0, 6)
• Result: (0, 1, 2), (0, 2, 3), (1, 1, 4), (2, 0, 6), (2,
2, 5)
Final Matrix Result
• [0 2 3]
• [0 4 0]
• [6 0 5]
Applications
• Machine learning (e.g., NLP word
embeddings)
• Image processing (e.g., masks)
• Graph algorithms (e.g., adjacency matrices)
Conclusion
• Sparse matrix addition is efficient using triplet
format
• Saves computation and memory
• Widely used in tech and science

You might also like