Chapter 5 Advanced Search 1 Chapter 5 Contents

  • Slides: 22
Download presentation
Chapter 5 Advanced Search 1

Chapter 5 Advanced Search 1

Chapter 5 Contents l l l l Constraint satisfaction problems Heuristic repair The eight

Chapter 5 Contents l l l l Constraint satisfaction problems Heuristic repair The eight queens problem Combinatorial optimization problems Local search Exchanging heuristics Iterated local search 2

Chapter 5 Contents, continued l l l l Simulated annealing Genetic algorithms Real time

Chapter 5 Contents, continued l l l l Simulated annealing Genetic algorithms Real time A* Iterative deepening A* Parallel search Bidirectional search Nondeterministic search Nonchronological backtracking 3

Constraint Satisfaction Problems l l Combinatorial optimization problems involve assigning values to a number

Constraint Satisfaction Problems l l Combinatorial optimization problems involve assigning values to a number of variables. A constraint satisfaction problem is a combinatorial optimization problem with a set of constraints. Can be solved using search. With many variables it is essential to use heuristics. 4

Heuristic Repair A heuristic method for solving constraint satisfaction problems. l Generate a possible

Heuristic Repair A heuristic method for solving constraint satisfaction problems. l Generate a possible solution, and then make small changes to bring it closer to satisfying constraints. l 5

The Eight Queens Problem l A constraint satisfaction problem: n Place eight queens on

The Eight Queens Problem l A constraint satisfaction problem: n Place eight queens on a chess board so that no two queens are on the same row, column or diagonal. Can be solved by search, but the search tree is large. l Heuristic repair is very efficient at solving this problem. l 6

Heuristic Repair for The Eight Queens Problem l l Initial state – one queen

Heuristic Repair for The Eight Queens Problem l l Initial state – one queen is conflicting with another. We’ll now move that queen to the square with the fewest conflicts. 7

Heuristic Repair for The Eight Queens Problem l Second state – now the queen

Heuristic Repair for The Eight Queens Problem l Second state – now the queen on the f column is conflicting, so we’ll move it to the square with fewest conflicts. 8

Heuristic Repair for The Eight Queens Problem l Final state – a solution! 9

Heuristic Repair for The Eight Queens Problem l Final state – a solution! 9

Local Search l l l Like heuristic repair, local search methods start from a

Local Search l l l Like heuristic repair, local search methods start from a random state, and make small changes until a goal state is achieved. Local search methods are known as metaheuristics. Most local search methods are susceptible to local maxima, like hill-climbing. 10

Exchanging Heuristics l l l A simple local search method. Heuristic repair is an

Exchanging Heuristics l l l A simple local search method. Heuristic repair is an example of an exchanging heuristic. Involves swapping two or more variables at each step until a solution is found. A k-exchange involves swapping the values of k variables. Can be used to solve the traveling salesman problem. 11

Iterated Local Search A local search is applied repeatedly from different starting states. l

Iterated Local Search A local search is applied repeatedly from different starting states. l Attempts to avoid finding local maxima. l Useful in cases where the search space is extremely large, and exhaustive search will not be possible. l 12

Simulated Annealing l l l A method based on the way in which metal

Simulated Annealing l l l A method based on the way in which metal is heated and then cooled very slowly in order to make it extremely strong. Based on metropolis Monte Carlo Simulation. Aims at obtaining a minimum value for some function of a large number of variables. n This value is known as the energy of the system. 13

Simulated Annealing (2) A random start state is selected l A small random change

Simulated Annealing (2) A random start state is selected l A small random change is made. l n If this change lowers the system energy, it is accepted. n If it increases the energy, it may be accepted, depending on a probability called the Boltzmann acceptance criteria: – e(-d. E/T) 14

Simulated Annealing (3) – e(-d. E/T) T is the temperature of the system, and

Simulated Annealing (3) – e(-d. E/T) T is the temperature of the system, and d. E is the change in energy. l When the process starts, T is high, meaning increases in energy are relatively likely to happen. l Over successive iterations, T lowers and increases in energy become less likely. l 15

Simulated Annealing (4) l l l Because the energy of the system is allowed

Simulated Annealing (4) l l l Because the energy of the system is allowed to increase, simulated annealing is able to escape from global minima. Simulated annealing is a widely used local search method for solving problems with very large numbers of variables. For example: scheduling problems, traveling salesman, placing VLSI (chip) components. 16

Genetic Algorithms l l A method based on biological evolution. Create chromosomes which represent

Genetic Algorithms l l A method based on biological evolution. Create chromosomes which represent possible solutions to a problem. The best chromosomes in each generation are bred with each other to produce a new generation. Much more detail on this later. 17

Iterative Deepening A* A* is applied iteratively, with incrementally increasing limits on f(n). l

Iterative Deepening A* A* is applied iteratively, with incrementally increasing limits on f(n). l Works well if there are only a few possible values for f(n). l The method is complete, and has a low memory requirement, like depthfirst search. l 18

Parallel Search Some search methods can be easily split into tasks which can be

Parallel Search Some search methods can be easily split into tasks which can be solved in parallel. l Important concepts to consider are: l n Task distribution n Load balancing n Tree ordering 19

Bidirectional Search l l l Also known as wave search. Useful when the start

Bidirectional Search l l l Also known as wave search. Useful when the start and goal are both known. Starts two parallel searches – one from the root node and the other from the goal node. Paths are expanded in a breadth-first fashion from both points. Where the paths first meet, a complete and optimal path has been formed. 20

Nondeterministic Search l l Useful when very little is known about the search space.

Nondeterministic Search l l Useful when very little is known about the search space. Combines the depth first and breadth first approaches randomly. Avoids the problems of both, but does not necessarily have the advantages of either. New paths are added to the queue in random positions, meaning the method will follow a random route through the tree until a solution is found. 21

Nonchronological backtracking l Depth first search uses chronological backtracking. n l Does not use

Nonchronological backtracking l Depth first search uses chronological backtracking. n l Does not use any additional information to make the backtracking more efficient. Nonchronological backtracking involves going back to forks in the tree that are more likely to offer a successful solution, rather than simply going back to the next unexplored path. 22