TravelingSalesman Problem Instance: - - PDF document

traveling salesman problem
SMART_READER_LITE
LIVE PREVIEW

TravelingSalesman Problem Instance: - - PDF document

9/22/09 Genotypes and Phenotypes PartIITheReturnoftheSalesman TravelingSalesman Problem Instance: Ncitieswithdistancesbetweenpairsofcities Saidanotherway:


slide-1
SLIDE 1

9/22/09
 1


Genotypes and Phenotypes

Part
II
‐‐
The
Return
of
the
Salesman


Traveling
Salesman
 Problem


  • Instance:

  • N
cities
with
distances
between
pairs
of
cities

  • Said
another
way:

  • Complete
graph
with
n
vertices
such
that
all


edges
are
labeled
with
a
cost
value


slide-2
SLIDE 2

9/22/09
 2


Traveling
Salesman
 Problem


  • Solution:

  • Tour
of
the
cities
such
that
each
city
is
visited
once.

  • Said
another
way:

  • A
permutation
of
the
cities.

  • Ordered
list
of
the
cities

  • Is
this
a
large
search
space?

  • n
cities
=
n!
permutation


Traveling
Salesman
 Problem


  • Output:

  • Distance
traveled
to
complete
the
tour.

  • Recall:

  • Phenotype
==
ordered
tour
of
the
cities

  • TSP
presents
challenges
for
Genetic
Mapping.

slide-3
SLIDE 3

9/22/09
 3


TSP
‐
Path
 Representation


  • Tour
is
represented
as
an
ordered
list
(or
array)

  • f
the
cities.

  • Order
in
array
==
order
of
visitation.

  • If
city
i
is
the
jth
element
of
the
array,
city
i
is
the


jth
city
to
be
visited.


  • Eg.


Tour:
3‐2‐4‐1‐7‐5‐8‐6


3 2 4 1 7 5 8 6

TSP
‐
Path
 Representation


  • Most
intuitive
and
common
genotype.

  • But
it
has
it’s
problems:


3 2 4 1 7 5 8 6 8 7 6 5 4 3 2 1 3 2 4 1 4 3 2 1 3 2 4 1 7 5 8 6 3 2 4 1 3 5 8 6

Not
valid
tours!!!


slide-4
SLIDE 4

9/22/09
 4


TSP
‐
Path
 Representation


  • GeneRepair
[Mitchell,
et.al.]

  • Keep
a
corrective
template
with
a
valid
tour.

  • Identify
duplicate
cities

  • Use
template
to
replace
duplicate
cities.


TSP
‐
Path
 Representation


1 2 3 4 5 6 7 8 3 2 4 1 3 5 8 6

7


slide-5
SLIDE 5

9/22/09
 5


TSP
‐
Path
 Representation


  • Genetic
Mapping
responsible
for
doing
the


repair
on
a
“bad
genome”


  • Most
approaches
that
use
the
path


representation
use
designer
crossover/ mutation
operators


  • Assure
valid
offspring.


TSP
‐
binary
 representation


  • Classic
GA
approach

  • Each
city
encoded
by
a
string
of
length
log2(n)
‐‐


chromosomes?


  • Complete
genome
is
concatenation
of
cities
in

  • rder.

  • Complete
genome
has
length
n
log2(n)

slide-6
SLIDE 6

9/22/09
 6


TSP
‐‐
binary
 representation


  • Example

  • Tour:
1‐2‐3‐4‐5‐6

  • (000
001
010
011
100
101)


i City i i City i 1 000 4 011 2 001 5 100 3 010 6 101

Duplicate
cities


TSP
‐‐
binary
 representation


  • Similar
problem
with
repair.

  • (000
001
010
011


011
101)


1‐2‐3‐4‐5‐6

  • (101


100
011

010
001
000)


6‐5‐4‐3‐2‐1

  • (000
001
010
010
001
000)

1‐2‐3‐3‐2‐1

slide-7
SLIDE 7

9/22/09
 7


TSP
‐‐
binary
 representation


  • Genetic
Mapping:

  • Decode
binary
‐>
city.

  • Perform
repair
for
“bad
genome”.


TSP
‐
Adjacency
Representation


  • Tour
is
represented
as
an
array
of
n
cities.

  • City
j
is
listed
in
position
i,
if
and
only
if,
the
tour


leads
from
city
i
to
city
j.


slide-8
SLIDE 8

9/22/09
 8


TSP
‐
Adjacency
Representation


  • Example:


3 5 7 6 4 8 2 1

1
 3
 7
 2
 5
 4
 6
 8


TSP
‐
Adjacency
Representation


  • Has
same
problem
as
others
PLUS

  • (
3
5
7
6
2
4
1
8)
⇒
(1
3
7
|
2
5
|
4
6
8)


1
 3
 7
 5
 2
 6
 4
 8


slide-9
SLIDE 9

9/22/09
 9


TSP
‐
Adjacency
Representation


  • Note:


  • Same
phenotype
as
path
representation

  • Different
Genetic
Mapping.

  • …and
here’s
another
one


TSP
‐
ordinal
 representation


  • Tour
is
represented
as
an
array
of
n
cities.

  • The
ith
element
is
a
number
in
the
range
from
1


to
(n
‐
i
+
1)


  • There
exists
an
ordered
list
of
cities
to
use
as
a


reference
point.


slide-10
SLIDE 10

9/22/09
 10


TSP
‐
ordinal
 representation


  • Example

  • C
=
(

1

2

3

4

5

67

8

9
)

  • Genome:


1 1 2 1 4 1 3 1 1

1
 2
 4
 3
 8
 5
 9
 6
 7


TSP
‐
ordinal
 representation


  • Complex?


Perhaps,
but
std.
crossover
works!


1 1 2 1 4 1 3 1 1 5 1 5 5 5 3 3 2 1 1 1 2 1 5 3 3 2 1

1‐2‐4‐3‐8‐5‐9‐6‐7
 5‐1‐7‐8‐9‐4‐6‐3‐2
 1‐2‐4‐3‐9‐7‐8‐6‐5


slide-11
SLIDE 11

9/22/09
 11


TSP
‐
ordinal
representation


  • Note:


  • Same
phenotype
as
path
representation

  • Even
more
complex
Genetic
Mapping.


TSP
‐
Matrix
 representation(1)


  • Tour
is
represented
as
a
2D
binary
matrix,
M.

  • Mij
=
1
if
and
only
if
city
i
is
visited
before
city
j
in


the
tour.


  • Must
have
the
following
properties:

  • Number
of
1’s
=
n(n‐2)
/
2

  • Mii
=
0

  • If
Mij
=
1
and
Mjk
=1
then
Mik
=
1

slide-12
SLIDE 12

9/22/09
 12


TSP
‐
Matrix
 representation(1)


1 1 1 1 1 1            

Tour:
2‐3‐1‐4


TSP
‐
Matrix
 representation(2)


  • Tour
is
represented
as
a
2D
binary
matrix,
M.

  • Mij
=
1
if
and
only
if
city
j
follows
city
i


immediately
on
the
tour.


  • Each
row
and
each
column
must
have
exactly

  • ne
1
in
it.

slide-13
SLIDE 13

9/22/09
 13


TSP
‐
Matrix
 representation(2)


1 1 1 1            

Tour:
1‐4‐2‐3


By
the
way


  • Most
promising
approach:

  • Path
representation
with
designer
crossover
/


mutation
operators.


  • Questions?

slide-14
SLIDE 14

9/22/09
 14


Take
home
messages


  • A
given
phenotype
can
result
from
many


different
genotypes.


  • Different
genotype‐phenotype
pairs
can
have


different
Genetic
Mapping.


  • Get
creative
with
your
genetic
mapping!

  • Bad
mojo
is
a
problem

  • Genetic
repair
during
Genetic
Mapping

  • Use
of
designer
crossover
/
mutation
operators.


Questions


  • Questions?