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. 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
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
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 (SSSP)
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 achieves:
- Significant speedup on multicore CPUs
- Efficient memory access patterns
- Cache-aware adjacency traversal
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
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.9.tar.gz.
File metadata
- Download URL: paragon_engine-0.1.9.tar.gz
- Upload date:
- Size: 44.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 |
837ebd980fd6dc10d6bfbd09aa1b2ba263ad7ac7d22d56e448648131e761f1f5
|
|
| MD5 |
9166a2e3c730020f44f97854d38b7cfa
|
|
| BLAKE2b-256 |
acd433f4df96e9311e107bf97f0d803f2ab78ee6feeb610d764a89f4c5f2dc9e
|
File details
Details for the file paragon_engine-0.1.9-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: paragon_engine-0.1.9-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 139.5 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 |
5c23e3b405e2bc0c8da3b8c88231aba95eb6bd647bfa40ded56d565ed9f5e3f0
|
|
| MD5 |
23079dfc600b92323aa69d9c93eff1b1
|
|
| BLAKE2b-256 |
d976437a04eadde77360015ce94b0cc5717a8fc756543ec1519c5b4564c5f2e5
|