Genetic Algorithm Example

This is a simple implementation of a Genetic Algorithm in C++. The algorithm optimizes a binary vector using basic genetic operators such as crossover and mutation.

Usage

Make sure you have a C++ compiler installed.

  1. Clone the repository:
  2. git clone https://github.com/bigoispj/C-Plus-Plus
  3. Compile the C++ code:
  4. g++ gen-alg.cpp -o gen-alg
  5. Run the executable:
  6. ./gen-alg

Parameters

You can adjust the following parameters in the C++ code to customize the algorithm:

  • tamanhoPopulacao: Population size (default: 100)
  • tamanhoCromossomo: Chromosome size (default: 20)
  • taxaMutacao: Mutation rate (default: 0.01)

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

This code is a basic example and may be further developed for more complex applications. Feel free to contribute or use it as a starting point for your projects.