Logistics Checkpoint 1 -- Framework Genotypes and Phenotypes Due - - PDF document

logistics
SMART_READER_LITE
LIVE PREVIEW

Logistics Checkpoint 1 -- Framework Genotypes and Phenotypes Due - - PDF document

Logistics Checkpoint 1 -- Framework Genotypes and Phenotypes Due Friday, Dec 22nd. Group accounts Need one for you project? Let me know. Few solo acts Logistics Logistics Grad Report This week: Will need


slide-1
SLIDE 1

1

Genotypes and Phenotypes

Logistics

 Checkpoint 1 -- Framework

 Due Friday, Dec 22nd.  Group accounts…

 Need one for you project? Let me know.

 Few solo acts…

Logistics

 Grad Report

 Will need topics first week after we return

from break (Jan 11th).

Logistics

 This week:

 Wednesday’s office hour (2-4) canceled  Thursday’s class (2-4) will start at 2:15.

Plan for today

 Genotypes and Phenotypes  Questions before we start

Evolutionary Algorithms

 An EA uses some mechanisms inspired by biological

evolution: reproduction, mutation, recombination, natural selection and survival of the fittest.

 Candidate solutions to the optimization problem play

the role of individuals in a population, and the cost function determines the environment within which the solutions "live".

 Evolution of the population then takes place after the

repeated application of the above operators.

slide-2
SLIDE 2

2

Evolutionary Computation process

Initialize population Select individuals for crossover (based on fitness function Crossover Mutation Insert new offspring into population Are stopping criteria satisfied? Finish

Evolutionary Algorithms

 To use evolutionary algorithms your must:

 Define your problem  Define your genotype  Identify your phenotype  Define the genotype -> phenotype translation  Define crossover and mutation operators  Define fitness  Determine selection criteria  Set population parameters

The Problem

Problem

parameters solution

  • utput

The Problem

 Parameters

 values that define a particular instance of the

problem

 Solution

 This is the realization of the individual (phenotype)

The solution has a number of traits/variables

 Output

 This is the result of applying the solution to the

  • problem. The output will get judged for fitness.

Fitness

Individual

Phenotype Genotype

problem

parameters

  • utput

Fitness

fitness

Population

individuals

slide-3
SLIDE 3

3

The individual

Individual Phenotype Genetic Mapping Genotype

The individual

 The individual consists of:

 Genotype

 genetic material  DNA

 Phenotype

 Realization/manifestation of the genetic material  List of traits / variables.  This is the solution passed to the Problem

 Genetic Mapping

 Produces solution (set of traits) from genetic material (basic

data structure)

Genotype

 Genotype is a basic data structure or

type

 General -- very non-specific  Genetic material that gets manipulated

in crossover / mutation.

Phenotype

 Phenotype represents a solution to a

problem

 Very problem specific  Manifestation of genetic material.

Some genetic vocabulary

 Genotype

 the specific genetic makeup of an

individual, in the form of DNA. Together with the environmental variation that influences the individual, it codes for the phenotype of that individual.

 Genome

 A specific instance of a genotype

Some genetic vocabulary

 Gene

 unit of heredity in every living organism. A

subsection of the genotype that can be isolated and identified to have some function.

 Allele

 Value for a specific gene.

 Chromosome

 Collection of genes.

slide-4
SLIDE 4

4

Some genetic vocabulary

 Phenotype

 total physical appearance and constitution

  • r a specific manifestation of a trait, such

as size, eye color, or behavior that varies between individuals.

Genotypes

 Example data types

 Bit strings  Arrays  Trees  Lists  Matrices

Bit strings

 Classic GA representation

1 1 1 1 1

CHROMOSOME GENE

Bit strings

 Can use to represent any phenotype

1 1 1 1 1

integer float List whatever color …

Bit strings

 Easy to define crossover and mutation

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Arrays

 Representing set of parameters  Unlike bit strings

 Each “gene” has meaning in and of itself

1 62 9 7 12 36 21 10

slide-5
SLIDE 5

5

Arrays

 Easy to define crossover / mutation 1 62 9 7 12 36 21 10 16 6 19 72 2 96 62 27 16 6 19 72 12 36 21 10 1 62 9 7 12 36 21 10 1 62 9 10 12 36 21 10

Trees

 Representing hierarchical data  Program structure

a c b d e f g

Trees

 Easy to define crossover / mutation

Before crossover After crossover

crossover mutation

Before mutation After mutation

Lists

 Variable sized

Lists

 Easy to define crossover / mutation

1 2 10 11 12 3 10 1 2 11 12 1 2 3 1 3

Matricies

 For multidimensional data

1 1 1 1 1 1 1 1

  • 10

19 26 32 14 1 62 11 31 47 99 12 30 3 18

  • Bitwise

Integer valued

slide-6
SLIDE 6

6

Matrices

 Easy to define crossover and mutation

1 1 1 1

  • 1

1 1 1 1 1 1 1 1 1 1 1

  • 1 1

1 1 1 1 1 1

  • 1

1 1 1 1 1 1 1 1 1 1 1

  • 1

1 1 1 1 1 1 1 1 1 1

  • 1

Genotypes

 Summary

 Basic  Simple  Easy to define crossover and mutation

 Questions

Genetic Mapping

Individual Phenotype Genetic Mapping Genotype

Bad Mojo

 What if you have a bad instance of a

genotype.

 Fix during genetic mapping (repair)  Disallow during crossover / mutation

(designer operators)

 Eliminate during evaluation.

Genetic Mapping

 Responsible for taking a basic generic

genome and turn it into a problem-specific solution.

 May require some “genetic repair”  Questions?  Break?

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-7
SLIDE 7

7

Traveling Salesman Problem

 Solution:

 Tour of the cities such that each city is visited

  • nce.

 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.

 Let’s look at some genotype-phenotype pairs

for TSP

 From [Larranaga, et. al. 1999]

 Recall:

 Phenotype == ordered tour of the cities

TSP - Path Representation

 Tour is represented as an ordered list

(or array) of 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

6 8 5 7 1 4 2 3

TSP - Path Representation

 Most intuitive and common genotype.  But it has it’s problems: 6 8 5 7 1 4 2 3 1 2 3 4 5 6 7 8 1 2 3 4 1 4 2 3 6 8 5 7 1 4 2 3 6 8 5 3 1 4 2 3

Not valid tours!!!

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

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

7

slide-8
SLIDE 8

8

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 concatination of cities

in order.

 Complete genome has length n log2(n)

TSP -- binary representation

 Example  Tour: 1-2-3-4-5-6

 (000 001 010 011 100 101)

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

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

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.

 (Allows for schematic analysis)

slide-9
SLIDE 9

9 TSP - Adjacency Representation

 Example: 1 2 8 4 6 7 5 3

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 5 2 6 4 8

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.

TSP - ordinal representation

 Example

 C = ( 1 2 3 4 5 6 7 8 9 )

 Genome: 1 1 3 1 4 1 2 1 1

1 2 4 3 8 5 9 6 7

TSP - ordinal representation

 Complex? Perhaps, but std. crossover

works!

1 1 3 1 4 1 2 1 1 1 2 3 3 5 5 5 1 5 1 2 3 3 5 1 2 1 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-10
SLIDE 10

10 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

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 one 1 in it.

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-11
SLIDE 11

11

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.

Next time

 The “classic” Genetic Algorithm  Remember:

 Class starts at 2:15

 Questions?