Stacked Linear Algebra Graph
An embedded and in-memory graph using sparse linear algebra.
Capabilities
Architecture
The Stacked Linear Algebra Graph implements a directed graph using GrapBLAS sparse linear algebra. The graph models vertices and adjacency matrices as GraphBLAS sparse vectors and matrices respectively. The graph operates on its vertex vectors and adjacency matrices using GraphBLAS operators.
Data types
The graph stores Rust primitive numeric types in its vertices and edges:
- bool,
- i8
- i16
- i32
- i64
- u8
- u16
- u32
- u64
- f32,
- f64,
- isize
- usize
Indexing
The graph has a dual indexing system - string keys for human understandability and numerical indices for efficiency. Each coordinate maps to both a user-defined unique string key and an unsigned integer index assigned by the graph. Integer indices may be reused by the graph after its key was deleted.
Upon creating a new vertex type, the graph creates a vertex vector for each supported primitive numeric type. Equivalently, upon creating a new edge type the graph creates a new adjacency matrix for each supported value type.
The numerical vertex indices, and their associated keys, reference the same coordinates in all vertex vectors and adjacency matrices. All vertex vectors and adjacency matrices thus have compatible sizes.
Each combination of vertex vector and adjacency matrix thus defines a separate graph. All graphs share the same coordinates.
Linear algebra operations
Graph operators apply to any applicable combination of vertex vector and adjacency matrix.
ACID
Cairn Knowledge Graph does currently not guarantee ACID database transaction properties.
Persistence
The graph resides in-memory and does currently not exist in persistent storage.
Minimum example
use ;
use IsValueEqualTo;
use OperatorOptions;
use PlusTimes;
use ;
use Graph;
use VertexDefinedByKey;
use ;
use ApplyIndexUnaryOperatorToVertexVector;
use element_wise_multiplication
BinaryOperatorElementWiseVertexVectorMultiplication;
use multiplication
VertexVectorAdjacencyMatrixMultiplication;
use ReadVertexValue;
Requirements
Please make sure to meet the requirements for building graphblas_sparse_linear_algebra.
Contributing
Awesome, contributions are welcome. stacked_linear_algebra_graph and your contribution may be relicensed and integrated into commercial software in the future. Therefore, you will be asked to agree to the Contributor License Agreement when you make a pull request.
Licensing
stacked_linear_algebra_graph is licensed under Creative Commons Attribution Non Commercial 4.0 International. For other licensing options, please contact Sam Dekker.
Acknowledgements
Stacked Linear Algebra Graph is inspired by LAGraph and uses the same underlying GraphBLAS implementation from Timothy A. Davis.