/graphlist

The `GraphList` python class is a datastructure to efficiently store homogeneous graph data.

Primary LanguagePythonMIT LicenseMIT

GraphList Data Structures

The GraphList class is a data structure to efficiently store homogeneous graph data.

What is homogeneous graph data?

In homogeneous graph datasets all nodes, edges and graph attributes are of the same shape and type across the dataset.

In a machine learning setting (e.g. graph neural networks) this is a common restriction on the data. The GraphList data structure expoits this restriction to store data more efficiently (less python objects, less numpy arrays).

Features of this library

  • Importing data from networkx graphs
  • Indexing graph datasets with...
    • integer indices (graphs[42])
    • list of integer indices (graphs[[3,5,7]])
    • slices (graphs[3:9])
  • Persisting data to disk (with HDF5)
    • Writing, appending and reading from HDF5 files
    • lazily read data from disk
  • Dtype Support
    • All common numerical values (see numpy types)
    • Strings

Installation

> git clone https://github.com/robinruff/graphlist
> cd graphlist
> pip install .

Examples:

See example_code.py

Credits

This library is inspired by jraphs GraphsTuple implementation.

Dependencies: