---
title: "Sparse, banded matrix and memory optimization"
subject: "Computational Techniques in Civil Engineering"
chapter: 2
key: "semester_8/computational_techniques_in_civil_engineering:sparse-banded-memory"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/sparse-banded-memory
site: BCT Engineering
---

# Sparse, banded matrix and memory optimization

Computational Techniques in Civil Engineering · Chapter 2: Solutions of linear equations

- Asked in: 2079 Shrawan, 3 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/sparse-banded-memory
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-2

## Question

What do you mean by sparse matrix, banded matrix and memory optimization?

## Short answer

A sparse matrix has most entries zero. A banded matrix has nonzeros concentrated near the main diagonal. Memory optimization reduces storage by exploiting symmetry, storing band/skyline, storing only nonzeros with index arrays, and renumbering nodes to minimize bandwidth; banded elimination needs about n b^2 operations instead of n^3.

## Answer

**Sparse matrix:** a matrix in which most entries are zero. Stiffness matrices of FEM are sparse because a node is connected only to the nodes of neighbouring elements.

**Banded matrix:** a matrix whose non-zero entries lie in a narrow band about the main diagonal, i.e. $a_{ij}=0$ for $|i-j|>b$. The half-bandwidth is
$$
b=(\text{max difference of node numbers in an element}+1)\times \text{dof per node}
$$
A symmetric matrix of order $n$ and half-bandwidth $b$ is stored with only $n\times b$ numbers instead of $n^2$.

```text
 x x . . .
 x x x . .      band along the
 . x x x .      diagonal, zeros
 . . x x x      outside
 . . . x x
```

**Memory optimisation:** reducing the memory needed to store and solve $[K]\{U\}=\{F\}$. Techniques are:
- store only the upper triangle (symmetry);
- store only the band (banded storage) or the skyline profile;
- store only non-zero terms with index arrays (sparse storage);
- renumber nodes to minimise bandwidth.
Less memory also gives fewer operations: the cost of banded elimination is about $n b^2$ instead of $n^3$.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is a sparse matrix?
   A. One where most entries are zero
   B. One with all diagonal entries zero
   C. One that is symmetric
   D. One with a band
   Answer: A. FEM stiffness matrices are sparse. (Key point: Sparse)

2. How is half-bandwidth b computed?
   A. Number of nodes x dof
   B. Number of elements
   C. Maximum node number
   D. (max node number difference in an element + 1) x dof per node
   Answer: D. Banded storage uses n x b numbers. (Key point: Half-bandwidth)

3. Which technique reduces memory for [K]?
   A. Storing the full matrix
   B. Increasing dof per node
   C. Renumbering nodes to minimise bandwidth
   D. Using unsymmetric storage
   Answer: C. Smaller bandwidth reduces storage and operations. (Key point: Memory reduction)

## Related in Computational Techniques in Civil Engineering

- [Banded matrix and skyline storage](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Abanded-skyline-storage) — Computational Techniques in Civil Engineering, chapter 2

## Related in other subjects

- [Optimization of hydraulic tunnel diameter](https://www.bctengineer.com/question.md?key=semester_7%2Fhydropower_engineering%3Atunnel-optimization-diameter) — Hydropower Engineering, chapter 6, asked 2×
- [Unique/non-unique decoding, memory mapped I/O](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Aunique-nonunique-decoding-memory-mapped-io) — Microprocessor, chapter 4
- [I/O mapped vs memory mapped I/O](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aiomapped-vs-memmapped) — Instrumentation II, chapter 2
- [Full vs partial address decoding for memory](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Afull-vs-partial-decoding) — Instrumentation II, chapter 2
