# What is it meant by "cannot use gradients" in Genetic Algorithms?

While reading a book on introduction to GA, I stepped upon a chapter where some advantages and disadvantages of these algorithms were described. One of the mentioned disadvantages was "Cannot use gradients" but there was no further explanation why. What did the authors mean by that? I couldn't come with a better idea than that you cannot just use a gradient as a fitness function. Still, I don't know why that would be.

A gradient is a partial derivative that specifies the rate of change in every direction from some point on a surface. With respect to optimization, that surface is the thing that we're looking for some extremum of. Often it might be something like an error function, such as the use of gradients in backpropagation for training a neural network. You compute the error function $$f(d,w)$$ where $$d$$ is the data, $$w$$ is the weights of the network, and $$f$$ is the error (the squared difference between what the network outputs and the desired target). The gradient with respect to $$w$$ gives us the rate of change of that error as we change the weights. And because we want the error to be small, we can just change the weights in the direction of the greatest decrease in the error. That's an example of "using" a gradient in optimization. It's a way of choosing an action based on knowing mathematically what will happen to your function for whatever move you make.
With a GA, how would this work? Now I want to minimize (or maximize, whatever) my fitness function $$f$$. The way a GA works is by creating a population of random candidate solutions and interatively using selection to choose fitter parents followed by operators like crossover and mutation to produce offspring that should be similar to their parents but usually not identical. The genetic operators create new search points, and selection serves to focus that creation into specific regions of the search space because it's always trying to favor fitter parents as starting points for those operators. Over time, we converge onto hopefully very fit individuals.