Top Banner
1 Chapter 5 Advanced Search
34
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 Chapter 5 Advanced Search. 2 l  .

1

Chapter 5

Advanced Search

Page 2: 1 Chapter 5 Advanced Search. 2 l  .

2

http://www.franz.com/download

Page 3: 1 Chapter 5 Advanced Search. 2 l  .

3

Chapter 5 Contents

Constraint satisfaction problems Heuristic repair The eight queens problem Combinatorial optimization problems Local search Exchanging heuristics Iterated local search

Page 4: 1 Chapter 5 Advanced Search. 2 l  .

4

Chapter 5 Contents, continued

Simulated annealing Genetic algorithms Real time A* Iterative deepening A* Parallel search Bidirectional search Nondeterministic search Nonchronological backtracking

Page 5: 1 Chapter 5 Advanced Search. 2 l  .

5

Constraint Satisfaction Problems

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. It is also called CSP.

Can be solved using search. With many variables it is essential to use

heuristics.

Page 6: 1 Chapter 5 Advanced Search. 2 l  .

6

Different Approaches

1. An extremely simplistic approach to solving this kind of problem would be to analyze every possible configuration until one was found that matched the constraints.

2. Use proper search plus heuristic.

Page 8: 1 Chapter 5 Advanced Search. 2 l  .

8

Backtracking Search

Backtracking is a process where steps are taken towards the final solution and the details are recorded. 

If these steps do not lead to a solution some or all of them may have to be retraced and the relevant details discarded. 

In theses circumstances it is often necessary to search through a large number of possible situations in search of feasible solutions.

Page 9: 1 Chapter 5 Advanced Search. 2 l  .

9

Heuristic Repair

A heuristic method for solving constraint satisfaction problems.

Generate a possible solution, and then make small changes to bring it closer to satisfying constraints.

Page 10: 1 Chapter 5 Advanced Search. 2 l  .

10

The Eight Queens Problem

A constraint satisfaction problem: 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.

Heuristic repair is very efficient at solving this problem.

Page 11: 1 Chapter 5 Advanced Search. 2 l  .

11

Heuristic Repair for The Eight Queens Problem

Initial state – one queen is conflicting with another.

We’ll now move that queen to the square with the fewest conflicts.

Page 12: 1 Chapter 5 Advanced Search. 2 l  .

12

Heuristic Repair for The Eight Queens Problem

Second state – now the queen on the f column is conflicting, so we’ll move it to the square with fewest conflicts.

Page 13: 1 Chapter 5 Advanced Search. 2 l  .

13

Heuristic Repair for The Eight Queens Problem

Final state – a solution!

Page 14: 1 Chapter 5 Advanced Search. 2 l  .

14

Local Search

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.

Page 15: 1 Chapter 5 Advanced Search. 2 l  .

15

Tabu search

Tabu search is a metaheuristic that uses a list of state that have already been visited to attempt to avoid repeating paths – even going down hill to search a path seemingly a very bad choice.

Therefore, it might be able to avoid local maxima.

Page 16: 1 Chapter 5 Advanced Search. 2 l  .

16

Example

1. In hill-climbing 2. Dr. Edward de Bono, founder of the

Cognitive Research Trust in Cambridge. When the following two pieces of plastic

are given to someone with the instructions that they be arranged in a shape that can easily be described, the pieces always get arranged as shown to give a rectangle.

Page 17: 1 Chapter 5 Advanced Search. 2 l  .

17

Page 18: 1 Chapter 5 Advanced Search. 2 l  .

18

Page 19: 1 Chapter 5 Advanced Search. 2 l  .

19

Page 20: 1 Chapter 5 Advanced Search. 2 l  .

20

Page 21: 1 Chapter 5 Advanced Search. 2 l  .

21

http://www.tabusearch.net/

http://www.tabusearch.net/tabu_search/what_is_tabu_search.asp

Page 22: 1 Chapter 5 Advanced Search. 2 l  .

22

Exchanging Heuristics

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.

Page 23: 1 Chapter 5 Advanced Search. 2 l  .

23

Iterated Local Search

A local search is applied repeatedly from different starting states.

Attempts to avoid finding local maxima.

Useful in cases where the search space is extremely large, and exhaustive search will not be possible.

Page 24: 1 Chapter 5 Advanced Search. 2 l  .

24

Ant Colony Optimization - ACO

Foraging ants leave a trail of pheromones so that they can lead other ants to find the food that they have found.

http://iridia.ulb.ac.be/%7Eants/ants2004/index.html

Page 25: 1 Chapter 5 Advanced Search. 2 l  .

25

Simulated Annealing

1. Annealing - To heat and then cool usually for softening and rendering less brittle, gradual cooling being required for some materials (as steel and glass) but not for others (as copper and brass)

2. Simulated Annealing - Based on metropolis Monte Carlo Simulation.

Aims at obtaining a minimum value for some function of a large number of variables. This value is known as the energy of the system.

Page 26: 1 Chapter 5 Advanced Search. 2 l  .

26

Simulated Annealing (2)

A random start state is selected A small random change is made.

If this change lowers the system energy, it is accepted.

If it increases the energy, it may be accepted, depending on a probability called the Boltzmann acceptance criteria:– e(-dE/T)

Page 27: 1 Chapter 5 Advanced Search. 2 l  .

27

Simulated Annealing (3)

– e(-dE/T)

T is the temperature of the system, and dE is the change in energy.

When the process starts, T is high, meaning increases in energy are relatively likely to happen.

Over successive iterations, T lowers and increases in energy become less likely.

Page 28: 1 Chapter 5 Advanced Search. 2 l  .

28

Simulated Annealing (4)

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.

Page 29: 1 Chapter 5 Advanced Search. 2 l  .

29

Genetic Algorithms

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.

Page 30: 1 Chapter 5 Advanced Search. 2 l  .

30

Iterative Deepening A*

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

Works well if there are only a few possible values for f(n).

The method is complete, and has a low memory requirement, like depth-first search.

Page 31: 1 Chapter 5 Advanced Search. 2 l  .

31

Parallel Search

Some search methods can be easily split into tasks which can be solved in parallel.

Important concepts to consider are: Task distribution Load balancing Tree ordering

Page 32: 1 Chapter 5 Advanced Search. 2 l  .

32

Bidirectional Search

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.

Page 33: 1 Chapter 5 Advanced Search. 2 l  .

33

Nondeterministic Search

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.

Page 34: 1 Chapter 5 Advanced Search. 2 l  .

34

Nonchronological backtracking

Depth first search uses chronological backtracking. 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.