Transporting Perishable Goods (ANEB-TSP) The Art of Implementing an EA Assignment 1 CS 348 Fall 2008.

Slides:



Advertisements
Similar presentations
Population-based metaheuristics Nature-inspired Initialize a population A new population of solutions is generated Integrate the new population into the.
Advertisements

1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
CS6800 Advanced Theory of Computation
Exact and heuristics algorithms
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
1 APPENDIX A: TSP SOLVER USING GENETIC ALGORITHM.
CSM6120 Introduction to Intelligent Systems Evolutionary and Genetic Algorithms.
Genetic Algorithms Representation of Candidate Solutions GAs on primarily two types of representations: –Binary-Coded –Real-Coded Binary-Coded GAs must.
Valery Frolov.  The algorithm  Fitness function  Crossover  Mutation  Elite individuals  Reverse mutations  Some statistics  Run examples.
Hybridization of Search Meta-Heuristics Bob Buehler.
Multi-Objective Evolutionary Algorithms Matt D. Johnson April 19, 2007.
Evolutionary Computational Intelligence
Population New Population Selection Crossover and Mutation Insert When the new population is full repeat Generational Algorithm.
Doug Downey, adapted from Bryan Pardo, Machine Learning EECS 349 Fall 2007 Machine Learning Genetic Algorithms.
EA* A Hybrid Approach Robbie Hanson. What is it?  The A* algorithm, using an EA for the heuristic.  An efficient way of partitioning the search space.
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.
EAs for Combinatorial Optimization Problems BLG 602E.
Euclidean TSP EA Pseudo Code. What is a Euclidean TSP? c ij 2 = (x i – x j ) 2 + (y i – y j ) 2.
Using a “Memetic” Evolutionary Algorithm to Solve a Form of The Maximum Clique Problem By Ian Baird November 20 th, 2003.
Applying Evolutionary Algorithm to Chaco Tool on the Partitioning of Power Transmission System (CS448 Class Project) Yan Sun.
CS 447 Advanced Topics in Artificial Intelligence Fall 2002.
N-Queens Computer Science 301 Spring 2007 Assignment 1 Bob Presents…
Tutorial 4 (Lecture 12) Remainder from lecture 10: The implicit fitness sharing method Exercises – any solutions? Questions?
Genetic Algorithms Overview Genetic Algorithms: a gentle introduction –What are GAs –How do they work/ Why? –Critical issues Use in Data Mining –GAs.
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.
Prepared by Barış GÖKÇE 1.  Search Methods  Evolutionary Algorithms (EA)  Characteristics of EAs  Genetic Programming (GP)  Evolutionary Programming.
Evolutionary algorithms
Genetic Algorithm.
Computer Implementation of Genetic Algorithm
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Researchers: Preet Bola Mike Earnest Kevin Varela-O’Hara Han Zou Advisor: Walter Rusin Data Storage Networks.
HOW TO MAKE A TIMETABLE USING GENETIC ALGORITHMS Introduction with an example.
More on Heuristics Genetic Algorithms (GA) Terminology Chromosome –candidate solution - {x 1, x 2,...., x n } Gene –variable - x j Allele –numerical.
Outline Introduction Evolution Strategies Genetic Algorithm
The Generational Control Model This is the control model that is traditionally used by GP systems. There are a distinct number of generations performed.
DP TSP Have some numbering of the vertices We will think of all our tours as beginning and ending at 1 C(S, j) = length of shortest path visiting each.
1 “Genetic Algorithms are good at taking large, potentially huge search spaces and navigating them, looking for optimal combinations of things, solutions.
FINAL EXAM SCHEDULER (FES) Department of Computer Engineering Faculty of Engineering & Architecture Yeditepe University By Ersan ERSOY (Engineering Project)
Crossovers and Mutation Richard P. Simpson. Genotype vs. Phenotype The genotype of a chromosome is just the basic data structure (it bits in a binary.
A New Evolutionary Approach for the Optimal Communication Spanning Tree Problem Sang-Moon Soak Speaker: 洪嘉涓、陳麗徽、李振宇、黃怡靜.
Genetic Algorithms ML 9 Kristie Simpson CS536: Advanced Artificial Intelligence Montana State University.
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 What is a GA Terms and definitions Basic algorithm.
ECE 103 Engineering Programming Chapter 52 Generic Algorithm Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
Genetic Algorithms. The Basic Genetic Algorithm 1.[Start] Generate random population of n chromosomes (suitable solutions for the problem) 2.[Fitness]
Solving Function Optimization Problems with Genetic Algorithms September 26, 2001 Cho, Dong-Yeon , Tel:
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
Building an Evolutionary Algorithm Prof. Emma Hart.
1 Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations Genetic Algorithm (GA)
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithms. Solution Search in Problem Space.
Genetic Algorithm(GA)
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
 Presented By: Abdul Aziz Ghazi  Roll No:  Presented to: Sir Harris.
1 Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm 3. Practical considerations.
Genetic Algorithm (Knapsack Problem)
Example: Applying EC to the TSP Problem
Artificial Intelligence Project 2 Genetic Algorithms

Genetic Algorithms CPSC 212 Spring 2004.
KEY CONCEPT A population shares a common gene pool.
Example: Applying EC to the TSP Problem
Genetic Algorithms Chapter 3.
Genetic Programming Chapter 6.
Genetic Programming Chapter 6.
KEY CONCEPT A population shares a common gene pool.
Genetic Programming Chapter 6.
Population Based Metaheuristics
Presentation transcript:

Transporting Perishable Goods (ANEB-TSP) The Art of Implementing an EA Assignment 1 CS 348 Fall 2008

Asymmetric Non-Euclidean Bottleneck TSP Travel Time (hours)

Dataset File Format Number of vertices v e s1 d1 w1 s2 d2 w2 … s d w Number of edges Edge info: Source vertex Destination vertex Edge weight Example: …

Individual Genotype Representation Permutations Possible Permutations Cycle 1 Cycle 2

Permutation Creation 1.Create array 2.Number in-order 3.Loop i ← 1 to N 1.j ← random ≥ i 2.Swap(A[i], A[j])

Individual Datastructure A standard EA solution will usually have 2 data members –Genotype –Fitness Fitness is stored to avoid recalculation –For static problem environments

Fitness Calculation Find the edge with the largest weight in the trial solution (the permutation) –weights are given in the datafile Fitness should be inversely proportional to the largest weight –Objective function vs. Fitness function –Ideas Fitness = - largest weight Fitness = 1 / largest weight – Highest fitness value will be the best individual

Program Requirements Read from a configuration file Complete 1+ runs of the EA Write information to a log file

Required Parameters in Configuration File ( datafile ) Dataset file ( logfile ) Log file ( popsize ) Population size ( offsize ) Offspring per generation ( tournsize ) Tournament size ( maxeval ) Maximum evaluations ( runs ) Number of runs ( seed ) Random seed

Initial Setup Open configuration file Parse values into variables Read datafile describing the TSP dataset Seed random number generator

Random Number Generator Is a datastructure Updates internal variables every time a random number is requested Seed only once Use quality RNG –the Mersenne Twister personal.engin.umich.edu/~wagnerr/MersenneTwister.htmlhttp://www- personal.engin.umich.edu/~wagnerr/MersenneTwister.html

EA Run –Pass in all configuration data Create data structures for population/offspring – population [ popsize ] – offspring [ offsize ] Initialize population with random individuals – evalcount = popsize While( evalcount < maxevals ) –For # of children (offsize) Select two parents by two n-ary tournaments Recombine using cut-and-crossfill Mutate offspring Evaluate child’s fitness ( evalcount++ ) –Sort and elitist survival selection

Parent Selection Create tournsize random numbers for each parent to be selected ( r1 … rn ) Parent 1 –max_fitness(population[ r1 ]... population[ rn ]) Parent 2 –generate new random numbers ( t1 … tn ) –max_fitness(population[ t1 ]... population[ tn ])

Recombination (“cut-and-crossfill”) Child

Recombination (“cut-and-crossfill”) 1.Used[] ← boolean array of all false’s 2.XPoint ← random from 1 to N 3.For (i ← 1 to XPoint) 1.Child[i] ← ParentA[i] 2.Used[Child[i]] ← true 4.j ← 0 5.For (i ← XPoint to N ) 1.While(Used[ParentB[j]]) 1.j ← j Child[i] ← ParentB[j]

Bonus – Implementing Another Recombination Method Many ways to implement crossover for a permutation –Affects performance of the EA Examples – Chapter 3 –Partially Mapped Crossover (PMC) –Edge Crossover –Order Crossover –Cycle Crossover

Mutation 1.i ← random from 1 to N 2.j ← random from 1 to N 3.Swap(Child[i], Child[j])

Truncation Survival Selection Combine population and offspring into one group Sort by fitness Keep the best popsize individuals in the population

Bonus – Compare to a Heuristic Implement or test a good existing heuristic for the ANEB-TSP Statistically compare to the EA Code for the heuristic is due along with the report