Crossover Function for Genetic TSP
Please direct questions to Dan Gibson (gibson[at]cs.wisc.edu)
who helped create this assignment.
The crossover functions suggested in Shahookar/Mazumder are well-suited
to the VLSI problems they intend to solve. They are presented in this
assignment as examples of crossover functions--they are not particularly
well-suited to solving the traveling salesperson problem genetically.
Specifically, they do not easily converge to local minima in the
solution space.
We are placing very few requirements on your crossover function.
It need only take two (or more) parents as argument, and produce one
child. The focus of the assignment is to encourage you to think about
how one might parallelize the genetic process, not a particular crossover
implementation.
However, if you wish, you may want to explore crossover functions that
are well-suited to genetic TSP. A potential example crossover function
is described below. You are not required to implement this
crossover function.
Suppose Parents A and B are considered for crossover. Identify the "region"
within A or B that is most efficient, using some heuristic (possibly
distance/nCities, for instance). Copy that efficient region directly into
the child. From the other parent, add other cities before or after the
region in the position that minimizes distance, operating left-to-right
out of the donating parent.
Consider this:
Five stops, with the following distances between them:
|
Madison1 |
Madison2 |
Middleton |
Milwaukee |
LaCrosse |
Madison1 |
0 |
1 |
5 |
90 |
100 |
Madison2 |
1 |
0 |
6 |
91 |
99 |
Middleton |
5 |
6 |
0 |
95 |
95 |
Milwaukee |
90 |
91 |
95 |
0 |
190 |
LaCrosse |
100 |
99 |
95 |
190 |
0 |
Parent A: |
La Crosse |
Madison2 |
Madison1 |
Middleton |
Milwaukee |
Cum. Dist.: |
0 |
99 |
100 |
105 |
201 |
Parent B: |
Madison1 |
La Crosse |
Middleton |
Madison2 |
Milwaukee |
Cum. Dist.: |
0 |
100 |
195 |
201 |
292 |
In parent A, the Madison/Madison/Middleton string is very good
(only 6 miles for 3 stops). So lets include that in child C.
Child C: |
? |
? |
Madison2 |
Madison1 |
Middleton |
? |
? |
Cum. Dist.: |
|
|
x |
x + 1 |
x + 6 |
|
|
Note that we may at this point insert the contributions from B either
before or after the initial string. I denote this with question marks.
C still doesn't include Milwaukee or La Crosse. These contributions will
come from B. Insert LaCrosse (first in left-to-right order in B not
already in C):
Child C: |
? |
Madison2 |
Madison1 |
Middleton |
? |
La Crosse |
? |
Cum. Dist.: |
|
x |
x + 1 |
x + 6 |
|
y + 101 |
|
We insert LaCrosse where the minumum total distance is achieved.
Adding it before the initial string would have added 101, not 95.
Note that we now have three possible insertion locations--only
the Madison/Madison/Middleton group will remain atomic.
Finally, we insert Milwaukee:
Child C: |
Milwaukee |
Madison2 |
Madison1 |
Middleton |
La Crosse |
Cum. Dist.: |
0 |
91 |
92 |
97 |
192 |
Again, Milwaukee was added at the position such that distance was minimized.
Intuitively, the algorithm above may have desireable local minima convergence.
It may be difficult to implement in practice, though hopefully it outlines what
a good TSP crossover function might look like. Remember, these algorithms are
heuristic-based, so there is no right crossover function.
Variants on the ideas above are also possible.
|