Back to Projects
Backend

Sparse Matrix Operations

This project is a C-based implementation of a sparse matrix library that supports creation, display, mathematical operations, and logical operations using a linked-list representation and pointers. It focuses on memory efficiency and optimized processing for matrices with a high number of zero values.

January 2026Updated Sep 2026
Sparse Matrix Operations

Overview

Sparse Matrix Operations in C is an educational project aimed at implementing a complete and efficient library for handling sparse matrices. The project focuses on optimizing memory usage and computational efficiency by storing only non-zero elements, making it suitable for large matrices where most values are zero.

The library provides a wide range of core, mathematical, and logical operations, allowing users to manipulate sparse matrices dynamically while maintaining clarity, modularity, and performance.

Architecture & Data Structure

The system relies on a linked-list-based representation:

  • Each matrix is represented as a linked list of rows
  • Each row contains a linked list of non-zero elements
  • Each element stores its value and column index

This structure enables:

  • Efficient memory usage
  • Dynamic matrix resizing
  • Faster traversal and operations on sparse data

Key Features

Core Operations

  • Sparse matrix creation (interactive or programmatic)
  • Formatted matrix display
  • Sub-matrix extraction and matrix division

Mathematical Operations

  • Addition of sparse matrices
  • Multiplication with dimension validation
  • Efficient matrix transposition

Logical Operations

  • AND, OR, XOR operations between matrices
  • NOT operation on a single matrix

Testing & Validation

  • Dedicated test suites for basic, mathematical, and logical operations
  • Modular and maintainable project structure

My Contribution

I worked on the design and implementation of the sparse matrix data structures and core logic in C, including linked-list representations, matrix creation, traversal, and manipulation. I also contributed to implementing mathematical and logical operations, organizing the codebase into clear modules, and validating functionality through structured test cases.

👯 Collaborator: AbdelAziz Akeb

Outcome

  • A fully functional sparse matrix library in C
  • Optimized memory usage by storing only non-zero elements
  • Support for advanced mathematical and logical operations
  • A solid foundation for further extensions and performance improvements

Skills and Tools

CLinked ListMakefileUnit Tests

Project Links

Sparse Matrix Operations | Portfolio