Skip to main content

High-performance parallel graph processing engine (C++ + Python)

Project description

๐Ÿš€ PARAGON: Parallel Graph Processing Engine

PARAGON is a high-performance parallel graph processing engine written in modern C++ with Python bindings via pybind11. P 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

Architecture

C++ Core Engine (src/)
        โ†“
Parallel Algorithms (threaded)
        โ†“
pybind11 Bindings (bindings/)
        โ†“
Python API (python/paragon/)

Project Structure

paragon/
โ”œโ”€โ”€ include/              # Header files (Graph, algorithms, engine)
โ”œโ”€โ”€ src/                  # C++ implementations
โ”œโ”€โ”€ bindings/             # pybind11 bindings
โ”œโ”€โ”€ python/paragon/       # Python API layer
โ”‚   โ”œโ”€โ”€ core.py
โ”‚   โ”œโ”€โ”€ algorithms/
โ”‚   โ”‚   โ”œโ”€โ”€ bfs.py
โ”‚   โ”‚   โ”œโ”€โ”€ dfs.py
โ”‚   โ”‚   โ”œโ”€โ”€ pagerank.py
โ”‚   โ”‚   โ”œโ”€โ”€ sssp.py
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ examples/             # C++ examples
โ”œโ”€โ”€ benchmark/            # Performance benchmarks
โ”œโ”€โ”€ tests/                # Unit tests
โ”œโ”€โ”€ CMakeLists.txt
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

โš™๏ธ Installation

๐Ÿ”ด IMPORTANT

Windows users:

You MUST use MSVC (Visual Studio Build Tools)

โŒ MinGW WILL FAIL โŒ Python 3.13 + MinGW is incompatible

Recommended Setup

Python version

Python 3.8 โ€“ 3.11 (RECOMMENDED)

โš ๏ธ Avoid Python 3.13 for now (ABI issues with pybind11 + MinGW)

Windows Setup

1. Install Visual Studio Build Tools

Download: ๐Ÿ‘‰ https://visualstudio.microsoft.com/visual-cpp-build-tools/

Select:

  • โœ” C++ build tools
  • โœ” MSVC compiler
  • โœ” Windows SDK

2. Install package

pip install paragon-engine

Linux / Mac

Install dependencies

sudo apt install build-essential cmake python3-dev
pip install pybind11 scikit-build-core

Then:

pip install paragon-engine

Quick Start

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

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

print(parallel_bfs(g, 0))
print(parallel_dfs(g, 0))

API Overview

Graph

from paragon import Graph

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

WeightedGraph

from paragon import WeightedGraph

g = WeightedGraph(5)
g.add_edge(0, 1, 2.5)

Example โ€” Shortest Path (SSSP)

from paragon import WeightedGraph
from paragon.algorithms import sssp

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 = sssp(g, source=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 achieves:

  • Significant speedup on multicore CPUs
  • Efficient memory access patterns
  • Cache-aware adjacency traversal

Development

Build locally

pip install -e .

Build wheel

python -m build

Run examples (C++)

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

Then

cmake --build build

MinGW + Python 3.13

You may see errors like:

undefined reference to Py_DecRefShared

Fix:

  • Use MSVC
  • OR use Python โ‰ค 3.11

Future Improvements

  • Prebuilt wheels (no compilation needed)
  • GPU support (CUDA / OpenMP)
  • Distributed graph processing
  • Graph streaming support

Contributing

PRs welcome!

Suggested areas:

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

License

MIT License

Author

Saket Jha

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

paragon_engine-0.1.5.tar.gz (34.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

paragon_engine-0.1.5-cp311-cp311-win_amd64.whl (118.8 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file paragon_engine-0.1.5.tar.gz.

File metadata

  • Download URL: paragon_engine-0.1.5.tar.gz
  • Upload date:
  • Size: 34.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.1

File hashes

Hashes for paragon_engine-0.1.5.tar.gz
Algorithm Hash digest
SHA256 afe352f8f89a3ea9938e69382aa94ee54388f8e45ecc4309198fe9fd737a3cc2
MD5 5bfa018868fc1d9e5d0ea29d451a64e4
BLAKE2b-256 b6bed758b1543142db997c980f8e632495675be2f27bbf5507162d9b44dd5d36

See more details on using hashes here.

File details

Details for the file paragon_engine-0.1.5-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for paragon_engine-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 860fc2ae5926721263b0660917a7865293d78f37c4ac3c48707848f334e2337e
MD5 15636e60861cc0c94587e810a039d5b6
BLAKE2b-256 0ebc24b0734f68106f9718937fe3c66a8d4d006c1d6f42c334ae516af1475d23

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page