Ordering should, as far as possible, not be limited to genetic programming. Perhaps you should consider choosing a different format for your solutions. For example, in your TSP, consider codon A-> B.
Instead of taking the edge from A to B, you might consider taking the shortest path from A to B. Thus, your decisions are always possible. You just need to pre-calculate the shortest path matrix as preprocessing.
Now this does not guarantee that candidates will become possible solutions after your crossover. Your crossover must be tuned to ensure that your solution is still possible. For example, for TSP, consider the sequences:
1: ABCD E FGH
2: AD E GCBFH
Choose our case randomly ( E in our example). This leads to the following sequences:
1 ': ABCD E .,.
2 ': AD E. ,,.
All peaks must be visited in order to have the right decision. In 1 ', you should visit F, G and H. We order them as they are in sequence 2. In 2', G, C, B, F and H are reordered, as in 1:
1 ': ABCD E GFH
2 ': AD E BCFGH
Hope this helps.
David
source share