Introduction to Genetic Algorithms. Genetic Algorithms

Similar documents
GENETIC ALGORITHM with Hands-On exercise

Artificial Intelligence Application (Genetic Algorithm)

ARTIFICIAL INTELLIGENCE (CSCU9YE ) LECTURE 5: EVOLUTIONARY ALGORITHMS

A Web-Based Evolutionary Algorithm Demonstration using the Traveling Salesman Problem

Introduction to Evolutionary Computation

Comparative Analysis of Genetic Algorithm Implementations

Escaping Local Optima: Genetic Algorithm

CHAPTER 4 GENETIC ALGORITHM

CHAPTER 5 ENERGY MANAGEMENT USING FUZZY GENETIC APPROACH IN WSN

Genetic Algorithms. Chapter 3

4/22/2014. Genetic Algorithms. Diwakar Yagyasen Department of Computer Science BBDNITM. Introduction

Advanced Search Genetic algorithm

March 19, Heuristics for Optimization. Outline. Problem formulation. Genetic algorithms

Genetic Algorithms. Kang Zheng Karl Schober

Mutations for Permutations

Chapter 9: Genetic Algorithms

A New Selection Operator - CSM in Genetic Algorithms for Solving the TSP

Introduction to Genetic Algorithms. Based on Chapter 10 of Marsland Chapter 9 of Mitchell

Using Genetic Algorithms to optimize ACS-TSP

Genetic Programming. Charles Chilaka. Department of Computational Science Memorial University of Newfoundland

Evolutionary Computation Part 2

Solving Traveling Salesman Problem for Large Spaces using Modified Meta- Optimization Genetic Algorithm

Hybridizing PSM and RSM Operator for Solving NP-Complete Problems: Application to Travelling Salesman Problem

Fuzzy Inspired Hybrid Genetic Approach to Optimize Travelling Salesman Problem

Genetic Algorithms. Genetic Algorithms

Introduction to Genetic Algorithms

Solving ISP Problem by Using Genetic Algorithm

Using Genetic Algorithm with Triple Crossover to Solve Travelling Salesman Problem

AI Programming CS S-08 Local Search / Genetic Algorithms

Modified Order Crossover (OX) Operator

Outline. Motivation. Introduction of GAs. Genetic Algorithm 9/7/2017. Motivation Genetic algorithms An illustrative example Hypothesis space search

CONCEPT FORMATION AND DECISION TREE INDUCTION USING THE GENETIC PROGRAMMING PARADIGM

A Steady-State Genetic Algorithm for Traveling Salesman Problem with Pickup and Delivery

The Genetic Algorithm for finding the maxima of single-variable functions

The k-means Algorithm and Genetic Algorithm

What is GOSET? GOSET stands for Genetic Optimization System Engineering Tool

Khushboo Arora, Samiksha Agarwal, Rohit Tanwar

Comparison Study of Multiple Traveling Salesmen Problem using Genetic Algorithm

Solving Traveling Salesman Problem Using Parallel Genetic. Algorithm and Simulated Annealing

Evolutionary Computation. Chao Lan

Using Simple Ancestry to Deter Inbreeding for Persistent Genetic Algorithm Search

Job Shop Scheduling Problem (JSSP) Genetic Algorithms Critical Block and DG distance Neighbourhood Search

A Parallel Architecture for the Generalized Traveling Salesman Problem

Optimizing the Sailing Route for Fixed Groundfish Survey Stations

Lecture 6: Genetic Algorithm. An Introduction to Meta-Heuristics, Produced by Qiangfu Zhao (Since 2012), All rights reserved

Genetic Algorithm for Dynamic Capacitated Minimum Spanning Tree

AN EVOLUTIONARY APPROACH TO DISTANCE VECTOR ROUTING

Network Routing Protocol using Genetic Algorithms

DETERMINING MAXIMUM/MINIMUM VALUES FOR TWO- DIMENTIONAL MATHMATICLE FUNCTIONS USING RANDOM CREOSSOVER TECHNIQUES

CS5401 FS2015 Exam 1 Key

Algorithms & Complexity

Role of Genetic Algorithm in Routing for Large Network

CHAPTER 6 REAL-VALUED GENETIC ALGORITHMS

Encoding Techniques in Genetic Algorithms

A Parallel Architecture for the Generalized Travelling Salesman Problem: Project Proposal

Optimizing Flow Shop Sequencing Through Simulation Optimization Using Evolutionary Methods

Parallel Genetic Algorithm to Solve Traveling Salesman Problem on MapReduce Framework using Hadoop Cluster

Solving the Travelling Salesman Problem in Parallel by Genetic Algorithm on Multicomputer Cluster

Pre-requisite Material for Course Heuristics and Approximation Algorithms

Genetic Programming: A study on Computer Language

Reduce Total Distance and Time Using Genetic Algorithm in Traveling Salesman Problem

Genetic Algorithms with Oracle for the Traveling Salesman Problem

METAHEURISTICS. Introduction. Introduction. Nature of metaheuristics. Local improvement procedure. Example: objective function

Heuristic Optimisation

The Parallel Software Design Process. Parallel Software Design

Computational Intelligence

Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming. Genetic Programming

METHODS FOR REDUCING SEARCH AND EVALUATING FITNESS FUNCTIONS IN GENETIC ALGORITHMS FOR THE SNAKE-IN-THE-BOX PROBLEM JOSHUA DEEN GRIFFIN

Genetic Algorithm for Dynamic Capacitated Minimum Spanning Tree

Genetic Algorithms Variations and Implementation Issues

Introduction to Design Optimization: Search Methods

Multiobjective Job-Shop Scheduling With Genetic Algorithms Using a New Representation and Standard Uniform Crossover

Comparison of TSP Algorithms

Neural Network Weight Selection Using Genetic Algorithms

Evolution of a Path Generator for a Round-Trip Symmetric Traveling Salesperson Problem Using Genetic Programming

CS:4420 Artificial Intelligence

Genetic Algorithms. PHY 604: Computational Methods in Physics and Astrophysics II

TechTalk on Artificial Intelligence

A Comparative Study of Linear Encoding in Genetic Programming

A Genetic Algorithm Applied to Graph Problems Involving Subsets of Vertices

The Generalized Traveling Salesman Problem: A New Genetic Algorithm Approach

An Adaptive Hybrid Genetic-Annealing Approach

International Journal of Scientific & Engineering Research Volume 8, Issue 10, October-2017 ISSN

Optimal tree for Genetic Algorithms in the Traveling Salesman Problem (TSP).

A Genetic Algorithm for Graph Matching using Graph Node Characteristics 1 2

Search Algorithms for Regression Test Suite Minimisation

Shared Crossover Method for Solving Traveling Salesman Problem

Genetic Algorithms Presented by: Faramarz Safi (Ph.D.) Faculty of Computer Engineering Islamic Azad University, Najafabad Branch.

A More Stable Approach To LISP Tree GP

A HYBRID GENETIC ALGORITHM A NEW APPROACH TO SOLVE TRAVELING SALESMAN PROBLEM

Genetic Algorithm for Finding Shortest Path in a Network

Ar#ficial Intelligence

Planning and Search. Genetic algorithms. Genetic algorithms 1

Overview. FIT3094 AI, A-Life and Virtual Environments Assignment 2 - The Artificial, Aesthetic Evolution of Flowers

Genetic Algorithm Performance with Different Selection Methods in Solving Multi-Objective Network Design Problem

Adaptive Crossover in Genetic Algorithms Using Statistics Mechanism

Improved Genetic Algorithm to Solve Asymmetric Traveling Salesman Problem

Analysis of the impact of parameters values on the Genetic Algorithm for TSP

Geometric Semantic Genetic Programming ~ Theory & Practice ~

Homework 2: Search and Optimization

Transcription:

Introduction to Genetic Algorithms Genetic Algorithms We ve covered enough material that we can write programs that use genetic algorithms! More advanced example of using arrays Could be better written in most cases using objects

Evolution in Computers Genetic Algorithms most widely known work by John Holland Based on Darwinian Evolution In a competitive environment, strongest, most fit of a species survive, weak die Survivors pass their good genes on to offspring Occasional mutation Evolution in Computers Same idea as Darwinian Evolution Population of computer program / solution treated like biological organisms in a competitive environment Computer programs / solutions typically encoded as a bit string Survival Instinct have computer programs compete with one another in some environment, evolve with mutation and sexual recombination 2

The Simple Genetic Algorithm. Generate an initial random population of M individuals (i.e. programs or solutions) 2. Repeat for N generations. Calculate a numeric fitness for each individual 2. Repeat until there are M individuals in the new population. Choose two parents from the current population probabilistically based on fitness 2. Cross them over at random points, i.e. generate children based on parents. Mutate with some small probability. Put offspring into the new population Crossover Bit Strings: Genotype representing some phenotype Individual : 000000 Individual 2: 0000 New child : 00000 has characteristics of both parents, hopefully better than before Bit string can represent whatever we want for our particular problem; solution to a complex equation, logic problem, classification of some data, aesthetic art, music, etc.

Chromosome Examples Node Node 2 Node Output 0 6 5 0 2 5 2 2 29 2 Chromosome Examples Gen : A=FF[F[A+F[-FF-AFF]]]F Gen 5 : A=FF[F[A+F[-FF-+F[-FF-FFA[-]]]] Gen 7 : A= FF[F-[F[A+F[-[A][]]]][A+F[-F-A[]]]]F

Code Trees Do Samples for Computer Ant Turn-Right Do Do Turn-Right Code Trees - Crossover Do Turn-Right Do Turn-Right 5

Program Example The Traveling Salesman Problem (TSP) Member of a class of problems called NP- Complete Hard problems with no known polynomial time solution, only exponential time Other NP problems map to a NP-Complete problem in polynomial time, suggesting these are the hardest problems in the class NP-Complete problems are good candidates for applying genetic algorithms and approximation techniques Problem space too large to solve exhaustively Generally not guaranteed to solve the problem optimally Formal definition for the TSP Start with a graph G, composed of edges E and vertices V, e.g. the following has 5 nodes, 7 edges, and costs associated with each edge: 6 5 7 5 Find a loop (tour) that visits each node exactly once and whose total cost (sum of the edges) is the minimum possible 6

Easy on the graph shown on the previous slide; becomes harder as the number of nodes and edges increases 6 5 7 5 Adding two new edges results in five new paths to examine For a fully connected graph with n nodes, n! loops possible Impractical to search them all for more than about 25 nodes Excluding degenerate graphs, an exponential number of loops possible in terms of the number of nodes/edges 29 Node Traveling Salesperson Problem 29! = 8.8 trillion billion billion possible asymmetric routes. ASCI White, an IBM supercomputer being used by Lawrence Livermore National Labs to model nuclear explosions, is capable of 2 trillion operations per second (TeraFLOPS) peak throughput Assuming symmetric routes, ASCI White would take.7 billion years to exhaustively search the solution space 7

Genetic algorithms approximation for a solution Randomly generate a population of agents Each agent represents an entire solution, i.e. a random ordering of each node representing a loop Given nodes -6, we might generate 265 to represent the loop of visiting first, then 2, then, then 6, then 5, then, then back to Assign each agent a fitness value Fitness is just the sum of the edges in the loop; lower is more fit Evolve a new, hopefully better, generation of the same number of agents Select two parents randomly, but higher probability of selection if better fitness New generation formed by crossover and mutation Crossover Must combine parents in a way that preserves valid loops Typical cross method, but invalid for this problem Parent = 265 Parent 2 = 562 Child = 22 Child 2 = 5665 Use a form of order-preserving crossover: Parent = 265 Parent 2 = 562 Child = 265 Copy positions over directly from one parent, fill in from left to right from other parent if not already in the child Mutation Randomly swap nodes (may or may not be neighbors) 8

Run the program! Describe major components of the code If you re interested in more about genetic algorithms, there is a ton of information if you google genetic algorithms TSP Genetic Algorithm Cities Two arrays, holding X and Y coordinates of each city. 0 cities initially. Dim cityx(numcities - ) As Integer Dim cityy(numcities - ) As Integer Chromosome For each individual (initially 200 random ones) it is a list of all the cities we visit (0 to NUMCITIES-), in order e.g. population(0,0) = first city individual 0 visits population(0,) = second city individual 0 visits population(0,2) = third city individual 0 visits population(0,numcities-) = last city individual 0 visits population(,0) = first city individual visits population(,) = second city individual visits etc. Dim population(popsize -, NUMCITIES - ) 9

Chromosome Example cityx 0 0 5 50 75 0 2 cityy 50 60 5 95 5 0 2 population Individual 0 Individual Individual 2 Individual 0 2 2 2 2 0 0 0 Means individual 0 visits cities 0,,,2, at coordinates (0,50), (50,95), (75,5), (5,5), (0,60) then back to (0,50) TSP Genetic Algorithm Uses crossover and mutation described on previous slide Fitness is distance for each individual Hard-coded to run 000 generations, display the individual that has the shortest path each generation 0