Order Crossover (OX) - genetic algorithm

旧时模样 提交于 2019-12-06 05:09:16

问题


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


回答1:


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!




回答2:


Basically, a swath of consecutive alleles from parent 1 drops down, and remaining values are placed in the child in the order which they appear in parent 2.

Step 1: Select a random swath of consecutive alleles from parent 1. (underlined)

Step 2: Drop the swath down to Child 1 and mark out these alleles in Parent 2.

Step 3: Starting on the right side of the swath, grab alleles from parent 2 and insert them in Child 1 at the right edge of the swath. Since 8 is in that position in Parent 2, it is inserted into Child 1 first at the right edge of the swath. Notice that alleles 1, 2 and 3 are skipped because they are marked out and 4 is inserted into the 2nd spot in Child 1.

Step 4: If you desire a second child from the two parents, flip Parent 1 and Parent 2 and go back to Step 1.



来源:https://stackoverflow.com/questions/26518393/order-crossover-ox-genetic-algorithm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!