CSE (c) S. Tanimoto, 2002 Genetic Search

Slides:



Advertisements
Similar presentations
CS6800 Advanced Theory of Computation
Advertisements

Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
Genetic Algorithms Sushil J. Louis Evolutionary Computing Systems LAB Dept. of Computer Science University of Nevada, Reno
Imagine that I am in a good mood Imagine that I am going to give you some money ! In particular I am going to give you z dollars, after you tell me the.
Genetic Algorithms Nehaya Tayseer 1.Introduction What is a Genetic algorithm? A search technique used in computer science to find approximate solutions.
Christoph F. Eick: Applying EC to TSP(n) Example: Applying EC to the TSP Problem  Given: n cities including the cost of getting from on city to the other.
Evolutionary algorithms
Computer Implementation of Genetic Algorithm
Introduction to Genetic Algorithms and Evolutionary Computation
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
Genetic algorithms Prof Kang Li
By Prafulla S. Kota Raghavan Vangipuram
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
Computational Complexity Jang, HaYoung BioIntelligence Lab.
Chapter 4.1 Beyond “Classic” Search. What were the pieces necessary for “classic” search.
Thursday, May 9 Heuristic Search: methods for solving difficult optimization problems Handouts: Lecture Notes See the introduction to the paper.
Learning by Simulating Evolution Artificial Intelligence CSMC February 21, 2002.
Evolution Programs (insert catchy subtitle here).
1 Genetic Algorithms and Ant Colony Optimisation.
Genetic Algorithms Przemyslaw Pawluk CSE 6111 Advanced Algorithm Design and Analysis
Introduction to Genetic Algorithms. Genetic Algorithms We’ve covered enough material that we can write programs that use genetic algorithms! –More advanced.
Genetic Algorithms CSCI-2300 Introduction to Algorithms
Edge Assembly Crossover
Genetic Algorithms. 2 Overview Introduction To Genetic Algorithms (GAs) GA Operators and Parameters Genetic Algorithms To Solve The Traveling Salesman.
Genetic Algorithms Chapter Description of Presentations
Genetic Search Algorithms Matt Herbster. Why Another Search?  Designed in the 1950s, heavily implemented under John Holland (1970s)  Genetic search.
Gerstner Lab, CTU Prague 1Motivation Typically,  an evolutionary optimisation framework considers the EA to be used to evolve a population of candidate.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
Genetic Algorithms and TSP Thomas Jefferson Computer Research Project by Karl Leswing.
Genetic Algorithms. Solution Search in Problem Space.
Genetic Algorithms An Evolutionary Approach to Problem Solving.
Genetic Algorithms And other approaches for similar applications Optimization Techniques.
1 Intro to AI Local Search. 2 Intro to AI Local search and optimization Local search: –use single current state & move to neighboring states Idea: –start.
1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Genetic Algorithms.
Optimization Problems
Optimization by Quantum Computers
Genetic Algorithms.
Genetic Algorithms.
Evolutionary Algorithms Jim Whitehead
School of Computer Science & Engineering
Local Search Algorithms
Example: Applying EC to the TSP Problem
Artificial Intelligence (CS 370D)
Subject Name: Operation Research Subject Code: 10CS661 Prepared By:Mrs
Genetic Algorithms CPSC 212 Spring 2004.
CS621: Artificial Intelligence
metaheuristic methods and their applications
ICS 353: Design and Analysis of Algorithms
Example: Applying EC to the TSP Problem
Optimization Problems
Example: Applying EC to the TSP Problem
Heuristics Local Search
Metaheuristic methods and their applications. Optimization Problems Strategies for Solving NP-hard Optimization Problems What is a Metaheuristic Method?
Genetic Algorithms CSCI-2300 Introduction to Algorithms
GENETIC ALGORITHMS & MACHINE LEARNING
Basics of Genetic Algorithms
Heuristics Local Search
Boltzmann Machine (BM) (§6.4)
Backtracking and Branch-and-Bound
A Gentle introduction Richard P. Simpson
Artificial Intelligence CIS 342
Local Search Algorithms
Traveling Salesman Problem by Genetic Algorithm
CSE (c) S. Tanimoto, 2004 Genetic Search
Beyond Classical Search
Robotics meet Computer Science
Local Search Algorithms
Coevolutionary Automated Software Correction
Presentation transcript:

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search Outline: Motivation. The Evolutionary Model. Example Problem: A travelling salesman problem. A sample program in Lisp. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search Motivation 1. Use nature as a guide. (Mutation plus mitotic reproduction, and Darwin’s principle of natural selection.) 2. Take advantage of parallel processing. (Allow an entire population -- maybe millions or billions -- to evolve.) 3. Use randomness to escape from local maxima of the fitness function. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

The Evolutionary Model Goal: To produce an individual having certain characteristics. (A “most fit” individual.) Method: Create a diverse population of individuals. Provide a means for adding to the population. Provide a means to weed out less fit individuals. Let the population evolve. Mutation: Random small change to the genetic blueprint for an individual. Crossover: Formation of a genetic blueprint for a new individual by splicing together a piece from individual A with a piece from individual B. Fitness function: A function that maps each individual to a scalar fitness value. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

Mutation and Crossover Mutation: Makes a move or a perhaps a sequence of moves in the state space. If the direction of moving is random, there is a good chance to escape from local maxima. Type 1: A random modification of one atomic unit -- one gene. Type 2: A reordering of genes, .e.g, a transposition of two genes. Crossover: Formation of a genetic blueprint for a new individual by splicing together a piece from individual A with a piece from individual B. If A and B are each very fit, but in different ways, perhaps crossover will produce an even more fit individual. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

Example Problem: A Travelling Salesman Problem Find a shortest tour for the cities: Seattle, Bellingham, Spokane, Wenatchee, Portland. Given: A matrix of intercity distances for these cities. Tour: a Hamiltonian circuit -- a closed path that starts and ends at one city and visits every other city exactly once. Our assumption: It’s possible to go from any city A to another city B without stopping (visiting) any other city C. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search The Map Bellingham 385 90 130 Spokane 350 400 100 Seattle 275 235 150 Wenatchee 200 Portland CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

Problem Representation Each individual: A list of 5 cities, repetitions permitted. e.g., (SEATTLE, SEATTLE, SPOKANE, SPOKANE, SPOKANE) 10000 Fitness function: f(x) = ----------------------- 2 f1(x) + 50 f2(x) 4 Path cost: f1(x) = sum dist(x[i], x[i+1 mod 5]) i = 0 Non-tour penalty: f2(x) = 100 ( | Cities - cities(x) | + | cities(x) - Cities | ) where “-” denotes set difference and |s| denotes cardinality. CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search MUTATE1 (defun mutate1 (individual) "Returns a slightly altered INDIVIDUAL, with the alteration generated randomly. One city is randomly changed.” (let* ((path (get-path individual)) (where (random (length path))) (new-city (nth (random *ncities*) *cities*)) ) (cons (replace-nth path where new-city) 0) ) ) CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search MUTATE2 (defun mutate2 (individual) "Returns a slightly altered INDIVIDUAL, with the alteration generated randomly. Two cities are transposed." (let* ((path (get-path individual)) (where1 (random (length path))) (where2 (random (length path))) (city1 (nth where1 path)) (city2 (nth where2 path)) ) (cons (replace-nth (replace-nth path where1 city2) where2 city1) 0) ) ) CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search CROSSOVER ;;; In CROSSOVER we assume that PATH1 and PATH2 ;;; are of the same length. (defun crossover (individual1 individual2) "Returns a new path resulting from genetic crossover of PATH1 and PATH2.” (let* ((path1 (get-path individual1)) (path2 (get-path individual2)) (where (random (length path1))) ) (cons (append (left-part path1 where) (right-part path2 where) ) 0) ) ) CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search EVOLVE (defun evolve (ngenerations nmutations ncrossovers) "Runs the genetic algorithm for NGENERATIONS times." (setf *population* *initial-population*) (dotimes (i ngenerations) (dotimes (j nmutations) (let ((mutated-one (mutate (random-individual)))) (add-individual mutated-one) ) ) (dotimes (j ncrossovers) (let* ((individual1 (random-individual)) (individual2 (another-individual individual1) ) (crossing-result (crossover individual1 individual2) ) ) (add-individual crossing-result) ) ) (format t "~%In generation ~D, population is: ~S.~%" (1+ i) *population*) ) ) CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search

CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search Design Issues Individual needs to be represented as a linear string or list to be amenable to crossovers. Fitness function must permit some diversity in the population in order to avoid getting stuck in local maxima. One could allow the mutation mechanisms and fitness functions to change during a run so that greater diversity is permitted near the beginning, but the search can “tighten up” later. (compare to simulated annealing). Randomness vs deterministic choices. Can genetic search be forced to systematically cover the entire state space? CSE 415 -- (c) S. Tanimoto, 2002 Genetic Search