CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Power of Heuristic; non- conventional search.

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture– 4, 5, 6: A* properties 9 th,10 th and 12 th January,
1 Heuristic Search Chapter 4. 2 Outline Heuristic function Greedy Best-first search Admissible heuristic and A* Properties of A* Algorithm IDA*
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.
COMP305. Part II. Genetic Algorithms. Genetic Algorithms.
Intro to AI Genetic Algorithm Ruth Bergman Fall 2002.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–2,3: A* 3 rd and 5 th January, 2012.
CSC344: AI for Games Lecture 4: Informed search
Intro to AI Genetic Algorithm Ruth Bergman Fall 2004.
Class of 28 th August. Announcements Lisp assignment deadline extended (will take it until 6 th September (Thursday). In class. Rao away on 11 th and.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Genetic Algorithm.
Evolutionary Intelligence
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Monotonicity 13 th Jan, 2011.
CS 484 – Artificial Intelligence1 Announcements Lab 3 due Tuesday, November 6 Homework 6 due Tuesday, November 6 Lab 4 due Thursday, November 8 Current.
Informed search algorithms
Informed search algorithms
CS 344 Artificial Intelligence By Prof: Pushpak Bhattacharya Class on 15/Jan/2007.
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
An Introduction to Genetic Algorithms Lecture 2 November, 2010 Ivan Garibay
Genetic Algorithms Siddhartha K. Shakya School of Computing. The Robert Gordon University Aberdeen, UK
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
1 Genetic Algorithms K.Ganesh Introduction GAs and Simulated Annealing The Biology of Genetics The Logic of Genetic Programmes Demo Summary.
Evolutionary Computation: Genetic Algorithms Copying ideas of Nature Madhu, Natraj,
Edge Assembly Crossover
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
CSC3203: AI for Games Informed search (1) Patrick Olivier
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Informed Search II CIS 391 Fall CIS Intro to AI 2 Outline PART I  Informed = use problem-specific knowledge  Best-first search and its variants.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 2 - Search.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 13– Search 17 th August, 2010.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3 - Search.
CS344: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 17– Theorems in A* (admissibility, Better performance.
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.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lectures 18, 19, 20– A* Monotonicity 2 nd, 6 th and 7 th September, 2010.
CS344: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 1 to 8– Introduction, Search, A* (has the associated lab course: CS386)
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.
CS621: Artificial Intelligence
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 3: Search, A*
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal Evolutionary Computation.
Genetic Algorithm(GA)
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
Chapter 14 Genetic Algorithms.
Genetic Algorithms.
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
An evolutionary approach to solving complex problems
Artificial Intelligence (CS 370D)
CS621: Artificial Intelligence
Discussion on Greedy Search and A*
Discussion on Greedy Search and A*
CS 4100 Artificial Intelligence
CS621: Artificial Intelligence
CS621: Artificial Intelligence
Boltzmann Machine (BM) (§6.4)
CSE 473 University of Washington
Searching for solutions: Genetic Algorithms
Heuristic Search Generate and Test Hill Climbing Best First Search
CS621: Artificial Intelligence
Presentation transcript:

CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 5: Power of Heuristic; non- conventional search

A*: Definitions and Properties

A* Algorithm – Definition and Properties f(n) = g(n) + h(n) The node with the least value of f is chosen from the OL. f*(n) = g*(n) + h*(n), where, g*(n) = actual cost of the optimal path (s, n) h*(n) = actual cost of optimal path (n, g) g(n) ≥ g*(n) By definition, h(n) ≤ h*(n) S s n goal State space graph G g(n) h(n)

8-puzzle: heuristics sng Example: 8 puzzle h*(n) = actual no. of moves to transform n to g 1.h 1 (n) = no. of tiles displaced from their destined position. 2.h 2 (n) = sum of Manhattan distances of tiles from their destined position. h 1 (n) ≤ h*(n) and h 1 (n) ≤ h*(n) h* h2h2 h1h1 Comparison

Admissibility: An algorithm is called admissible if it always terminates and terminates in optimal path Theorem: A* is admissible. Lemma: Any time before A* terminates there exists on OL a node n such that f(n) <= f*(s) Observation: For optimal path s → n 1 → n 2 → … → g, 1.h*(g) = 0, g*(s)=0 and 2.f*(s) = f*(n 1 ) = f*(n 2 ) = f*(n 3 )… = f*(g) A* Algorithm- Properties

f*(n i ) = f*(s),n i ≠ s and n i ≠ g Following set of equations show the above equality: f*(n i ) = g*(n i ) + h*(n i ) f*(n i+1 ) = g*(n i+1 ) + h*(n i+1 ) g*(n i+1 ) = g*(n i ) + c(n i, n i+1 ) h*(n i+1 ) = h*(n i ) - c(n i, n i+1 ) Above equations hold since the path is optimal. A* Properties (contd.)

Admissibility of A* A* always terminates finding an optimal path to the goal if such a path exists. Intuition S g(n) n h(n) G (1) In the open list there always exists a node n such that f(n) <= f*(S). (2) If A* does not terminate, the f value of the nodes expanded become unbounded. 1) and 2) are together inconsistent Hence A* must terminate

Lemma Any time before A* terminates there exists in the open list a node n' such that f(n') <= f*(S) S n1n1 n2n2 G Optimal path For any node n i on optimal path, f(n i ) = g(n i ) + h(n i ) <= g*(n i ) + h*(n i ) Also f*(n i ) = f*(S) Let n' be the fist node in the optimal path that is in OL. Since all parents of n' have gone to CL, g(n') = g*(n') and h(n') <= h*(n') => f(n') <= f*(S)

If A* does not terminate Let e be the least cost of all arcs in the search graph. Then g(n) >= e.l(n) where l(n) = # of arcs in the path from S to n found so far. If A* does not terminate, g(n) and hence f(n) = g(n) + h(n) [h(n) >= 0] will become unbounded. This is not consistent with the lemma. So A* has to terminate.

2 nd part of admissibility of A* The path formed by A* is optimal when it has terminated Proof Suppose the path formed is not optimal Let G be expanded in a non-optimal path. At the point of expansion of G, f(G) = g(G) + h(G) = g(G) + 0 > g*(G) = g*(S) + h*(S) = f*(S) [f*(S) = cost of optimal path] This is a contradiction So path should be optimal

Better Heuristic Performs Better

Theorem A version A 2 * of A* that has a “better” heuristic than another version A 1 * of A* performs at least “as well as” A 1 * Meaning of “better” h 2 (n) > h 1 (n) for all n Meaning of “as well as” A 1 * expands at least all the nodes of A 2 * h*(n) h 2 *(n) h 1 *(n) For all nodes n, except the goal node

Proof by induction on the search tree of A 2 *. A* on termination carves out a tree out of G Induction on the depth k of the search tree of A 2 *. A 1 * before termination expands all the nodes of depth k in the search tree of A 2 *. k=0. True since start node S is expanded by both Suppose A 1 * terminates without expanding a node n at depth (k+1) of A 2 * search tree. Since A 1 * has seen all the parents of n seen by A 2 * g 1 (n) <= g 2 (n) (1)

k+1 S G Since A 1 * has terminated without expanding n, f 1 (n) >= f*(S) (2) Any node whose f value is strictly less than f*(S) has to be expanded. Since A 2 * has expanded n f 2 (n) <= f*(S) (3) From (1), (2), and (3) h 1 (n) >= h 2 (n) which is a contradiction. Therefore, A 1 * has to expand all nodes that A 2 * has expanded. Exercise If better means h 2 (n) > h 1 (n) for some n and h 2 (n) = h 1 (n) for others, then Can you prove the result ?

A list of AI Search Algorithms A* AO* IDA* (Iterative Deepening) Minimax Search on Game Trees Viterbi Search on Probabilistic FSA Hill Climbing Simulated Annealing Gradient Descent Stack Based Search Genetic Algorithms Memetic Algorithms

Evolutionary search: Genetic and Memetic Algoritms

Evolution – Fundamental Laws Survival of the fittest. Change in species is due to change in genes over reproduction or/and due to mutation. An Example showing the concept of survival of the fittest and reproduction over generations.

Evolutionary Computation Evolutionary Computation (EC) refers to computer-based problem solving systems that use computational models of evolutionary process. Terminology: Chromosome – It is an individual representing a candidate solution of the optimization problem. Population – A set of chromosomes. gene – It is the fundamental building block of the chromosome, each gene in a chromosome represents each variable to be optimized. It is the smallest unit of information. Objective: To find a best possible chromosome to a given optimization problem.

Evolutionary Algorithm: A meta-heuristic Let t = 0 be the generation counter; create and initialize a population P(0); repeat Evaluate the fitness, f(x i ), for all x i belonging to P(t); Perform cross-over to produce offspring; Perform mutation on offspring; Select population P(t+1) of new generation; Advance to the new generation, i.e., t = t+1; until stopping condition is true;

On Overview of GAs GA emulate genetic evolution. A GA has distinct features: A string representation of chromosomes. A selection procedure for initial population and for off- spring creation. A cross-over method and a mutation method. A fitness function be to minimized. A replacement procedure. Parameters that affect GA are initial population, size of the population, selection process and fitness function.

Anatomy of GA

Selection Selection is a procedure of picking parent chromosome to produce off-spring. Types of selection: Random Selection – Parents are selected randomly from the population. Proportional Selection – probabilities for picking each chromosome is calculated as: P(x i ) = f(x i ) /Σ f(x j )for all j Rank Based Selection – This method uses ranks instead of absolute fitness values. P(x i ) = (1/β)(1 – e r(x i ) )

Roulette Wheel Selection Let i = 1, where i denotes chromosome index; Calculate P(x i ) using proportional selection; sum = P(x i ); choose r ~ U (0,1); while sum < r do i = i + 1; i.e. next chromosome sum = sum + P(x i ); end return x i as one of the selected parent; repeat until all parents are selected

Reproduction Reproduction is a processes of creating new chromosomes out of chromosomes in the population. Parents are put back into population after reproduction. Cross-over and Mutation are two parts in reproduction of an off-spring. Cross-over : It is a process of creating one or more new individuals through the combination of genetic material randomly selected from two or parents.

Cross-over Uniform cross-over : where corresponding bit positions are randomly exchanged between two parents. One point : random bit is selected and entire sub-string after the bit is swapped. Two point : two bits are selected and the sub- string between the bits is swapped. Uniform Cross-over One point Cross-over Two point Cross-over Parent1 Parent Off-spring1 Off-spring

Mutation Mutation procedures depend upon the representation schema of the chromosomes. This is to prevent falling all solutions in population into a local optimum. For a bit-vector representation: random mutation : randomly negates bits in-order mutation : performs random mutation between two randomly selected bit position. Random Mutation In-order Mutation Before mutation After mutation