Skip to main content

PARAGON: Parallel Graph Processing Engine

License PyPI GitHub issues

Documentation | Resources | Contributors | Release Notes

PARAGON is a high performance parallel graph processing engine written in modern C++ with Python bindings via pybind11. It provides scalable implementations of core graph algorithms like:

  • Parallel BFS / DFS
  • Connected Components
  • PageRank (Pull + Push)
  • Single Source Shortest Path (SSSP)
  • Triangle Counting

Designed for:

  • Multicore CPUs
  • Large-scale graphs
  • Systems + algorithm engineering

Installation

Windows users:

You MUST use MSVC (Visual Studio Build Tools)

MinGW WILL FAIL Python 3.13 + MinGW is incompatible

Python version

  • Python 3.8 – 3.11 (RECOMMENDED)

Avoid Python 3.13 for now (ABI issues with pybind11 + MinGW)

1. Install Visual Studio Build Tools

Download: Visual Studio Build Tools

Select:

  • C++ build tools
  • MSVC compiler
  • Windows SDK

2. Install package

pip install paragon-engine

Linux / Mac

Install dependencies

sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build

Then:

pip install paragon-engine

Quick Start

Example: Parallel BFS + DFS

from paragon import Graph
from paragon.algorithms import parallel_bfs, parallel_dfs

NUM_THREADS = 4

g = Graph(5)
g.add_edges([
    (0, 1),
    (1, 2),
    (2, 3),
    (3, 4)
])

distance = parallel_bfs(graph=g, source=0, threads=NUM_THREADS)
print(distance)

visited = parallel_dfs(graph=g, source=0, threads=NUM_THREADS)
print(visited)

API Overview

Graph

from paragon import Graph

g = Graph(5)
g.add_edge(0, 1)  # Adding an edge between vertices 0 and 1
g.add_edges([(1, 2), (2, 3)])  # Adding multiple edges at once

print("Vertices in the graph:", g.vertices())
print("Edges in the graph:", g.has_edge(0, 1))
print("Degree of vertex 1:", g.degree(1))
print("Adjacency List:", g.get_adj())

WeightedGraph

from paragon import WeightedGraph

g = WeightedGraph(5)
g.add_edge(0, 1, 2.5)  # Adding a weighted edge between vertices 0 and 1
g.add_edges([(1, 2, 3.0), (2, 3, 4.0)])  # Adding multiple weighted edges at once

print("Vertices in the graph:", g.vertices())
print("Edges in the graph:", g.has_edge(0, 1))
print("Degree of vertex 1:", g.degree(1))
print("Adjacency List:", g.get_adj())

Example: Shortest Path Parallel Dijkstra's Algorithm

from paragon import WeightedGraph
from paragon.algorithms import parallel_dijkstra

g = WeightedGraph(6)

g.add_edges([
    (0, 1, 4.0),
    (0, 2, 2.0),
    (1, 3, 5.0),
    (2, 1, 1.0),
    (2, 3, 8.0),
    (3, 4, 3.0),
    (4, 5, 1.0)
])

dist = parallel_dijkstra(g, 0)

for i, d in enumerate(dist):
    print(f"Distance from 0 → {i}: {d}")

Parallel Engine Features

  • Thread pool via std::thread
  • Work partitioning (chunking)
  • Atomic operations for safety
  • Barrier synchronization
  • Lock-based + lock-free hybrid design

Performance

PARAGON Benchmark

Algorithm Configuration (V, E) Time (Sequential) Time (Parallel) Speedup Key Observations
SSSP (Parallel Relaxation) (3000, 10,000) 398 ms 5 ms ~80× Sequential behaves like Bellman–Ford (O(V·E)); parallel version uses early stopping + edge relaxation → massive gains.
PageRank (20, 20,000,000) 3026 ms 1180 ms ~2.5× Highly parallelizable (no dependencies, uniform work). Limited by memory bandwidth & synchronization barriers.
Connected Components (CC) (20, 20,000,000) 1451 ms 876 ms ~1.65× Parallelism helps only for dense graphs. Sequential DFS is cache-efficient for small graphs.
Triangle Counting (20, 200,000) ~12,500 ms ~3,600 ms ~3.4× Perfect for parallelism: independent work, no sync, heavy computation. CPU cores fully utilized.

Development

Run examples (C++)

cmake -B build -G Ninja -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DBUILD_BENCHMARKS=ON

Then

cmake --build build

Build locally

pip install -e .

Build wheel

python -m build

Contributing

PRs welcome! For more details, see CONTRIBUTING.md Suggested areas:

  • New algorithms (e.g., SCC, MST)
  • Performance optimizations
  • Python API improvements
  • Documentation

Author

Jha Saket Sunil

Metadata

Release files for paragon-engine 0.1.11

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

Source distribution (sdist)

Source distribution for paragon-engine 0.1.11
File Size Uploaded Provenance Actions
paragon_engine-0.1.11.tar.gz 64.9 kB Without provenance Details for paragon_engine-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for paragon-engine 0.1.11
File Interpreter ABI Platform Actions
paragon_engine-0.1.11-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for paragon_engine-0.1.11-cp311-cp311-win_amd64.whl

Total release size: 209.2 kB

Release files / paragon_engine-0.1.11.tar.gz

Download URL paragon_engine-0.1.11.tar.gz
Size 64.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ad1833c33b158795374637f5bafae9c16413c28e8447884fe8c6d51eb190f281
BLAKE2b-256 checksum
How to use checksums
abddd011e8707b746d1f869f5f09a2999a64556f68627e139b547e7405f58d41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Release files / paragon_engine-0.1.11-cp311-cp311-win_amd64.whl

Download URL paragon_engine-0.1.11-cp311-cp311-win_amd64.whl
Size 144.3 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
80eadfc2b05b933588a7c0ee07eda772920efe983d0207a307f0aa17f6fe543e
BLAKE2b-256 checksum
How to use checksums
ee1691e17e8c872b11e6ca626c4531942dc01543290663e7706a8889a245d55e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.1

Security for paragon-engine 0.1.11

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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