Problem Solving and Representation & Search Algorithms Flashcards

(33 cards)

1
Q

How do we represent and solve problems?

A
  1. Define the problem precisely.
  2. Isolate and represent.
  3. Choose algorithm and apply.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the key properties of problem representation?

A
  • Make important objects and relations explicit.
  • Suppress unimportant and irrelevant detail.
  • Expose natural constraints.
  • Concise - efficiently describe a given scenario.
  • Complete - everything necessary can be described.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T or F. FA model is an example of a problem representation model?

A

True.

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

Distinguish between state space and search tree.

A

The state space is the set of all valid states that can exist in our “problem universe”.
Search trees (used for search algorithms) corresponds to the sequence of paths that can be reached from a given start state.

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

What are the two important cost considerations in searching?

A

Search costs: The cost to find a solution.
Solution costs: The cost of a solution

Higher search costs (longer search) = lower solution costs.

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

Define the four metrics for comparing search methods.

A

Time Complexity
Space Complexity
Completeness: Is success guaranteed when possible.
Optimality: Is best solution guaranteed to be found.

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

What are the two categories of search strategies?

A

Uninformed Search: No problem-specific knowledge. Blind search.
Informed Search: Has problem-specific knowledge to influence search. Heuristic search.

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

Pseudocode for blind search. Note the differences between, breadth-first and depth-first.

A

visited.add(start) # changes
path = path + [start]

if start == goal:
return path

for succesor of node
if not visited
result = recursive_call(where start = neighbour)
if result exists:
return result

return None

Breath-First adds at end of queue.
Depth-First adds at start of queue

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

What is worst case time complexity and space complexity of BFS?

A

O(2^n) exponential for both

Note 2 is the number of successors of the root and n is the depth of the goal.

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

Talk about completeness and optimality for BFS.

A

Complete: Yes for finite depth.
Optimal: Yes when all step costs are identical otherwise No.

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

What is worst case and best case time complexity and space complexity of DFS?

A

Time:
Best: O(d) where d is the depth of the goal. Is in the first path we explore.

Worst: O(2^d) where 2 is the number of children of the root. We are assuming the goal is located on the far right at depth d.

Space:
Worst case: O(b * m) as we can reclaim space used by paths we can no longer extend further.

Best case: O(d)

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

Talk about completeness and optimality for DFS.

A

Complete: No unless we remove cycles.
Optimal: No

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

What is random queuing?

A

Uninformed search that places new nodes at random place in the queue just as likely to deepen as to broaden.

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

What is depth-limited search?

A

DFS that cannot go beyond certain depth.

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

What is iterative deepening DFS?

A

Executes DFS search with an increasing depth limit (2,3,4 …) until time runs out and program returns current best guess move.

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

Discuss time & space complexity, completeness and optimality with Iterative Deepening DFS and Depth Limited.

A

Iterative Deepning DFS:
Time: O(b^d)
Space: O(bd)
Complete: Yes when b is finite
Optimal: Yes when all step costs are identical.

Depth Limited:
Same but not complete or optimal.

17
Q

What is a heuristic function? What is a heuristic?

A

Scores a node in a search tree according to how close to the target / goal state it seems to be. Better heuristic = better estimate.

Set of rules that model how to achieve goal in function.

18
Q

What does h(n) = 0 mean?

A

n is a goal node

19
Q

Why are heuristics difficult?

A

They are problem specific, we can come up with many different heuristics for the same problem but coming up with the perfect one is challenging.

20
Q

What is greedy search?

A

“Best-first”
Expands node closest to the goal. Lowest heuristic.

21
Q

How does greedy search adapt the blind search algorithm?

A

It sorts the new paths according to the evaluation function before adding them to the queue.

22
Q

How does branch & bound search alter the blind search algorithm?

A

It adds the new paths to the queue and then sorts the entire queue.

23
Q

What is branch & bound search?

A

Always extend the least-cost partial path. Do this till you reach a goal you are likely to have found optimal solution. But to be certain extend all remaining paths until their path cost equals the optimal suspect.

24
Q

Explain f(n) = g(n) + h(n)

A

f(n) is total solution cost
g(n) is partial solution cost so far
h(n) is solution cost remaining

25
How can we solve the problem of choosing a wrong heuristic in B&B / A*? Give an example.
Conservative underestimates will never cause the optimal path to be overlooked. This is an admissible heuristic. The closer the underestimate to the true value the more efficient. E.g. In route planning, heuristic = straight line distance, actual value must be at least this.
26
Formally define admissible heuristic.
A heuristic h is admissible if: 0 <= h(n) <= h*(n) where h*(n) is the actual cost to a nearest goal.
27
How does A* build on B & B?
By improving efficiency. Recognises and removes redundant paths from the search queue.
28
State the dynamic programming principle.
In searching for the best path from some state S to some state G, you can ignore all paths from S to any intermediate state I, other than the minimum-length path from S to I.
29
How does A* alter B & B algorithm.
Before sorting the entire queue, if two or more paths reach a common state then delete all those paths except the one with minimum cost.
30
When is tree-search / graph-search version of A* more efficient?
Tree-search is optimal if A* is admissible. Graph search is optimal if A* is consistent.
31
T or F. All consistent heuristics are admissible.
True
32
T or F. All admissible heuristics are consistant.
False
33
Consistency check from A to C.
h(A) <= cost(A to C) + h(C)