Search code examples
matlabgenetic-algorithm

How the number of decision variables have effects on the populations in NSGA-II?


I just have started reading the NSGA-II code in Matlab recently, and I don't understand what the number of decision variables setting relates in the initialization state in genetic algorithm. Is it related to the test function or used for other intention?

I would appreciate it if you would be so kind to answer.


Solution

  • The number of decision variables is related to the number of genes in the chromosomes of each individual.

    Let's say you are trying to optimize a function f(x,y). Then you have two decision variables, and therefore your chromosomes will be R^d where d = 2.

    Knowing the number of decision variables is essential to the metaheuristics such as genetic algorithm because much of its operators rely on it, e.g., to perform crossover you need to know the size of the chromosome (size of your representation) so you can iterate and create the offspring, etc.