L2 - Search Algorithms

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/59

flashcard set

Earn XP

Description and Tags

AI, States, nodes, trees, graphs, search algorithms, time complexity, space complexity, depth, state spaces, heuristics

60 Terms

1
New cards

What is meant by symbolic AI?

AI that uses logic-based rules and symbols

2
New cards

What is meant by stochastic AI?

AI that uses probability and randomness to make decisions, usually learning from data patterns

3
New cards

What is meant by AI winter?

A period of reduced interest, funding and development in AI research

4
New cards

What is meant by a state?

Representation of a physical configuration

5
New cards

What is meant by a node?

A data structure which is part of a search tree

6
New cards

What can a node include?

Parent, child, depth or path cost

7
New cards

What do states not include?

Parent, child, depth or path cost

8
New cards

What is the fringe for Depth First Search?

Last In, First Out


Travels as far as possible down a node, then moves to another

<p><strong>L</strong>ast<strong> I</strong>n<strong>, F</strong>irst<strong> O</strong>ut</p><p></p><p>Travels as far as possible down a node, then moves to another</p>
9
New cards

What is the fringe for Breadth First Search?

First In, First Out


Travels level by level

<p><strong>F</strong>irst <strong>I</strong>n, <strong>F</strong>irst <strong>O</strong>ut</p><p></p><p>Travels level by level</p>
10
New cards

What is a search strategy?

Picking the order of node expansion

11
New cards

What is meant by completeness in a search strategy?

If a solution exists, does the strategy always find it

12
New cards

What is meant by time complexity in a search strategy?

Amount of time an algorithm takes to run, as input size increases

13
New cards

What is meant by space complexity in a search strategy?

Maximum amount of memory used by an algorithm

14
New cards

What is meant by optimality?

Is the least-cost solution always found?

15
New cards

What is the first component that time and space complexity are measured in?

b - Max branching factor


(Max no.of successors a node can have)

16
New cards

What is the second component that time and space complexity are measured in?

d - depth of least-cost solution

17
New cards

What is the third component that time and space complexity are measured in?

m - max depth of state space


(Longest possible path, may be ∞)

18
New cards

What is meant by an uninformed search strategy?

Only the information available in the problem is used

19
New cards

What are the uninformed search strategies?

Breadth First

Depth First

Uniform Cost Search

Depth Limited

Iterative Deepening

Bidirectional

20
New cards

Which search component is denoted by the character, l?

Depth limit

21
New cards

Which search component is denoted by the character, C*?

Cost of optimal path

22
New cards

Is BFS complete?

Yes, if branching factor is infinite

23
New cards

What is the time complexity of BFS?

Exponential in depth limit

<p>Exponential in <strong>depth limit</strong></p>
24
New cards

What is the space complexity of BFS?

Keeps every node in memory

<p>Keeps every node in memory</p>
25
New cards

Is BFS optimal?

Yes


(If cost = 1 per step)

26
New cards

What is the problem with BFS?

Space complexity


Can generate nodes at 100MB/sec, so 24hrs = 8640GB

27
New cards

Is DFS complete?

No


Fails in infinite-depth and looped spaces

28
New cards

How do you deal with a DFS completeness issue?

Modify to avoid repeated states


Complete DFS in finite spaces

29
New cards

What is the time complexity of DFS?

Terrible if m > d

<p>Terrible if <strong>m </strong>&gt; <strong>d</strong></p>
30
New cards

In terms of time complexity, when can DFS be faster than BFS?

If the solutions are dense

31
New cards

What is the space complexity of DFS?

Linear space

<p>Linear space</p>
32
New cards

Is DFS optimal?

No.


Deep nodes may be discovered first

33
New cards

How can the issues with BFS and DFS be solved?

Limit depth

Iterative deepening

Heuristics

34
New cards

What are heuristics?

Rules of thumb that estimate the cost of reaching a goal

35
New cards

How does depth limited research work?

DFS with a depth limit, l

36
New cards

Diagram of iterative deepening search, where l = 3

Uses linear space and less time

<p>Uses linear space and less time</p>
37
New cards

Table of comparison of search algorithms

knowt flashcard image
38
New cards

What is graph search used to detect?

Loops

39
New cards

What is the first step in graph search?

A closed list is provided

40
New cards

What is the second step in graph search?

Before node is expanded, list is checked

41
New cards

What is the third step in graph search?

Existing nodes are skipped, non-existent nodes are added

42
New cards

Which is more efficient, graph or tree search?

Graph


(Can be exponentially more efficient)

43
New cards

What are the informed search algorithms?

Best-first, greedy, A*

44
New cards

What is the fringe for Best-First Search?

Queue sorted in a decreasing order of desirability

45
New cards

How does greedy search work?

Expands the lowest cost node

46
New cards

Which formula h(n) is used in greedy search?

Estimated cost from node, n, to the closest goal

47
New cards

Is greedy search complete?

No.


Can get stuck in loops

48
New cards

What is the time complexity of greedy search?

A good heuristic can improve it

<p>A good heuristic can improve it</p>
49
New cards

What is the space complexity of greedy search?

All nodes kept in memory

<p>All nodes kept in memory</p>
50
New cards

Is greedy search optimal?

No

51
New cards

How does A* search work?

Avoids nodes that are expensive

52
New cards

What is the formula for A* search?

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

53
New cards

What is represented by g(n) in the A* search formula?

Cost so far to reach n

54
New cards

What is represented by h(n) in the A* search formula?

Estimated cost to goal from n

55
New cards

What is represented by f(n) in the A* search formula?

Estimated total cost of path through n to goal

56
New cards

Diagram of A* search

knowt flashcard image
57
New cards
<p>Is A* search <strong>optimal</strong>?</p>

Is A* search optimal?

Yes, if the heuristic never overestimates the cost to reach the goal (admissible)

58
New cards

Is A* search complete?

Yes


Unless there are infinitely many nodes with f ≤ f (G)

59
New cards

What is time complexity of A* search?

Depends on quality of heuristic


Worst case - O(b^d)

60
New cards

What is space complexity of A* search?

Keeps all nodes in memory

<p>Keeps all nodes in memory</p>