Metadata-Version: 2.4
Name: graphevol
Version: 0.0.2
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: maturin[patchelf]>=1.10.2
License-File: LICENSE
Summary: Evolutionary graph-based optimization library with Python bindings
License-Expression: Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# A scalable topology-evolution engine powered by a high-performance Rust backend.

<!-- [![Continuous integration](https://github.com/otyanokosaisai/graphevol/actions/workflows/build-release.yaml/badge.svg)](https://github.com/otyanokosaisai/graphevol/actions/workflows/build-release.yaml) -->
[![PyPI version](https://img.shields.io/pypi/v/graphevol)](https://pypi.org/project/graphevol/)
[![Python Versions](https://img.shields.io/pypi/pyversions/graphevol.svg)](https://pypi.org/project/graphevol/)
![License](https://img.shields.io/pypi/l/graphevol)
![PyPI - Wheel](https://img.shields.io/pypi/wheel/graphevol)
![Downloads](https://img.shields.io/pypi/dm/graphevol)

[**Features**](#features)

## What is graphevol?
<!-- `graphevol` provides fast graph-based neuroevolution in Python, with structural mutations, pruning, configurable operations, and a JAX/PyTorch/NumPy-friendly workflow. -->
graphevol is a Python library for graph-based neuroevolution with **Hierarchical Genetic Algorithm** and **memory-efficient evolutions**, designed for fast and scalable evolutinary search.

The main class **PyGenus** plays roles in reproduction and selection in Generative Algorithm. **PyGenus** manages network structures and weights, and it runs repruduction, returning *functions' strs* and *weights*. It can adapt the strs major Python numerical libraries: [Numpy](https://github.com/numpy/numpy.git), [JAX](https://github.com/jax-ml/jax.git) and [PyTorch](https://github.com/pytorch/pytorch.git). In selection, **PyGenus** recieves scores and updated weights of each set, and apply selective pressure stochastically based on each performance. 

This project is currently ongoing, therefore the design can be dramatically changed by a major update. 

---

## Installation

```bash
pip install graphevol
```

Install Graphviz for visualization:

**Linux**
```bash
sudo apt install graphviz
```
**macOS**
```bash
brew install graphviz
```

---

## Quick Start

```python
import graphevol as ge

# Generate default YAML configs (please modify them to change GA behavior and operators)
ge.generate_default_settings("ga.yaml", "ops.yaml")

genus = ge.PyGenus(
    seed=0,
    ouput_dir="outputs",
    # environmental settings
    input_dim=4,
    output_dim=2,
    # network settings
    use_bias=True, # Use bias node
    sustain_cache=True, # Whether PyGenus uses a cache to track functions already used across generations.
    # configs
    ga_config_path="ga.yaml",
    ops_path="ops.yaml",
)

genomes: list[list[str, list[float]]] = genus.next_generation() # function's expression (str) and weights (list[float])
scores: list[list[float, list[float]]] = rollout_fn(genomes) # each score (float) and updated weights(list[float])
genus.selection(scores)
```

<!-- ---

## Configuration

`graphevol` uses two YAML files:

### ga_config.yaml

### ops.yaml -->

<!-- ---

## Documentation

Full documentation & examples:  
https://github.com/otyanokosaisai/graphevol -->


<!-- ---

## Contributions

Issues & PRs are welcome. -->


