simple_ga
A Simple Genetic Algorithm


simple_ga, a C++ code which implements a simple genetic algorithm, by Dennis Cormier and Sita Raghavan.

Here, we consider the task of constrained optimization of a scalar function. That is, we have a function F(X), where X is an M-vector satisfying simple constraints for each component I:

        X_MIN[I] <= X[I] <= X_MAX[I]
      
and, subject to those constraints, we seek a vector X which maximizes the value F(X).

In the example given here, the spatial dimension M is 3, the function F(X) is X[1]^2 - X[1]*X[2] + X[3], and the constraints are

        0 <= X[1] <= 5
        0 <= X[2] <= 5
       -2 <= X[3] <= 2
      
The correct solution is [5,0,2].

Licensing:

The computer code and data files made available on this web page are distributed under the MIT license

Languages:

simple_ga is available in a C++ version.

Related Programs and Data:

simple_ga_test

Author:

Original version by Dennis Cormier, Sita Raghavan. This C++ version by John Burkardt.

Reference:

  1. Zbigniew Michalewicz,
    Genetic Algorithms + Data Structures = Evolution Programs,
    Third Edition,
    Springer, 1996,
    ISBN: 3-540-60676-9,
    LC: QA76.618.M53.

Source Code:


Last revised on 12 April 2020.