GraphBLAS – Graph algorithms in the language of linear algebra
graphblas.org
graphblas.org
A shorter version of this tutorial was recorded at FOSDEM earlier this year: https://fosdem.org/2020/schedule/event/graphblas/
More papers/tutorials/libraries are listed at https://github.com/GraphBLAS/GraphBLAS-Pointers.
https://www.acm.org/articles/people-of-acm/2019/tim-davis
> I picked Gaussian elimination. "That will be quick," I thought. Not! I got started on matrices in 1985 and I'm not done with Gaussian elimination yet.
> GraphBLAS is a community effort, including industry, academics, and government labs, that is working to design a library that can implement graph algorithms based on sparse linear algebra over semirings. There are lots of great graph libraries out there that don't exploit the linear algebraic abstraction, but most of what they do can be viewed as matrix operations on adjacency matrices. GraphBLAS makes the connection to linear algebra explicit.
> GraphBLAS gives the graph algorithm developer the power and abstraction of linear algebra, with all its advantages (associative and distributive laws, AB=(B'A')', and so on). One level of breadth-first search, for example, is a single sparse matrix-times-sparse vector multiply, with no loss of asymptotic efficiency. Google's entire PageRank computation can be done with a handful of iterations around a single call to GraphBLAS, using what I call the "PageRank semiring."
The author has an example of PageRank in C:
https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable...
I assume his "single call" statement refers to the MATLAB version:
https://github.com/DrTimothyAldenDavis/GraphBLAS/blob/stable...
for i = 1:20
r = ((c*r) * C) + a * sum (r) ;
end
The MATLAB interface uses overloaded operators and methods on a GraphBLAS matrix object.https://github.com/michelp/pygraphblas/blob/master/pygraphbl...
Can someone clarify the notation for me? What is B' and A'? I've never seen that before.
https://github.com/RedisGraph/RedisGraph/
Their paper claims that computing with adjacency (sparse) matrices is more performant than alternatives:
https://arxiv.org/pdf/1905.01294.pdf
They compile queries written in Cypher (Neo4j's language) to operations in linear algebra. An example query is:
MATCH (n:actor{name:"Nicolas Cage"})-[:act]->(m:movie)<-[:act]-(a:actor) RETURN a.name, m.titlehttps://github.com/michelp/pygraphblas/blob/master/pygraphbl...
I also made a quick introduction video for a paper submission you can see here:
Right now, the graphs I'm interested in are reasonably small (tens of thousands of edges), and my oldschool approaches are good enough, but if my employer's products continue their grow trajectory, we'll need to leverage GPUs and TPUs if at all possible. Should I be learning about GraphBLAS?
If the base types don't suit your needs, you can always make your own. Tim Davis has talked about how he's made new types that are small nxn matrices as elements of a larger matrix. You can have complex, quaternion, or complex bags of stuff as matrix elements as long as you define the operators you need to work on those types.
Here's an example of using User Defined Types for a shortest path algorithm that also stores backlinks along the shortest path so the shortest path tree is materialized. in Python:
https://github.com/michelp/pygraphblas/blob/master/pygraphbl...
As for what I'm doing, I work at D-Wave and a lot of my work is on what can be thought of as "compilers" for our quantum computers. There's tons of similarity between my problem area and compilers for FPGAs, for example, so I call it VLSI because that's the right ballpark.
https://andersource.dev/2019/08/25/fun-with-matrix-exponenti...
http://faculty.cse.tamu.edu/davis/GraphBLAS_files/toms_graph...
https://github.com/fabianmurariu/rustgraphblas
and a JNI wrapper
https://github.com/fabianmurariu/graphblas-java-native
They are not 100% complete, the JNI one is not published yet and only works on linux
For example, Canu, one of the more popular current assemblers for PacBio and MinION data, uses a best overlap graph https://genome.cshlp.org/content/27/5/722.long
http://aldenmath.com/performance-of-the-matlab-interface-to-...
http://aldenmath.com/a-matlab-interface-for-suitesparsegraph...
https://github.com/GraphBLAS/LAGraph/blob/master/Source/Algo...
https://github.com/GraphBLAS/LAGraph/blob/master/Source/Algo...
https://github.com/GraphBLAS/LAGraph/blob/master/Source/Algo... (that one has 6 algorithms inside)
https://github.com/GraphBLAS/LAGraph/blob/master/Source/Algo...
We're working on the GPU version, and all the built-in semirings very work nicely on the GPU. For user-defined semirings, we will need the user operators defined as strings containing C code. Then they can all be done on the GPU too.
For delta stepping, it seems all you would need is a priority queue that works in batches as opposed to individual elements. Then to make it performant and match delta stepping code written from scratch, you might need something that can fuse multiple graphblas operations together so that you don't have too many extra memory ops from the priority queue operations.
https://en.wikipedia.org/wiki/Incidence_matrix
the same algebra applies and GraphBLAS works well with them!