Professional Documents
Culture Documents
Sparse Matrices: Sparse Many Elements Are Zero Dense Few Elements Are Zero
Sparse Matrices: Sparse Many Elements Are Zero Dense Few Elements Are Zero
Web analysis.
authority page page that has many links to it
hub page links to many authority pages
Representation Of Unstructured
Sparse Matrices
Single linear list in row-major order.
scan the nonzero elements of the sparse matrix in rowmajor order
each nonzero element is represented by a triple
(row, column, value)
the list of triples may be an array list or a linked list
(chain)
00304
00570
00000
02600
list =
row
1 1 2 2 4 4
column 3 5 3 4 2 3
value 3 4 5 7 2 6
list =
row
1 1 2 2 4 4
column 3 5 3 4 2 3
value
3 4 5 7 2 6
element 0 1 2 3
row
1 1 2 2
column 3 5 3 4
value 3 4 5 7
4
4
2
2
5
4
3
6
Chain Representation
Node structure.
row
value
col
next
Single Chain
row
= column
value
list
1 1 2 2 4 4
3 5 3 4 2 3
3 4 5 7 2 6
1 3
1 5
2 3
2 4
firstNode
4 2
2
4 3
6
null
00304
00570
00000
next
col
value
00304
null
3
00570
00000
02600
null
null
2
row[]
col
next
value
Row Lists
1 3 3
1 5 4
n
00304
2 3 5
00570
00000
02600
null
4 2 2
4 3 6
n
2 4 7
n
Column Lists
1 3 3
1 5 4
n
00304
2 3 5
00570
00000
02600
4 2 2
n
4 3 6
n
2 4 7
Orthogonal Lists
1 3 3
1 5 4
n n
00304
2 3 5
00570
00000
02600
null
4 2 2
n
row[]
4 3 6
n n
2 4 7
n
Variations
Runtime Performance
Matrix Transpose
500 x 500 matrix with 1994 nonzero elements
2D array
Single Array List
One Chain Per Row
210 ms
6 ms
12 ms
Performance
Matrix Addition.
500 x 500 matrices with 1994 and 999 nonzero
elements
2D array
Single Array List
One Chain Per Row
880 ms
18 ms
29 ms