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)
โก Algorithms
๐น Parallel BFS
from paragon.algorithms import parallel_bfs
dist = parallel_bfs(g, source=0)
๐น Parallel DFS
from paragon.algorithms import parallel_dfs
visited = parallel_dfs(g, 0)
๐น Connected Components
from paragon.algorithms import connected_components
labels = connected_components(g)
๐น PageRank
from paragon.algorithms import pagerank
ranks = pagerank(g)
๐น PageRank (Push / BFS-style)
from paragon.algorithms import pagerank_bfs
ranks = pagerank_bfs(g)
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}")
๐ง Whatโs happening here?
- Uses parallel relaxation
- Similar to Bellman-Ford
- Stops early if no updates
- Handles large graphs efficiently
๐งต 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
cmake --build build
./build/example_bfs
Known Issues
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
โญ Final Note
PARAGON is not just a library โ itโs a systems + algorithms project combining:
- Parallel computing
- Graph theory
- High-performance engineering
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.1.tar.gz.
File metadata
- Download URL: paragon_engine-0.1.1.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdd2c2727b459450835610a1246bf83addf58cf0597c4d94d28a6dce6965b281
|
|
| MD5 |
690ca03f2a1322c2cb1fc10b70c48f5f
|
|
| BLAKE2b-256 |
6a21a72629c1ad41663dbd7c15fdab56496db2cb62b69a694f807901991c5e6e
|
File details
Details for the file paragon_engine-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: paragon_engine-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 119.1 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 |
679c6928c0a522035c667f2978aa748ae146c74ae518495a71bcde5bac1a36b7
|
|
| MD5 |
3458704be74303c4b7a978d755e8030d
|
|
| BLAKE2b-256 |
93f65fd103f919a0c8537eb0dcbf049445c9c2c4f0d1cbc60d7a3e4c7cfcad16
|