Eight Queens Problem The problem is to place 8 queens on a chess board so that none of them can attack the other. A chess board can be considered a plain.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Algorithm Design Techniques
Local Search Algorithms
Genetic Algorithm.
Biologically Inspired Computing: Operators for Evolutionary Algorithms
8 Queens. Problem: Placing 8 queens on a chessboard such that they don’t attack each other Three different Prolog programs are suggessted as solutions.
Exact and heuristics algorithms
LOCAL SEARCH AND CONTINUOUS SEARCH. Local search algorithms  In many optimization problems, the path to the goal is irrelevant ; the goal state itself.
Case Study: Genetic Algorithms GAs are an area of AI research –used to solve search problems with potentially better performance than traditional search.
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
The N-Queens Problem lab01.
Eight queens puzzle. The eight queens puzzle is the problem of placing eight chess queens on an 8×8 chessboard such that none of them are able to capture.
Smallest Number Of Queens Another presentation by Domenic Acitelli.
Tuesday, May 14 Genetic Algorithms Handouts: Lecture Notes Question: when should there be an additional review session?
1 Lecture 8: Genetic Algorithms Contents : Miming nature The steps of the algorithm –Coosing parents –Reproduction –Mutation Deeper in GA –Stochastic Universal.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Data Mining CS 341, Spring 2007 Genetic Algorithm.
Local Search and Stochastic Algorithms Solution tutorial 4.
Evolutionary Algorithms Simon M. Lucas. The basic idea Initialise a random population of individuals repeat { evaluate select vary (e.g. mutate or crossover)
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
Local Search and Stochastic Algorithms
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Brandon Andrews.  What are genetic algorithms?  3 steps  Applications to Bioinformatics.
Genetic Algorithm.
© Negnevitsky, Pearson Education, CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University.
Vlad Furash & Steven Wine.  Problem surfaced in 1848 by chess player Max Bezzel as 8 queens (regulation board size)  Premise is to place N queens on.
Soft Computing Lecture 18 Foundations of genetic algorithms (GA). Using of GA.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Name / Mutlag Faisal AL-Ajme Id/ Name / Osama Khalaf AL-Friedy Id /
Informed search algorithms
The Generational Control Model This is the control model that is traditionally used by GP systems. There are a distinct number of generations performed.
Computational Complexity Jang, HaYoung BioIntelligence Lab.
EE459 I ntroduction to Artificial I ntelligence Genetic Algorithms Kasin Prakobwaitayakit Department of Electrical Engineering Chiangmai University.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
© Negnevitsky, Pearson Education, Lecture 9 Evolutionary Computation: Genetic algorithms Introduction, or can evolution be intelligent? Introduction,
Algorithms and their Applications CS2004 ( ) 13.1 Further Evolutionary Computation.
Artificial Intelligence for Games Online and local search
Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
Genetic Algorithms. The Basic Genetic Algorithm 1.[Start] Generate random population of n chromosomes (suitable solutions for the problem) 2.[Fitness]
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
CS 8625 High Performance Computing Dr. Hoganson Copyright © 2003, Dr. Ken Hoganson CS8625 Class Will Start Momentarily… CS8625 High Performance.
Local Search. Systematic versus local search u Systematic search  Breadth-first, depth-first, IDDFS, A*, IDA*, etc  Keep one or more paths in memory.
The n queens problem Many solutions to a classic problem: On an n x n chess board, place n queens so no queen threatens another.
N- Queens Solution with Genetic Algorithm By Mohammad A. Ismael.
Local Search Algorithms and Optimization Problems
The Standard Genetic Algorithm Start with a “population” of “individuals” Rank these individuals according to their “fitness” Select pairs of individuals.
Genetic Algorithms. Underlying Concept  Charles Darwin outlined the principle of natural selection.  Natural Selection is the process by which evolution.
Genetic Algorithm Dr. Md. Al-amin Bhuiyan Professor, Dept. of CSE Jahangirnagar University.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Genetic Algorithms and Evolutionary Programming A Brief Overview.
Constraints Satisfaction Edmondo Trentin, DIISM. Constraint Satisfaction Problems: Local Search In many optimization problems, the path to the goal is.
Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete"
 Negnevitsky, Pearson Education, Lecture 12 Hybrid intelligent systems: Evolutionary neural networks and fuzzy evolutionary systems n Introduction.
Genetic Algorithm (Knapsack Problem)
Using GA’s to Solve Problems
Genetic Algorithms.
MAE 552 Heuristic Optimization

Artificial Intelligence (CS 370D)
A More Realistic Example
Case Study: Genetic Algorithms
The n queens problem Many solutions to a classic problem:
Searching for solutions: Genetic Algorithms
The N-Queens Problem Search The N-Queens Problem Most slides from Milos Hauskrecht.
Local Search Algorithms
Beyond Classical Search
GA.
Presentation transcript:

Eight Queens Problem The problem is to place 8 queens on a chess board so that none of them can attack the other. A chess board can be considered a plain board with eight columns and eight rows.

Eight Queens Problem The possible cells that the Queen can move to when placed in a particular square are shaded Q

Eight Queens Problem Q Q Q Q QQ Q Q We need a scheme to denote the board’s position at any given time

Eight Queens Problem Now we need a fitness function, a function by which we can tell which board position is nearer to our goal. Since we are going to select best individuals at every step, we need to define a method to rate these board positions. One fitness function can be to count the number of Queens that do not attack others

Eight Queens Problem Fitness Function: Q1 can attack NONE Q2 can attack NONE Q3 can attack Q6 Q4 can attack Q5 Q5 can attack Q4 Q6 can attack Q5 Q7 can attack Q4 Q8 can attack Q5 Fitness = No of. Queens that can attack none Fitness = 2 Q3 Q2 Q6 Q5 Q7Q4 Q1 Q8

Eight Queens Problem Choose initial population of board configurations Evaluate the fitness of each individual (configuration) Choose the best individuals from the population for crossover

Eight Queens Problem Suppose the following individuals are chosen for crossover Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q 3

Eight Queens Problem Using Crossover Parents Children

Eight Queens Problem Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q Q 4 Q Q Q Q Q Q Q Q Q Q Q Q1Q1 Q Q Q Q

Eight Queens Problem Mutation, flip bits at random Q Q Q Q Q Q Q Q 4

Eight Queens Problem This process is repeated until an individual with required fitness level is found. If no such individual is found, then the process is repeated further until the overall fitness of the population or any of its individuals gets very close to the required fitness level. An upper limit on the number of iterations is usually put to end the process in finite time.

Eight Queens Problem Solution! Q Q Q Q Q Q Q Q

NoYes Start Initialize Population Evaluate Fitness of Population Solution Found? End Mate individuals in population Apply mutation