# Obsługa ograniczeń w algorytmach ewolucyjnych (kary, naprawa)

EN: **Constraint handling in evolutionary algorithms** · id `constrainthandling` · aliases: constraint handling, constraint-handling techniques, obsługa ograniczeń, ograniczenia w optymalizacji ewolucyjnej

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) › Obsługa ograniczeń w algorytmach ewolucyjnych (kary, naprawa)

## Description

- PL: Techniki prowadzenia przeszukiwania ewolucyjnego w przestrzeni z ograniczeniami: kary, naprawa, reguły wykonalności, specjalne operatory i ujęcie wielokryterialne.
- EN: Techniques for steering evolutionary search in constrained spaces: penalties, repair, feasibility rules, special operators and multi-objective formulations.

## In one sentence

- PL: Sposoby radzenia sobie z twardymi regułami, których rozwiązanie nie może łamać, gdy algorytm ewolucyjny losowo tworzy nowe warianty.
- EN: Ways of dealing with hard rules a solution must not break while an evolutionary algorithm randomly creates new variants.

## Problem it solves

- PL: Losowe zmiany często dają rozwiązania niemożliwe do wykonania: przekroczony budżet, za ciężka konstrukcja, kolizja terminów.
- EN: Random changes often produce solutions that cannot be carried out: an exceeded budget, a structure too heavy, clashing dates.

## What it does

- PL: Jak sędzia w grze: złamanie przepisów kosztuje punkty karne albo zawodnik musi cofnąć ruch i poprawić go zgodnie z regułami.
- EN: Like a referee: breaking the rules costs penalty points, or the player must take the move back and fix it to fit the rules.

## Everyday example

- PL: Planowanie załadunku ciężarówki: wersje przekraczające dopuszczalną masę dostają karę, aż algorytm nauczy się mieścić w limicie.
- EN: Planning a truck load: versions over the weight limit get a penalty until the algorithm learns to stay within it.

## This concerns you if you…

- PL: twój problem ma twarde limity lub reguły
- PL: algorytm zwraca rozwiązania, których nie da się użyć
- PL: nie wiesz, jak dobrać wagę kary
- EN: your problem has hard limits or rules
- EN: the algorithm returns solutions you cannot use
- EN: you do not know how to set a penalty weight

## Keywords

penalty function · death penalty · adaptive penalty · repair operator · Deb feasibility rules · stochastic ranking · epsilon constrained method · GENOCOP · constraint violation

## How it works

- PL: Funkcje kary dodają do celu miarę naruszenia ograniczeń, ze stałą, dynamiczną lub adaptacyjną wagą. Operatory naprawy przekształcają rozwiązania niewykonalne w wykonalne. Reguły wykonalności Deba w porównaniu zawsze wolą rozwiązanie wykonalne, a między niewykonalnymi mniejsze naruszenie; ranking stochastyczny miesza oba kryteria losowo.
- EN: Penalty functions add a constraint-violation measure to the objective with a static, dynamic or adaptive weight. Repair operators turn infeasible solutions into feasible ones. Deb's feasibility rules always prefer a feasible solution and, among infeasible ones, the smaller violation; stochastic ranking mixes both criteria randomly.

## Limits

- PL: Wagi kar trudno dobrać: za małe dają rozwiązania niewykonalne, za duże odcinają drogę przez niewykonalne obszary. Naprawa wymaga wiedzy o problemie, a wąskie obszary wykonalne lub ograniczenia równościowe pozostają trudne.
- EN: Penalty weights are hard to set: too small yields infeasible solutions, too large blocks paths through infeasible regions. Repair needs problem knowledge, and narrow feasible regions or equality constraints remain hard.

## Key terms

- PL: **funkcja kary**: Dodatek do celu karący za łamanie ograniczeń.
- PL: **obszar wykonalny**: Zbiór rozwiązań spełniających wszystkie ograniczenia.
- PL: **ranking stochastyczny**: Sortowanie, które losowo porównuje według celu albo naruszenia.
- EN: **penalty function**: An addition to the objective that punishes constraint violations.
- EN: **feasible region**: The set of solutions satisfying all constraints.
- EN: **stochastic ranking**: Sorting that randomly compares by objective or by violation.

## Know first

- [Problemy z ograniczeniami (CSP) (Constraint satisfaction problems (CSP))](https://aiatlasgraph.com/t/csp.md)
- [Spadek gradientu i optymalizacja ciągła (Gradient descent and continuous optimisation)](https://aiatlasgraph.com/t/mathoptimization.md)

## 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
- [Theoretical and Numerical Constraint-Handling Techniques used with Evolutionary Algorithms: A Survey of the State of the Art](<https://homes.di.unimi.it/cordone/courses/2024-ae/Lez23-Materiali/constraint-handling.pdf>) `coello-constraint-2002` · by Carlos A. Coello Coello

---

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