genetic-algorithm

Solve discrete and combinatorial optimization problems using a genetic algorithm in Python.

Updated Jan 26, 2026
One-click install
npx skills add https://github.com/SPIRAL-EDWIN/MCM-ICM-2601000 --skill genetic-algorithm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: genetic-algorithm
Source: https://github.com/SPIRAL-EDWIN/MCM-ICM-2601000/tree/main/.github/skills/genetic-algorithm
Command: npx skills add https://github.com/SPIRAL-EDWIN/MCM-ICM-2601000 --skill genetic-algorithm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a ready-to-use genetic algorithm framework for solving discrete and combinatorial optimization problems in Python, helping teams explore large search spaces without writing GA infrastructure from scratch.

Core Features & Use Cases

  • Modular GA components: population handling, fitness evaluation, selection (tournament), crossover, mutation, and elitism.
  • Simple extension to multi-objective optimization (e.g., NSGA-II style).
  • Real-world scenario: optimize scheduling, routing, or feature selection by encoding solutions as chromosomes.

Quick Start

Run the GeneticAlgorithm example to minimize a sample objective (e.g., the Rastrigin function) using the included Python code.

Frequently Asked Questions about genetic-algorithm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I solve combinatorial optimization problems like scheduling and routing in Python?

To solve combinatorial optimization problems, encode solutions as chromosomes and apply modular genetic algorithm components including population handling, fitness evaluation, selection, crossover, mutation, and elitism using Python.

What is a genetic algorithm used for in multi-objective optimization?

In multi-objective optimization, a genetic algorithm explores large, non-differentiable, multi-modal search spaces by evolving solutions through fitness evaluation and tournament selection, extending easily to NSGA-II style approaches.

Do I need numpy and matplotlib to run genetic algorithm optimization examples?

Yes, you need Python with numpy and matplotlib installed to run the included usage examples that minimize sample objectives like the Rastrigin function and visualize the genetic algorithm optimization process.

Can I use this genetic algorithm framework for feature selection tasks?

Yes, you can use this genetic algorithm framework for feature selection by encoding feature subsets as chromosomes and applying the built-in fitness evaluation, crossover, and mutation operations to find optimal combinations.

When should I choose a genetic algorithm over other optimization methods?

You should choose a genetic algorithm over other optimization methods when your problem involves a large, non-differentiable, or multi-modal search space where traditional gradient-based methods fail to find optimal discrete solutions.