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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
afe352f8f89a3ea9938e69382aa94ee54388f8e45ecc4309198fe9fd737a3cc2
|
|
| MD5 |
5bfa018868fc1d9e5d0ea29d451a64e4
|
|
| BLAKE2b-256 |
b6bed758b1543142db997c980f8e632495675be2f27bbf5507162d9b44dd5d36
|
File details
Details for the file paragon_engine-0.1.5-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: paragon_engine-0.1.5-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 118.8 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
860fc2ae5926721263b0660917a7865293d78f37c4ac3c48707848f334e2337e
|
|
| MD5 |
15636e60861cc0c94587e810a039d5b6
|
|
| BLAKE2b-256 |
0ebc24b0734f68106f9718937fe3c66a8d4d006c1d6f42c334ae516af1475d23
|