Metadata-Version: 2.4
Name: graphion
Version: 0.0.2
Summary: A research framework for graph-based partitioning algorithms.
Author-email: Mohsen Sahrayi <m.sahrayi.a@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Mohsen Sahrayi
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/sahrayi/graphion
Project-URL: Repository, https://github.com/sahrayi/graphion
Project-URL: Issues, https://github.com/sahrayi/graphion/issues
Keywords: graph,graph-partitioning,graph-clustering,community-detection,network-analysis,research,machine-learning
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Typing :: Typed
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Requires-Dist: networkx>=3.0
Requires-Dist: pandas>=2.0
Requires-Dist: python-igraph>=0.11
Requires-Dist: leidenalg<1,>=0.10
Requires-Dist: scikit-learn>=1.3
Requires-Dist: torch>=2.0
Requires-Dist: infomap>=2.7
Requires-Dist: umap-learn>=0.5
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Dynamic: license-file

# Graphion

**Graphion** is a modular and extensible Python framework for building graph-based data processing pipelines.

Instead of providing a single clustering or graph algorithm, Graphion offers reusable building blocks for constructing complete graph analytics workflows, from feature relations to graph construction, partition detection, refinement, reduction, and evaluation.

The framework is designed around interchangeable pipeline stages, allowing researchers and developers to combine different algorithms with a consistent interface.

> **Project status:** Early development (pre-release)

---

# Features

Graphion currently provides the following components:

### Relation Builders

Build pairwise relations between feature vectors using multiple similarity and distance metrics.

Implemented metrics include:

- Cosine Similarity
- Dot Product
- Pearson Correlation
- Angular Similarity
- Euclidean Distance
- Manhattan Distance
- Chebyshev Distance
- Minkowski Distance
- Canberra Distance
- Bray-Curtis Distance
- Hamming Distance
- Jaccard Similarity
- Weighted Jaccard
- Dice Similarity
- Overlap Coefficient
- Tanimoto Similarity
- RBF Similarity

---

### Graph Builders

Construct graphs from pairwise relations using multiple strategies.

Implemented builders include:

- Threshold Graph
- Radius Graph
- k-Nearest Neighbors (kNN)
- Mutual kNN
- Symmetric kNN
- Weighted kNN
- Adaptive kNN
- kNN + Threshold
- Shared Nearest Neighbor (SNN)
- Relative Neighborhood Graph (RNG)
- Minimum Spanning Tree (MST)

---

### Graph Refiners

Graph transformation stages.

Currently available:

- Identity Refiner

---

### Partition Detectors

Detect graph communities using interchangeable algorithms.

Implemented algorithms include:

- Connected Components
- Leiden
- Louvain
- Label Propagation
- Walktrap
- Fast Greedy
- Girvan-Newman
- Spectral Clustering
- Agglomerative Clustering
- Infomap
- Identity

---

### Partition Refiners

Post-process detected communities.

Currently available:

- Identity Refiner

---

### Reducers

Dimensionality reduction modules.

Implemented reducers:

- PCA
- Truncated SVD
- Random Projection
- UMAP
- t-SNE
- Isomap
- Autoencoder
- Identity

---

### Evaluation

Built-in evaluation utilities for:

- Feature sets
- Graphs
- Partition sets
- Feature partitions

---

# Design Principles

Graphion is designed around several core principles:

- Modular architecture
- Consistent interfaces
- Pluggable algorithms
- Strong typing
- Clear separation of responsibilities
- Pipeline-oriented execution
- Easy extensibility

Every processing stage follows a common execution interface, making it straightforward to replace one algorithm with another.

---

# Project Structure

```
Graphion/
│
├── builders/
│   ├── relation/
│   └── graph/
│
├── reducers/
│
├── refiners/
│   ├── graph/
│   └── partition/
│
├── detectors/
│   └── partition/
│
├── evaluation/
│
└── core/
    ├── interfaces/
    ├── models/
    ├── results/
    ├── errors/
    └── types.py
```

---

# Installation

Graphion is currently under active development.

Clone the repository:

```bash
git clone https://github.com/sahrayi/Graphion.git
```

Install in editable mode:

```bash
pip install -e .
```

---

# Roadmap

Planned features include:

- Additional graph construction algorithms
- More community detection methods
- Hierarchical partition refinement
- Graph embedding modules
- Visualization utilities
- Benchmark suite
- Documentation website
- Comprehensive test coverage

---

# Related Projects

Graphion serves as the foundation for higher-level graph analytics libraries.

For example:

- GraphTopic (graph-based topic discovery)

---

# License

MIT License
