In Java, implement the following algorithm tosolve the n-queen problem (where n = 21):
Genetic algorithm
For analysis, you should generate a large number of n-queensinstances (>500) and solve them. Measure the percentage ofsolved problems, search costs and the average running time. Explainwhy you get such results, for example, why the algorithm can onlysolve the percentage of the problems that it did. Explain thedifficulties you experienced while implementing the algorithms.
Expert Answer
An answer will be send to you shortly. . . . .