Source Code of Non-Revisiting Genetic Algorithm (NrGA) in

Yuen, S.Y., Chow, C.K., A Genetic Algorithm that Adaptively Mutates and Never Revisits, IEEE Transactions on Evolutionary Computation, Vol 13(2) (April 2009) 454-472.

Source code                       NrGA.zip

Compile environment    :  Microsoft Visual C++ 6.0

Operation System           :  Microsoft Windows XP

 

Main flow of the program:

 

 

 


Details of files:

Cluster_Tree_Kernel.C

GeneticAlgorithm_Kernel.C

NonRevisitingScheme.C

NonRevisitingGA_Kernel.C

 

How to set?

Example:

Test function                     : GeneralizedGriewank

Optimization mode        : Minimization

Max Generation               : 400

Population size                                : 100

No. of trial                          : 100

Dimension                          :  30

Resolution                          : 100

Termination mode          :  Fixed Generation (No. of evaluations = max generation *  population size)

In function “NonRevisitingGA_Performance_Single()” defined in “NonRevisitingGA_Main.c”

Resolution

 

Dimension

 

Population size

 

No. of independent trials

 

The number of maximum Generation

 

Optimization mode = “0” for minimization, “1” for maximization

 

 

The index of test functions can be found in function “Optimization_TestFunction_Manager_RealValued()” defined in “Optimization_TestFunction_Kernel.C”

                                                                                               

 

The NrGA has 3 different Terminal Condition:

1)      Fixed Generation (test_mode = 0)

2)      Fixed Accuracy (test_mode = 1)

3)      Fitness improvement (test_mode = 2)

The Terminal condition is controlled by the variable “test_mode” and “test_parameter”. The meaning of “test_parameter” will be change when the “test_mode” is changed: for example, when the test_mode = 0, the “test_parameter” is the maximum generation that the NrGA will run. When the test_mode = 1, the NrGA will be terminated when the optimal fitness equals to “test_parameter”.

In this example, since the termination mode is fixed generation. The” test_mode” is set to 0, and the test_parameter is set to “max_generation”

Enable the NrGA by setting activate_mode = 1, Normal GA will be run when activate mode = 0

 

The test parameter

 

The test mode

 

 

Output of the NrGA:

In each trial, the optimal chromosome will be stored in “ (*cur_GA).GA_Info.Optimal_Chromosome” which can be found in “NonRevisitingGA_UnConstraint_Standard()”. Also, the optimal chromosome will be printed out to the console window.

 

How to add a new test function?

For example, a test function that the fitness is the sum of values in all dimension:

E.g.:  

We make a function which input an chromosome “double *solution” and return fitness as “double” :

 

After that, adding the “new_Test_Function” into “Optimization_TestFunction_Manager_RealValued()” defined in “Optimization_TestFunction_Kernel.C”

2.

 

1.

 

1.       Give a new test function index to it.

2.       Set the Optimization_TestFunction_Pointer pointing to it.

3.       Add the “ double new_Test_Function(double *solution); “ into “Optimization_TestFunction_Kernel.H”

 

Finally, set the test_Function_index in “NonRevisitingGA_Performance_Single()” to “99” (this example use 99 as the new test function index).