Author Notes
Detailed explanation what is being optimized in this example:
The array possibValues in this simple example shows the valid variable assignments in each row. Each row stands for one variable with its corresponding possible values. In this example you have 10 variables, each of them can have 10 different states. This results in 1010 possible variable assignments (size of the search space in this example).
The optimization task is to find the shortest path (minimum) through this array (with its 1010 different permissible configurations) with regard to the defined function fit. For the sake of simplicity, the total value of the individual variables was simply chosen as the objective function in this example, fit=Total[#]& .
Thus, for example, a path as marked in red here has a corresponding path length of Total[{3,9,1,6,10,9,7,3,6,8}] →62
The optimal (shortest possible) path to be found by the AntColonyOptimization-algorithm after some iterations is follows:
with Total[{1,1,1,1,1,1,1,1,1,1}] →10 (absolute minimum of the search space).
This example is rather trivial and has only the purpose to outline the basic procedure and to introduce the basic parameters, such as array and fitness function, which are necessary to formulate the optimization problem. Slightly more complex application examples follow below.
A brief summary :
-The array (list of lists) defines the search space (number of rows corresponds to the number of variables and the number of columns corresponds to the possible individual states of each variable). The number of possible variable states can generally be different for each variable.
- The function (fitness) assigns each valid variable configuration an associated quality, the corresponding path length. This allows to compare the different variable configurations.
- Within the given search space (encoded in array) and the given virtual path length defined by fitness, AntColonyOptimization try to find the shortest path (minimum) through the search space and return its related variable assignments .