This library aims to be a graph analogue to Pandas. It aims to provide fast and memory efficient operations for read-only graphs.
By exploiting CSR Sparse matrices, we can efficiently pack and traverse graphs in memory (as long as we don't add/delete nodes often).
import csrgraph as cg
G = cg.csrgraph(data)
G.mat # This is the underlying scipy.sparse.csr_matrix
For instance, all the procedures in scipy csgraph
module here will function directly on the G.mat
object.
The rest of the csrgraph
class is mainly around managing node names, ingesting, and optimized (numba compiled) methods.
pip install csrgraph
- Add support for directed graphs