This approach leads to O(n) complexity of thefitness function. But in case of simulatedannealing algorithm (Figure 7), it was possible toreduce complexity to O(1). Since every newsolution differs only in two positions from theprevious one, the new value of the fitnessfunction can be calculated by observing the 8diagonals that eventually change the number ofqueens.
đang được dịch, vui lòng đợi..
