ParGA

Rust MIT
0 Stars
0 Forks
0 Issues

Languages

Rust 53.1% Python 35.4% MATLAB 8.9% Makefile 2.6%

Top Contributors

Project Info

Created
March 9, 2013
Last Updated
February 8, 2026
License
MIT
Default Branch
master

About This Project

ParGA is a parallel genetic algorithm library written in Rust with Python bindings via PyO3. It delivers 5-50x speedups over pure Python GA libraries by auto-selecting the best execution strategy based on your fitness function’s cost.

Features

  • Unified API: Single GA class that auto-selects the best execution strategy
  • Auto-Parallelization: Automatically parallelizes expensive fitness functions
  • Island Model: Multiple migration topologies (ring, star, ladder, fully connected, random)
  • Diverse Operators: Tournament, roulette, and rank selection; single-point, two-point, uniform, and blend crossover; Gaussian, uniform, and polynomial mutation
  • Rust Backend: Fast execution for lightweight fitness functions
  • Process Pools: Parallel pools for expensive fitness evaluations

Installation

# Python
pip install parga

# Rust
# Add to Cargo.toml:
# parga = "0.1"

Quick Start

from parga import GA

def fitness(x):
    return sum(xi ** 2 for xi in x)

ga = GA(fitness_fn=fitness, dimensions=10)
result = ga.run()

The library measures your fitness function’s cost during initialization and picks the most efficient strategy automatically: Rust backend for fast functions, parallel process pools for expensive ones.

Related Posts