Skip to content

Commit cbf0b61

Browse files
author
Wimmerer
committed
More docs
1 parent ed38f44 commit cbf0b61

File tree

9 files changed

+72
-4
lines changed

9 files changed

+72
-4
lines changed

docs/src/arrays.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# GBArrays
2+
3+
## Construction

docs/src/assets/AdjacencyBFS.png

33.7 KB
Loading
-26.3 KB
Binary file not shown.

docs/src/binaryops.md

Whitespace-only changes.

docs/src/index.md

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SuiteSparseGraphBLAS.jl
22

33
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.
55

66
# Roadmap
77

@@ -24,6 +24,9 @@ Post 1.0 goals include:
2424
3. More efficient import and export between Julia and GraphBLAS
2525
4. Support for other GraphBLAS implementations in a follow-up GraphBLAS.jl
2626

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+
2730
# Installation
2831

2932
Install using the Julia package manager in the REPL:
@@ -43,7 +46,68 @@ The SuiteSparse:GraphBLAS binary is installed automatically as `SSGraphBLAS_jll`
4346

4447
# Introduction
4548

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+
![BFS and Adjacency Matrix](./assets/AdjacencyBFS.png)
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:
48108

49-
![BFS](./assets/AdjacencyMatrixBFS.png)
109+
| GraphBLAS | Operation | Julia |
110+
|---------------|------------------------------------------|-----------|
111+
| mxm, mxv, vxm | ``\bf C \langle M \rangle = C \odot AB`` | mul!, mul |
112+
| | | |
113+
| | | |

docs/src/monoids.md

Whitespace-only changes.

docs/src/operations.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Operations

docs/src/semirings.md

Whitespace-only changes.

docs/src/unaryops.md

Whitespace-only changes.

0 commit comments

Comments
 (0)