Lecture 3 - Search Flashcards
General pattern for solving Sudoku?
1) select a square (→ Heuristics)
2) check all possibilities (→ Constraint Satisfaction)
3) propagate the information to other squares (write all possible numbers in all squares) (→ Constraint Propagation)
4) repeat these steps until the solution is complete (→ Search)
Steps in a search process?
1) Heuristics
2) Constraint Satisfaction
3) Constraint Propagation
4) Search
What do you need for defining a search problem?
1) A state description
(an abstract representation of the current state of a puzzle)
2) A goal function
(checks whether a state description satisfies the goal)
What is a “state description”?
- An abstract representation of the current state of a puzzle
What is the set of all “state descriptions” called?
State Space
What is a “goal function”?
- checks whether a state description satisfies the goal
Explain the two steps in Simple Exhaustive Search?
1) Generate all possible states
2) Test the goal function for each state
Explain the approach when performing Local Search (it is similar to solving a puzzle by hand)
- keep a single “current state”
- try to improve it by maximizing a heuristic evaluation
- using only “local” improvements aka “actions”
Explain the advantages and disadvantages with “local search”?
Advantages
- memory efficient
- fast in infinite state spaces
Disadvantages
- solution not always found aka no guarantees for
- does not ensure optimality (that the best/shortest solution is found)
State Representation
The image is an example of a state representation from mutilated chess board problem. Choosing a good state representation may be crucial for finding a good solution. How could a better state representation look?
-
What is this problem called and what is the challenge?
Mutilated Chess Board problem: Can you cover a mutilated chess board with dominoes
What constitutes the states in a 8-puzzle?
- The location of the tiles
8-puzzle actions
What computational actions in a 8-puzzle could not be done in the physical world?
- move blank tile (left, right, up, down)
Why is it better to simulate that the blank field moved when trying to solve a 8-puzzle?
Easier than having separate moves for each tile.
Ignore actions like unjamming slides if they get stuck
Why is the complete-state formulation in the 8-queens problem inefficient?
- There are to many states (any configuration of 8 queens on the board)
States in the 8-queens problem?
any configuration of 8 queens on the board
Actions in the 8-queens problem?
- Move one of the queens to another square
Explain the 8-queens problem
The eight queens puzzle isthe problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other; thus, a solution requires that no two queens share the same row, column, or diagonal. There are 92 solutions.
What is meant by heuristics in search algorithms?
- function that estimates the quality of a given state
Example of heuristics in way finding?
straight-line distances may be a good approximation for the true distances on a map
Basic idea of Heuristics in the n-queens problem
Move a queen so that it reduces the number of conflicts → heuristic h is # of queen pairs that attack each other.
Almost always solves n-queens problems almost instantaneously for very large n (e.g. n = 1 000 000)
How do simple search algorithms like hill-climbing search aka greedy local search work?
algorithm:
The hill climbing search algorithm does the following:
- expand the current state (generate all neighbors)
- move to the one with the highest evaluation
- until the evaluation goes down