Skip to main content

OrbitSI using NetworkX for Python

License: Apache 2.0 DOI Python Version C++ PyPI version

OrbitSI is a NetworkX-based Python package that efficiently solves the subgraph isomorphism enumeration problem, i.e., finding all subgraphs in a large data graph Gd that are isomorphic to a pattern/query graph Gp. It also supports fast vertex orbit counting, which summarises the local structural roles of vertices within a network.

OrbitSI combines orbit-based filtering and ordering to prune and order candidate node mappings, significantly reducing the search space during subgraph matching. It integrates two state-of-the-art orbit counting engines — EVOKE and ORCA — via optimised C++ bindings using pybind11. Graphs are networkx graphs; the filter, the matching order and the counting search also run in a C++ core (the default for counting), and graph files are read in C++ straight into arrays.

The package includes a command-line interface (CLI), usable library, and testing utilities. It is installable via pip, tested on synthetic and real-world benchmark datasets, and fully open source under the Apache 2.0 license.


Documentation

The documentation is at sitauhidi.github.io/OrbitSI: installation, Python and command-line usage, the graph file format, how the algorithm works, and the API reference. It is built from docs/ with Sphinx.


Installation

Install from PyPi:

pip install orbitsi

Install from source

  1. Clone the repository:
git clone https://github.com/sitauhidi/OrbitSI.git
cd OrbitSI
  1. Build and install:
pip install .

Requires Python 3.8+, NumPy, NetworkX, and a C++17 compiler (e.g., g++ or clang++).


Command-Line Interface (CLI) Usage

Once installed, the orbitsi CLI tool allows you to perform:

  1. Subgraph Isomorphism Search
  2. Node Orbit Counting

To confirm installation:

orbitsi --help

Find all subgraphs in a large graph Gd that are isomorphic to a smaller query/pattern graph Gp.

Command:
orbitsi search --data <path_to_data_graph> --pattern <path_to_pattern_graph> [--orbit-counter evoke|orca] [--graphlet-size 4|5] [--order auto|core] [--arc-consistency] [--no-contraction] [--no-edge-thinning] [--no-tail] [--published] [--backend cpp|python] [--count-only]
Arguments:
  • --data: Path to the data graph file (required)
  • --pattern: Path to the pattern/query graph file (required)
  • --orbit-counter: Orbit counting backend, either evoke (default) or orca
  • --graphlet-size: Graphlet size to use for orbit counting (4 or 5, default: 4; orca supports 4 only)
  • --order: Matching order, auto (OrbitSI's orbit-strength order, default) or core (2-core first, then most already-matched neighbours, then fewest candidates)
  • --arc-consistency: Also run arc consistency (a candidate of u needs, for every pattern neighbour u', a data neighbour among u''s candidates; repeated to a fixpoint) after NLF and after the orbit filter. Off by default, as in OrbitSI as published
  • --no-contraction: Leave out the NLF rounds on the candidate subgraph before the orbit filter (repeated while the subgraph shrinks by at least 5%, so orbits are counted on a smaller graph)
  • --no-edge-thinning: Count orbits on every edge of the candidate subgraph, not only on the edges some pattern edge can map onto
  • --no-tail: Search the last pattern vertices one by one instead of counting them together
  • --published: OrbitSI's algorithm as published: the orbit-strength order, no arc consistency, and none of contraction, edge thinning or tail counting (overrides --order, --arc-consistency and the three options above). Candidates, order and count are those of the published algorithm; the implementation is the current one
  • --backend: Implementation of --count-only, cpp (default) or python. cpp applies only with --orbit-counter evoke; with orca the count runs in Python. Listing the embeddings always runs in Python
  • --count-only: Print only the number of matches, counted without storing them (much faster and lighter when there are many)

Contraction, edge thinning and tail counting are on by default; none of them changes the matches found.

Example:
orbitsi search --data datasets/data_graph/HPRD.graph --pattern datasets/query_graph/query1.graph --orbit-counter evoke --graphlet-size 4

Orbit Counting for a Graph

Compute node orbit vectors for a given graph using either the EVOKE or ORCA backend.

Command:
orbitsi count-orbits --graph <path_to_graph> [--orbit-counter evoke|orca] [--graphlet-size 4|5] [--induced]
Arguments:
  • --graph: Path to the graph file (required)
  • --orbit-counter: Orbit counting backend, either evoke (default) or orca
  • --graphlet-size: Size of graphlets to consider (4 or 5; orca supports 4 only)
  • --induced: Flag to compute induced orbit counts (optional; default is non-induced)
Example:
orbitsi count-orbits --graph datasets/data_graph/HPRD.graph --orbit-counter evoke --graphlet-size 5 --induced

Graph File Format

All graphs should be in .graph format:

t N M
v 0 1 2
v 1 2 1
...
e 0 1
e 1 2
...
  • t N M: number of nodes N and edges M
  • v ID Label Degree: vertex ID, label (label is required), degree (optional)
  • e u v: edge between vertex u and v

Vertex IDs and labels are integers within 64 bits; IDs need not be 0..N-1 or in order. Only the first fields of v and e lines are read, and every other line (including t) is ignored. Repeated edges and self-loops are kept once; a repeated v line updates the label. A vertex that appears only in edges has no label. Graphs are undirected.


Python API

from orbitsi.utils import read_graph_from_file
from orbitsi.orbit import EVOKEOrbitCounter
from orbitsi.search import OrbitSIEngine

G = read_graph_from_file("datasets/data_graph/HPRD.graph")
P = read_graph_from_file("datasets/query_graph/query_dense_16_1.graph")

engine = OrbitSIEngine(G, EVOKEOrbitCounter, graphlet_size=4)
engine.count(P)   # number of embeddings (C++ core)
engine.run(P)     # list of embeddings, as {pattern node: data node} dicts (Python)

OrbitSIEngine takes the same options as the CLI (order_method, arc_consistency, contraction, edge_thinning, tail, published, backend). orbitsi.core.run(G, P, ..., limit=N) enumerates the embeddings one at a time in C++ and stops after N of them; its result also has the candidates, the matching order and per-stage times.

read_graph_from_file returns a networkx.Graph (an orbitsi.arraygraph.ArrayGraph). The file is parsed in C++ straight into arrays, which the filter and the C++ core use directly. The graph's NetworkX node and adjacency dictionaries are built only when first used (for example by the Python backend, G.copy() or G.subgraph()); the graph then becomes a plain networkx.Graph. The node and neighbour order is the order NetworkX would build from the file. By default the reader also builds the indexes the search needs (build_index=True), so their cost is paid at load and not by the first pattern.


Testing

A complete suite of unit and integration tests is provided in the tests/ directory. This includes:

  • Benchmark-based validation for subgraph isomorphism
  • Cross-validation of orbit counting with external tools

To get started, see tests/README.md for detailed setup and usage instructions.


Citation

If you use OrbitSI for subgraph isomorphism search, please cite:

Tauhidi, Syed Ibtisam, Arindam Karmakar, Thai Son Mai, and Hans Vandierendonck. "OrbitSI: An Orbit-based Algorithm for the Subgraph Isomorphism Search Problem." In 2024 IEEE International Conference on Knowledge Graph (ICKG), pp. 360-369. IEEE, 2024. https://doi.org/10.1109/ICKG63256.2024.00052

If you only use the orbit counting modules (ORCAOrbitCounter, EVOKEOrbitCounter), cite:

  • EVOKE: Noujan Pashanasangi and C. Seshadhri. "Efficiently counting vertex orbits of all 5-vertex subgraphs, by EVOKE.", WSDM 2020: Proceedings of the 13th International Conference on Web Search and Data Mining, pp. 447–455. https://doi.org/10.1145/3336191.3371773

  • ORCA: Tomaž Hočevar and Janez Demšar. "A combinatorial approach to graphlet counting." Bioinformatics, 30(4): 559–565, 2014. https://doi.org/10.1093/bioinformatics/btt717


Acknowledgement

This work was supported by:


License

This project is licensed under the Apache License 2.0.

See the LICENSE file for details.

Metadata

Release files for orbitsi 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orbitsi 0.2.0
File Size Uploaded Provenance Actions
orbitsi-0.2.0.tar.gz 115.6 kB With provenance Details for orbitsi-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for orbitsi 0.2.0
File Actions
orbitsi-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for orbitsi-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
orbitsi-0.2.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for orbitsi-0.2.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 4.5 MB

Release files / orbitsi-0.2.0.tar.gz

Download URL orbitsi-0.2.0.tar.gz
Size 115.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9943efbbb1d9e0c074527c6eea7a5896f98f3ee1599a9364de5f1848c07f0c43
BLAKE2b-256 checksum
How to use checksums
8cdc9fc849dad0c694331e67165c9cdeb1ce75eced7cc70a358d60462e7c54e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 556.1 kB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
8dfc9c69b424aa15108c872151e2b325783abd27fda3798954eb6a664130cea2
BLAKE2b-256 checksum
How to use checksums
5ebd457a1ce06cca5bfa753d39b1b100f059c16e2dae6195ca5183c3361c67b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 554.6 kB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
726933c0d906d7b42cd453adc6ce04626eb9e23582ad6a93d9cc6fb6a390ea2d
BLAKE2b-256 checksum
How to use checksums
0f8e0992b69e9782551343af34b1fe85cfd33c73507d3c7ae95d8c3020723d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 554.1 kB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
113e6df02c37875b46f12d24c20c8e7db79abcfeb0d770d0f93bbcc00db5b6e8
BLAKE2b-256 checksum
How to use checksums
ad3b2cb9c46cf4d4828204b7302dd6ee642ae89076bba731ced33b8302bf24aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 553.8 kB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3e0daf4a701c98d45681cacc974031dbafb941308c22dd5febb3cf740a1b39aa
BLAKE2b-256 checksum
How to use checksums
0eaa308ab5ba3d5a69eebc6b2b67e3fde26037f154241f6f4a87a0b0b3206c78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 546.5 kB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
2b6086c3eb2bf02e8204dcd2c8de3cb6d9c8e824447f6fab082de0d2049449e4
BLAKE2b-256 checksum
How to use checksums
6f839cf3b483901dc1c9cf0ae500d41e672808603a61ee59bf616aade87bba42
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 542.7 kB
Tags CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
a451a9ef57969d7c2fb7d54773d873fc08aedb779750cb93f54807180662a53e
BLAKE2b-256 checksum
How to use checksums
f103b06e4412b2121b45af8126d6a39c9e90b1deab7f621b78a263a8cb92fd91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 543.4 kB
Tags CPython 3.9 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
f826196e23017ed9b2f76923aa07c14d502be59e773d1fcc36393951ebe08159
BLAKE2b-256 checksum
How to use checksums
1b1d48b7f6b36068df1cc1314aa1463c5c7b86e774492386a5801541ff5f2a24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Release files / orbitsi-0.2.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL orbitsi-0.2.0-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 537.8 kB
Tags CPython 3.8 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
257fdca3005b08277d1ec42d18408697b05c53c83051fec8efebb77ba75d5ee7
BLAKE2b-256 checksum
How to use checksums
dcb6056b4a35055721dead39941ada6c4055b0bfdbd0fd283e472384d177d67d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

Security for orbitsi 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for orbitsi-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page