# Reprezentacja osobnika (kodowanie binarne, liczbowe, permutacje, drzewa)

EN: **Solution representation in evolutionary algorithms** · id `evorepresentation` · aliases: representation, encoding, genotype-phenotype mapping, kodowanie osobnika, genotyp i fenotyp

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [Obliczenia ewolucyjne i inteligencja roju](https://aiatlasgraph.com/t/evolutionary.md) › [Budowa algorytmu ewolucyjnego: reprezentacja, operatory, parametry](https://aiatlasgraph.com/t/evodesign.md) › Reprezentacja osobnika (kodowanie binarne, liczbowe, permutacje, drzewa)

## Description

- PL: Odwzorowanie genotyp–fenotyp: wybór struktury danych dla kandydatów, który określa przestrzeń przeszukiwania i dopuszczalne operatory.
- EN: The genotype–phenotype mapping: choosing a data structure for candidates that defines the search space and admissible operators.

## In one sentence

- PL: Sposób zapisania kandydata na rozwiązanie tak, żeby algorytm mógł go kopiować i zmieniać: jako ciąg bitów, liczb, kolejność albo drzewo.
- EN: The way a candidate solution is written down so the algorithm can copy and change it: as bits, numbers, an ordering or a tree.

## Problem it solves

- PL: Źle zapisany problem sprawia, że drobna zmiana zapisu daje zupełnie inne, często bezsensowne rozwiązanie.
- EN: A badly encoded problem means a tiny change in the code gives a completely different, often meaningless solution.

## What it does

- PL: Jak wybór alfabetu do zapisu przepisu: z dobrym alfabetem drobna literówka daje podobne danie, ze złym niejadalne.
- EN: Like choosing the alphabet for a recipe: with a good one a typo yields a similar dish, with a bad one an inedible mess.

## Everyday example

- PL: Plan lekcji zapisany jako kolejność zajęć zamiast listy godzin: każda zmiana nadal daje poprawny plan bez nakładających się sal.
- EN: A school timetable stored as an order of classes instead of a list of hours: every change still gives a valid plan with no room clashes.

## This concerns you if you…

- PL: twój problem to kolejność, harmonogram albo trasa
- PL: algorytm generuje dużo niepoprawnych rozwiązań
- PL: łączysz liczby całkowite i rzeczywiste w jednym zadaniu
- EN: your problem is an ordering, schedule or route
- EN: the algorithm produces many invalid solutions
- EN: you mix integers and real numbers in one task

## Keywords

binary encoding · Gray code · real-valued encoding · permutation encoding · random-key GA · BRKGA · tree representation · indirect encoding · locality

## How it works

- PL: Typowe kodowania to łańcuchy binarne (np. z kodem Graya), wektory rzeczywiste, permutacje dla problemów kolejności, drzewa lub grafy dla programów oraz klucze losowe dekodowane do permutacji. Dobra reprezentacja zachowuje lokalność: małe zmiany genotypu dają małe zmiany fenotypu i jakości.
- EN: Typical encodings are bit strings (e.g. with Gray code), real vectors, permutations for ordering problems, trees or graphs for programs, and random keys decoded into permutations. A good representation preserves locality: small genotype changes give small phenotype and fitness changes.

## Limits

- PL: Reprezentacja i operatory muszą pasować do siebie; zwykłe krzyżowanie na permutacjach tworzy duplikaty. Pośrednie kodowania z dekoderem bywają redundantne i trudne do analizy, a kodowanie binarne liczb rzeczywistych wprowadza skoki wartości.
- EN: Representation and operators must match; plain crossover on permutations creates duplicates. Indirect encodings with decoders can be redundant and hard to analyse, and binary encoding of reals introduces value jumps.

## Key terms

- PL: **genotyp**: Zapis rozwiązania, na którym działają operatory.
- PL: **fenotyp**: Rzeczywiste rozwiązanie odczytane z genotypu i oceniane.
- PL: **random keys**: Liczby rzeczywiste, których posortowanie daje kolejność elementów.
- EN: **genotype**: The encoding of a solution that operators act on.
- EN: **phenotype**: The actual solution decoded from the genotype and evaluated.
- EN: **random keys**: Real numbers whose sorting yields an ordering of items.

## Sources

- [Introduction to Evolutionary Computing (2nd ed.)](<https://biblioteca.izt.uam.mx/vufind/Record/978-3-662-44874-8/TOC>) `eiben-smith-2015` · by A. E. Eiben, J. E. Smith
- [pymoo: Multi-objective Optimization in Python](<https://arxiv.org/abs/2002.04504>) `pymoo-2020` · by Julian Blank, Kalyanmoy Deb

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/evorepresentation · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
