https://github.com/vanstrouble/cga-from-scratch
CGA algorithm from scratch using Python.
https://github.com/vanstrouble/cga-from-scratch
cga compact-genetic-algorithm from-scratch python
Last synced: about 2 months ago
JSON representation
CGA algorithm from scratch using Python.
- Host: GitHub
- URL: https://github.com/vanstrouble/cga-from-scratch
- Owner: vanstrouble
- Created: 2023-03-20T01:23:59.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-25T03:04:32.000Z (11 months ago)
- Last Synced: 2025-02-02T14:14:01.666Z (4 months ago)
- Topics: cga, compact-genetic-algorithm, from-scratch, python
- Language: Python
- Homepage:
- Size: 984 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Compact Genetic Algorithm (CGA)
The Compact Genetic Algorithm (CGA) is a variant of the genetic algorithm used for optimization and solution search in complex problems. Unlike conventional genetic algorithms, the CGA uses a compact representation of chromosomes, which means it employs a reduced number of genes compared to other approaches.
In the CGA, instead of representing every possible value in a chromosome, probability tables are used for each gene. These tables contain probability values that indicate the likelihood of a gene taking a particular value. By using these probabilities instead of binary or integer representations, the CGA can significantly reduce the size of chromosomes and the search space.
## Algorithm Steps
The basic operation of the CGA involves the following steps:
1. **Initialization**: An initial population of chromosomes with random probability tables is created.
2. **Evaluation**: The fitness of each chromosome is evaluated based on the quality of the solution it represents.
3. **Selection**: The fittest chromosomes are selected for reproduction and to form the next generation.
4. **Update of Probability Tables**: The probability tables of the genes are updated based on the performance of the selected chromosomes.
5. **Convergence**: The evaluation, selection, and probability table update steps are repeated until a convergence criterion is met, such as a maximum number of generations or a desired solution quality.The CGA offers advantages in terms of memory usage and runtime efficiency, as the reduced chromosome size and compact representation enable more efficient exploration of the search space.
## Advantages
- **Memory Efficiency**: Reduced chromosome size leads to lower memory usage.
- **Runtime Efficiency**: Compact representation allows faster processing.
- **Effective Search Space Exploration**: Probability tables provide a flexible mechanism for navigating the search space.## CGA Board Example
## References
- Goldberg, D. E., & Harik, G. (1998). "The Compact Genetic Algorithm." Proceedings of the IEEE International Conference on Evolutionary Computation.
- Pelikan, M., Goldberg, D. E., & Lobo, F. G. (1999). "A Survey of Optimization by Building and Using Probabilistic Models."