An open API service indexing awesome lists of open source software.

https://github.com/aplbrain/gordium

A tool for untangling the mysteries of large-scale graphs.
https://github.com/aplbrain/gordium

Last synced: 11 months ago
JSON representation

A tool for untangling the mysteries of large-scale graphs.

Awesome Lists containing this project

README

          

# gordium
A tool for untangling the mysteries of large-scale graphs.

## Installation

```shell
git clone https://github.com/aplbrain/gordium.git
pip install -r requirements.txt
pip install .
```

## Data
Gordium expects to receive a pandas DataFrame representing an edge list. It will handle two columns containing the ids of source nodes and target nodes respectively. By default, these column names are expected to be "source" and "target", but they can be specified by passing values for `src_label` and `tgt_label` to the Gordium constructor. At present, all edges are treated as directed, multiedges are ignored, edge attributes are ignored, and selfloops are permitted. A typical CSV representing the edgeframe of a directed 3-cycle is presented below.

```csv
source,target
0,1
1,2
2,0
```

## Usage

```python
import pandas as pd
from gordium import Gordium

edgeframe = pd.read_csv('example.csv')
g = Gordium(
edgeframe,
src_label='MY_SOURCE',
tgt_label='MY_TARGET')
analytics = g.process()
```

## Graph Backends
Gordium defaults to using NetworkX for its graph
algorithms, but it also supports several additional
backends. To use a different backend, pass the
backend constructor into the Gordium constructor as
a `backend`.

Current backends include:
- NetworkXBackend
- IGraphBackend (optional; requires [igraph](https://igraph.org/python/))

```python
import pandas as pd
from gordium import Gordium, IGraphBackend

edgeframe = pd.read_csv('example.csv')
g = Gordium(
edgeframe,
backend=IGraphBackend,
src_label='MY_SOURCE',
tgt_label='MY_TARGET')
analytics = g.process()
```