You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/index.md
+68-4Lines changed: 68 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# SuiteSparseGraphBLAS.jl
2
2
3
3
SuiteSparseGraphBLAS.jl is a WIP package for sparse linear algebra on arbitrary semirings, with a particular focus on graph computations.
4
-
It is a wrapper over the Tim Davis' SuiteSparse reference implementation of the GraphBLAS C API, although it aims to expose a Julian interface to the user.
4
+
It aims to provide a Julian wrapper over Tim Davis' SuiteSparse reference implementation of the GraphBLAS C specification.
5
5
6
6
# Roadmap
7
7
@@ -24,6 +24,9 @@ Post 1.0 goals include:
24
24
3. More efficient import and export between Julia and GraphBLAS
25
25
4. Support for other GraphBLAS implementations in a follow-up GraphBLAS.jl
26
26
27
+
!!! warning Printing
28
+
Printing is done directly by GraphBLAS in this release. This means printed indices are 0-based, and the displayed type is the equivalent C type. The v1.0 release will alleviate this issue.
29
+
27
30
# Installation
28
31
29
32
Install using the Julia package manager in the REPL:
@@ -43,7 +46,68 @@ The SuiteSparse:GraphBLAS binary is installed automatically as `SSGraphBLAS_jll`
43
46
44
47
# Introduction
45
48
46
-
GraphBLAS harnesses the well-understood duality between graphs and matrices. Specifically a graph
47
-
can be represented by its adjacency matrix, incidence matrix, or the many variations on those formats. With this matrix representation in hand we have a method to operate on the graph using linear algebra operations on the matrix.
49
+
GraphBLAS harnesses the well-understood duality between graphs and matrices.
50
+
Specifically a graph can be represented by its [adjacency matrix](https://en.wikipedia.org/wiki/Adjacency_matrix), [incidence matrix](https://en.wikipedia.org/wiki/Incidence_matrix), or the many variations on those formats.
51
+
With this matrix representation in hand we have a method to operate on the graph using linear algebra operations on the matrix.
52
+
53
+
Below is an example of the adjacency matrix of a directed graph, and finding the neighbors of a single vertex using basic matrix-vector multiplication on the arithemtic semiring.
54
+
55
+

56
+
57
+
# GraphBLAS Concepts
58
+
59
+
The three primary components of GraphBLAS are: matrices, operators, and operations. Operators include monoids, binary operators, and semirings. Operations include the typical linear algebraic operations like matrix multiplication as well as indexing operations.
60
+
61
+
## Matrices
62
+
63
+
SuiteSparseGraphBLAS.jl provides `GBVector` and `GBMatrix` array types which are subtypes of `SparseArrays.AbstractSparseVector` and `SparseArrays.AbstractSparseMatrix` respectively. Both can be constructed with no arguments to use the maximum size.
64
+
65
+
```julia
66
+
julia>GBVector{Float64}()
67
+
1152921504606846976x1 GraphBLAS double vector, sparse by col
68
+
no entries
69
+
70
+
1152921504606846976x1152921504606846976 GraphBLAS int8_t matrix, hypersparse by col
71
+
no entries
72
+
```
73
+
74
+
GraphBLAS array types are opaque to the user in order to allow the library author to choose the best storage format.
75
+
SuiteSparse:GraphBLAS takes advantage of this by storing matrices in one of four formats: dense, bitmap, sparse-compressed, or hypersparse-compressed; and in either row or column major orientation.
76
+
SuiteSparseGraphBLAS.jl sets the default to column major to ensure fast imports and exports.
77
+
78
+
A complete list of construction methods can be found in [Construction](@ref), but the matrix and vector above can be constructed as follows:
79
+
80
+
```julia
81
+
julia> A =GBMatrix([1,1,2,2,3,4,4,5,6,7,7,7], [2,4,5,7,6,1,3,6,3,3,4,5], [1:12...])
82
+
7x7 GraphBLAS int64_t matrix, bitmap by col
83
+
12 entries
84
+
85
+
(3,0) 6
86
+
(0,1) 1
87
+
(3,2) 7
88
+
(5,2) 9
89
+
(6,2) 10
90
+
(0,3) 2
91
+
(6,3) 11
92
+
(1,4) 3
93
+
(6,4) 12
94
+
(2,5) 5
95
+
(4,5) 8
96
+
(1,6) 4
97
+
98
+
v =GBVector([4], [10])
99
+
4x1 GraphBLAS int64_t vector, bitmap by col
100
+
1 entry
101
+
102
+
(3,0) 10
103
+
```
104
+
## Operations
105
+
106
+
A complete list of supported operations can be found in [Operations](@ref).
107
+
GraphBLAS operations are, where possible, wrapped in existing Julia functions. The equivalent Julia functions are:
0 commit comments