1 / 10

Direct and Indirect Representations

Direct and Indirect Representations. Direct vs. Indirect. When we have a direct representation the genotype can be DIRECTLY interpreted to give us our phenotype

khan
Download Presentation

Direct and Indirect Representations

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Direct and Indirect Representations

  2. Direct vs. Indirect • When we have a direct representation the genotype can be DIRECTLY interpreted to give us our phenotype • When we have an indirect representation the genotype is used to parameterise some more complex growth algorithm to produce the phenotype • Sometimes the distinction is rather grey

  3. Example - The Knapsack Problem • The problem is to choose which items to take in a knapsack . • Each item has a weight and a value • We want to maximise the value of the items in the knapsack, without exceeding some maximum weight.

  4. CHROMOSOME GENE Direct Representation • The chromosome (genotype) is an array of bits - one for each item in the knapsack • A “1” means - take the item • A “0” mean don’t take the item

  5. 3 6 4 8 7 1 2 5 9 0 Indirect Representation We might have a growth algorithm which tries to put each items into the knapsack in turn. If it fits without going overweight then it stays in the knapsack. If it doesn’t then it is discarded and the next item is considered. The chromosome (genotype) could tell us in which order to consider the items: E.g.

  6. Example - Timetabling • The problem is to put a number of events into a smaller number of timeslots. • Constraint: Some event can’t take place at the same time.

  7. Direct Representation • The chromosome (genotype) is an array of integers - one for each event • The integer tells us which timeslot to use CHROMOSOME 4 5 4 3 2 1 5 7 GENE The fitness is calculated by counting the number of clashes

  8. Indirect Representation We might have the same genotype, but have a growth algorithm that works like this: Consider each event in turn. Try to put the event in the timeslot specified by the chromosome. If it fits then leave it there. If placing it there would produce a clash with a previously placed event, then try the next slot, then the next and so on. If it doesn’t fit in any slot then mark it as unplaced. The fitness is calculated by counting the number of unplaced events.

  9. 3 6 4 8 7 1 2 5 9 0 Permutation Representations • Specifies an order • Direct Example: TSP • Indirect example: Knapsack • Each item occurs once and once only • Otherwise the chromosome would be invalid

  10. Permutation Representation - Exercise Try to devise mutation and recombination operators that would work for permutation representations. Look back in your notes to see what qualities we look for in such operators.

More Related