4 ms·
The fitness function does take char location into account. In python, it'd be -1*sum(abs(x-y) for x,y in zip(chromosome,target)). The gradient here is continu
by abhikshah 16y ago
The fitness function does take char location into account. In python, it'd be
-1*sum(abs(x-y) for x,y in zip(chromosome,target)).
The gradient here is continuous and smooth. Problems where GA is an appropriate solution have fitness landscapes that are much more pathological.