Search code examples
javaartificial-intelligence

Order Crossover (OX) - genetic algorithm


Can someone explain me how Order Crossover works? I will give this example and I want to understand it in a generic way to implement after.

Parent 1 = 1 2 3 | 4 5 6 7 | 8 9

Parent 2 = 4 5 2 | 1 8 7 6 | 9 3

and the solution are two childreen:

Children 1 = 2 1 8 | 4 5 6 7 | 9 3

Children 2 = 3 4 5 | 1 8 7 6 | 9 2

I understand some parts but others not.

Thanks


Solution

  • One such solution for Ordered Crossover is detailed in this post.

    This answer provides some sample java code with documentation detailing the processes used for the Ordered Crossover.

    Additionally, this paper from Moscato provides a breakdown of the OX Process.

    Hope this helps!