Search Flashcards

1
Q

Defining a state space

A

When solving a problem, we start by defining what each “state” looks like and how states transition from one to another. Each state represents a possible configuration of the problem at a particular point in time. Basically the set of all possible configurations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Pruning strategies

A

Systematically eliminate certain states from consideration to reduce search space and improve efficiency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Search strategies

A

Strategies for deciding how to explore the state space. Different strategies determine the order in which states are considered

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Navigating the Frontier

A

In search algorithms, the “frontier” is the set of states that are ready to be explored next. For ex. BFS, states are explored layer by layer, while DFS, states are explored by diving deep into one path before backtracking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Search Heuristics

A

guide the search process by estimating how close a given state is to the goal. Heuristics help the search algorithm to be more efficient

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Completeness

A

Will the search always find a solution of a solution exits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Optimality

A

Will the search always fin the least cost solution if actions have cost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Time Complexity

A

What is the maximum number of nodes that can be expanded or generated

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Space Complexity

A

What is the maximum number of nodes that have to be stored in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Uninformed Search strategies

A

-Adopt a fixed fule for choosing the next state to be expanded.
- They don’t take into account any domain specific information about a specific search problem
- Ex. BFS, uniform-cost, DFS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Uniform Cost search

A

BFS but frontier is sorted in increasing cost of the path. It always expands the least cost node

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Dept limited search

A

DFS but to a pre-specified depth limit L. No node over L steps is on the frontier.
This eliminates infinite length paths problem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Iterative deepening search

A

Dept limit search but starting at depth limit L=0 and iteratively increase the depth limit, doing a DLS for each depth limit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Cycle Checking/ Path checking

A

Ensure that the state c is not equal to the state reached by any ancestor of c along this path

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

merit of a frontier node

A

A measure that helps decide the order in which nodes should be expanded
- “Cost of solution” notion of merit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Greedy best-first search

A

Greedily trying to achieve a low cost solution

17
Q

h(n)

A

heuristic estimate of the cost of getting to a goal node from n
- it is always an underestimates of the true cost

18
Q

A* search

A

Always expand the node with lowest f-value on the frontier
f(n)= g(n) + h(n)
g(n) is the cost of the path to node n
h(n) is the heuristic estimate of the cost of getting to a goal node from n

19
Q

Monotone consistent Heuristic

A

h(n1) <= c(n1->n2) + h(n2)
c(n1->n2) is the actual of the step from n1 to n2
-Monotonicity implies admissibility

20
Q

Local Search

A

This algorithm operate using a single Current State and generally move to neighbours of that state

21
Q

Why search

A

Successful: in game playing, and other AI problems can be solved
Practical: Useful in approximation

22
Q

What search show

A

Search only shows how to solve the problem once we have it correctly formulated

23
Q

TreeSearch

A

TreeSearch(Frontier, Successors, Goal?)

24
Q

BFS time complexity

A

O(b^(d+1)

25
Q

Admissibility

A

idea of h(n) understating the true cost
h(n) <= h*(n)

26
Q

Suduko_bruteforce

A

?- game(easy, Ls), solve(Ls).

Looks for the possible choices for each slot, then uses the first choice, then back tracks

  • only one solution
27
Q

Sudoku_forward

A

Removing choices. If the guess does not conflict with the guesses for previous cells, it advances(forwarded)

28
Q

Sudoku_dynamic

A

Chooses the choices with fewer choices available
This is pruning

29
Q

World_path

A

Changes one letter at a time to go from start word to finish word. word_path(horse, mouse, Ps).
Ps= [horse, morse, mouse] ;
ps=[horse, morse, moise, mouse];
ps=[horse, morse, moise, moose, mouse];
Ps=[horse, morse, moose, mouse];

30
Q

Pigeon-hole: Heuristics_Sudoku(Forcing a choice

A

For all slots in a group with slot S except for S are marked are not possible for X. Therefore, slot S must be X.

Imagine you have several places to put a number, but all spots except one are already ruled out for that number.
The only spot left must then hold that number because there are no other options.

31
Q

Eliminating Choices

A

In/Out:
The main idea: If a number can’t go anywhere else in the “Out” group, it must go in a shared slot, meaning Slot S can’t be that number. Slot S is in one group not the other
exact Cover: If a group of slots will cover certain numbers exactly, then Slot S can’t use those numbers.

32
Q

Word_trail

A

Swapping two letters or change one letter
swap_letters_in_world(barber, W).
First letter swapped with second letter, first letter swapped with third letter…..
second letter swapped with third letter…

word_trail(Cat, dog, Trail).
Trail= [cat, cot, dot, dog]

33
Q

bagof(W, swap_letter_in_word(barber,W), Ws)

A

Ws= list of all swaps

34
Q

bagof(W, swap_letter_in_word(barber,W), Ws), length(Ws, L)

A

output length

35
Q
A