Skip to content

mplementation of a Genetic Algorithm (GA) in C++ for multidimensional data clustering optimization. Features custom GA logic, polymorphic genetic operators (Crossover, Mutation), and demonstrates live refactoring by migrating from Single-Point to Modular Uniform Crossover.

Notifications You must be signed in to change notification settings

annakepowicz/GeneticAlgorithm

Repository files navigation

🧬 Genetic Algorithm for Data Clustering Optimization (C++)

🌟 Overview

This project implements a Genetic Algorithm (GA) in C++ to solve a multidimensional data clustering optimization problem.
It was developed during university laboratory sessions, where the task included extending a provided baseline library with custom GA logic and performing live refactoring of the core algorithm.


🛠️ My Implementation & Key Components

🔹 GeneticAlgorithm Class

  • Generates the initial population
  • Implements selection and crossover mechanisms
  • Evaluates fitness values
  • Runs the main evolutionary loop

🔹 Individual Class

  • Stores the genotype representation
  • Implements genetic operators:
    • Crossover
    • Mutation

⚡ Live Modification: Crossover Operator Refactoring

A core requirement of the lab was a live refactoring of the crossover operator:

  • Original implementation: Single-Point Crossover
  • Refactored into: Modular Uniform Crossover
  • Current state:
    • The refactored Uniform Crossover is the active implementation
    • The original Single-Point Crossover remains in the code as commented-out reference

This approach demonstrates refactoring skills and preserves the previous logic for comparison and further development.


📥 Provided Components (Base Library)

The following files were supplied as the foundation of the project, defining:

  • the problem space,
  • the evaluation metric,
  • data point representation.

Included base library files:

  • GroupingEvaluator.cpp / .h
  • GaussianGroupingEvaluatorFactory.cpp / .h
  • Point.cpp / .h

About

mplementation of a Genetic Algorithm (GA) in C++ for multidimensional data clustering optimization. Features custom GA logic, polymorphic genetic operators (Crossover, Mutation), and demonstrates live refactoring by migrating from Single-Point to Modular Uniform Crossover.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages