All Projects → fabianmurariu → rustgraphblas

fabianmurariu / rustgraphblas

Licence: other
rust-library to wrap GraphBLAS.h

Programming Languages

rust
11053 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to rustgraphblas

grblas
Python wrapper around GraphBLAS
Stars: ✭ 22 (-4.35%)
Mutual labels:  graph-algorithms, graphblas
ghakuf
A Rust library for parsing/building SMF (Standard MIDI File).
Stars: ✭ 30 (+30.43%)
Mutual labels:  rust-library
crc32c
Fast CRC-32-Castagnoli implementation in Rust
Stars: ✭ 26 (+13.04%)
Mutual labels:  rust-library
twitter-stream-rs
A Rust library for listening on Twitter Streaming API.
Stars: ✭ 66 (+186.96%)
Mutual labels:  rust-library
RioGNN
Reinforced Neighborhood Selection Guided Multi-Relational Graph Neural Networks
Stars: ✭ 46 (+100%)
Mutual labels:  graph-algorithms
rust-phonenumber
Library for parsing, formatting and validating international phone numbers.
Stars: ✭ 99 (+330.43%)
Mutual labels:  rust-library
Awesome-Rust-MachineLearning
This repository is a list of machine learning libraries written in Rust. It's a compilation of GitHub repositories, blogs, books, movies, discussions, papers, etc. 🦀
Stars: ✭ 1,110 (+4726.09%)
Mutual labels:  rust-library
edgebundle
R package implementing edge bundling algorithms
Stars: ✭ 100 (+334.78%)
Mutual labels:  graph-algorithms
NGCF-PyTorch
PyTorch Implementation for Neural Graph Collaborative Filtering
Stars: ✭ 200 (+769.57%)
Mutual labels:  graph-algorithms
HuaweiCodeCraft2020
2020华为软件精英挑战赛
Stars: ✭ 14 (-39.13%)
Mutual labels:  graph-algorithms
contour-rs
Contour polygon creation in Rust (using marching squares algorithm)
Stars: ✭ 33 (+43.48%)
Mutual labels:  rust-library
Nebuchadnezzar
High Performance Key-Value Store
Stars: ✭ 49 (+113.04%)
Mutual labels:  rust-library
Advanced-Shortest-Paths-Algorithms
Java Code for Contraction Hierarchies Algorithm, A-Star Algorithm and Bidirectional Dijkstra Algorithm. Tested and Verified Code.
Stars: ✭ 63 (+173.91%)
Mutual labels:  graph-algorithms
InterviewPrep
A repository containing link of good interview questions
Stars: ✭ 54 (+134.78%)
Mutual labels:  graph-algorithms
codebreaker-rs
A Rust library to decrypt & encrypt any cheat code for CodeBreaker PS2
Stars: ✭ 18 (-21.74%)
Mutual labels:  rust-library
arangors
Easy to use rust driver for arangoDB
Stars: ✭ 120 (+421.74%)
Mutual labels:  rust-library
vfin
🦈 GUI framework agnostic virtual DOM library
Stars: ✭ 17 (-26.09%)
Mutual labels:  rust-library
tentacle
A multiplexed p2p network framework that supports custom protocols
Stars: ✭ 41 (+78.26%)
Mutual labels:  rust-library
Grafatko
An app for creating and visualizing graphs and graph-related algorithms.
Stars: ✭ 22 (-4.35%)
Mutual labels:  graph-algorithms
shell2batch
Coverts simple basic shell scripts to windows batch scripts.
Stars: ✭ 42 (+82.61%)
Mutual labels:  rust-library

rustgraphblas

Wrapper for GraphBLAS.h exposing a nicer rust API

Exposes a set of routines over sparse matrices and sparse vectors combined with various semirings. This allows graphs to be represented as sparse matrices and various algorithms (bfs, connected components, page rank, ..) to be implemented as a set of linear algebra operations.

More about GraphBLAS here

Requirements: build and install GraphBLAS dependency, for details seehere

cd deps/GraphBLAS
make clean install

Example of BFS from bfs5m.c

/**
 * this is the test for the graph on the cover of 
 * Graph Algorithms in the Language of Linear Algebra
 * where by multiplying a boolean matrix with 
 * a boolean vector on the and/or semiring until there are no successor we get BFS
 * */
fn graph_blas_port_bfs(){
    let s:u64 = 0; // start at 0
    let n = 7; //vertices

    let mut A = SparseMatrix::<bool>::empty((n, n));

    let edges_n:usize = 10;
    A.load(edges_n as u64, &vec![true; edges_n],
           &[0, 0, 1, 1, 2, 3, 4, 5, 6, 6],
           &[1, 3, 6, 4, 5, 2, 5, 2, 2, 3]);

    let mut v = SparseVector::<i32>::empty(n);
    let mut q = SparseVector::<bool>::empty(n);

    let mut default_desc = Descriptor::default();

    // GrB_assign (v, NULL, NULL, 0, GrB_ALL, n, NULL) ;   // make v dense
    v.assign_all(empty_mask::<bool>(), None, 0, n, &default_desc);

    //finish pending work on v
    assert_eq!(n, v.nvals());
    // GrB_Vector_setElement (q, true, s) ;   // q[s] = true, false elsewhere
    q.insert(s, true);

    // GrB_Monoid_new (&Lor, GrB_LOR, (bool) false) ;
    // GrB_Semiring_new (&Boolean, Lor, GrB_LAND) ;
    // FIXME: Semirings do not OWN monoids
    let lor_monoid = SparseMonoid::<bool>::new(BinaryOp::<bool, bool, bool>::lor(), false);
    let lor_monoid2 = SparseMonoid::<bool>::new(BinaryOp::<bool, bool, bool>::lor(), false);
    let or_and_semi = Semiring::new(lor_monoid, BinaryOp::<bool, bool, bool>::land());


    let mut desc = Descriptor::default();
    desc.set(Field::Mask, Value::SCMP).set(Field::Output, Value::Replace);

    let mut successor = true;

    let mut level:i32 = 1;
    while successor && level <= (n as i32) {
        v.assign_all(Some(&q), None, level, n, &default_desc);

        q.vxm(Some(&v), None, &A, &or_and_semi, &desc);

        q.reduce(&mut successor, None, &lor_monoid2, &default_desc);

        level = level + 1;
    }
    assert_eq!(v.get(0), Some(1));

    assert_eq!(v.get(1), Some(2));
    assert_eq!(v.get(3), Some(2));

    assert_eq!(v.get(4), Some(3));
    assert_eq!(v.get(6), Some(3));
    assert_eq!(v.get(2), Some(3));

    assert_eq!(v.get(5), Some(4));

}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].