All Projects → aplbrain → grandiso-networkx

aplbrain / grandiso-networkx

Licence: Apache-2.0 license
Performant, pure-Python subgraph isomorphism and monomorphism search (aka "motif search")

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to grandiso-networkx

Peartree
peartree: A library for converting transit data into a directed graph for sketch network analysis.
Stars: ✭ 116 (+286.67%)
Mutual labels:  graphs, network-analysis
Workshops
Public materials for Statnet Workshops
Stars: ✭ 34 (+13.33%)
Mutual labels:  graphs, network-analysis
Deepgraph
Analyze Data with Pandas-based Networks. Documentation:
Stars: ✭ 232 (+673.33%)
Mutual labels:  graphs, network-analysis
Graph sampling
Graph Sampling is a python package containing various approaches which samples the original graph according to different sample sizes.
Stars: ✭ 99 (+230%)
Mutual labels:  graphs, network-analysis
brainGraph
Graph theory analysis of brain MRI data
Stars: ✭ 136 (+353.33%)
Mutual labels:  network-analysis, connectomics
Grano
A toolkit for mapping networks of political and economic influence through diverse types of entities and their relations. Accessible at http://granoproject.org
Stars: ✭ 181 (+503.33%)
Mutual labels:  graphs, network-analysis
CBioInfCpp-0-
The lib CBioInfCpp.h contains 3 groups of functions for C++: "Input-Output", "Working with strings", "Working with graphs". Data structures "Adjacency vector" and "Adjacency map" are implemented in the last one (i.e. in "Working with graphs"). See About_CBioInfCpp for details.
Stars: ✭ 12 (-60%)
Mutual labels:  graphs, subgraph-isomorphism
mully
R package to create, modify and visualize graphs with multiple layers.
Stars: ✭ 36 (+20%)
Mutual labels:  graphs
NETNOOB
A simple program written in bash that contains basic Linux network tools, information gathering tools and scanning tools.
Stars: ✭ 105 (+250%)
Mutual labels:  network-analysis
graylog-plugin-netflow
[DEPRECATED] Graylog NetFlow plugin
Stars: ✭ 35 (+16.67%)
Mutual labels:  network-analysis
jgrapht
Master repository for the JGraphT project
Stars: ✭ 2,259 (+7430%)
Mutual labels:  graphs
D1Proxy
A simple yet powerful Java 11 TCP MITM proxy for Dofus 1.29.1
Stars: ✭ 17 (-43.33%)
Mutual labels:  network-analysis
MRFcov
Markov random fields with covariates
Stars: ✭ 21 (-30%)
Mutual labels:  network-analysis
SurrealNumbers.jl
Implementation of Conway's Surreal Numbers
Stars: ✭ 30 (+0%)
Mutual labels:  graphs
Erdos.jl
A library for graph analysis written Julia.
Stars: ✭ 37 (+23.33%)
Mutual labels:  graphs
netplot
Beautiful graph drawing
Stars: ✭ 47 (+56.67%)
Mutual labels:  network-analysis
nxontology
NetworkX-based Python library for representing ontologies
Stars: ✭ 45 (+50%)
Mutual labels:  graphs
GraphIO.jl
Graph IO functionality for various formats.
Stars: ✭ 54 (+80%)
Mutual labels:  graphs
asyncmachine
Relational State Machine with a visual inspector
Stars: ✭ 67 (+123.33%)
Mutual labels:  graphs
Leetcode-solutions
Leetcode Grinder.
Stars: ✭ 14 (-53.33%)
Mutual labels:  graphs

Grand Isomorphisms

Codecov GitHub Workflow Status GitHub PyPI

Subgraph isomorphism is a resource-heavy (but branch-parallelizable) algorithm that is hugely impactful for large graph analysis. SotA algorithms for this (Ullmann, VF2, BB-Graph) are heavily RAM-bound, but this is due to a large number of small processes each of which hold a small portion of a traversal tree in memory.

Grand-Iso is a subgraph isomorphism algorithm that exchanges this resource-limitation for a parallelizable partial-match queue structure.

It performs favorably compared to other pure-python (and even some non-pure-python!) implementations:

image

See the wiki for more documentation.

Example Usage

from grandiso import find_motifs
import networkx as nx

host = nx.fast_gnp_random_graph(10, 0.5)

motif = nx.Graph()
motif.add_edge("A", "B")
motif.add_edge("B", "C")
motif.add_edge("C", "D")
motif.add_edge("D", "A")

len(find_motifs(motif, host))

Directed graph support:

from grandiso import find_motifs
import networkx as nx

host = nx.fast_gnp_random_graph(10, 0.5, directed=True)

motif = nx.DiGraph()
motif.add_edge("A", "B")
motif.add_edge("B", "C")
motif.add_edge("C", "D")
motif.add_edge("D", "A")

len(find_motifs(motif, host))

Counts-only

For very large graphs, you may use a good chunk of RAM not only on the queue of hypotheses, but also on the list of results. If all you care about is the NUMBER of results, you should pass count_only=True to the find_motifs function. This will dramatically reduce your RAM overhead on higher-count queries.

There are many other arguments that you can pass to the motif search algorithm. For a full list, see here.

Hacking on this repo

Running Tests

coverage run --source=grandiso -m pytest

Citing

If this tool is helpful to your research, please consider citing it with:

# https://doi.org/10.1038/s41598-021-91025-5
@article{Matelsky_Motifs_2021, 
    title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},
    volume={11}, 
    ISSN={2045-2322}, 
    url={http://dx.doi.org/10.1038/s41598-021-91025-5}, 
    DOI={10.1038/s41598-021-91025-5}, 
    number={1}, 
    journal={Scientific Reports}, 
    publisher={Springer Science and Business Media LLC}, 
    author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},
    year={2021}, 
    month={Jun}
}

Made with 💙 at JHU APL

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].