Year 2 Term 1 Exams Flashcards
What are the 3 problem types of blind search?
Single-state problem, Sensorless problem, Contingency problem
What are the characteristics of single-state problems?
Deterministic & fully observable: Agent will base decisions solely on its state and doesn’t consider the sequence
What are the characteristics of sensorless problems?
Non-observable: Innovative approaches required to compensate for lack of sensory input
What are the characteristics of contingency problems?
Non-deterministic &/or partially observable: Agent may adjust action according to new information about current state
What dimensions are search strategies evaluated on?
Completeness, Time Complexity, Space Complexity, Optimality
In BFS, are nodes added to the start or end of the queue?
The end
BFS completeness, time complexity, space complexity, and optimality
Complete: Yes - if b and d are finite
Time Complexity: O(b^(d+1))
Space: O(b^(d+1))
Optimality: Yes - if step costs don’t vary
Summarise the dimensions of BFS
Space complexity is terrible as every node is kept in memory
In DFS, are nodes added to the start or end of the queue?
The start
DFS completeness, time complexity, space complexity, and optimality
Complete: Yes - if b and d are finite
Time Complexity: O(b^m) - m is max depth
Space: O(bm)
Optimality: No
Summarise the dimensions of DFS
Good space complexity but not optimal
DLS completeness, time complexity, space complexity, and optimality
Complete: Maybe - if solution is shallower than n
Time Complexity: O(b^n)
Space: O(bn)
Optimality: No
Summarise the dimensions of DLS
Not complete or optimal
IDS completeness, time complexity, space complexity, and optimality
Complete: Yes
Time Complexity: O(b^d) - unexpectedly okay
Space: O(bd)
Optimality: Yes
Graph search’s use
Incorporated into BFS as it stores all searched nodes
Detects repeated states, preventing linear problems turning into exponential ones
What is bidirectional search?
Two BFS or IDS searches start from the initial state and goal state
Reduces time complexity from b^d to 2b^(d/2)
What do evaluation functions do in search?
Finds the most desirable node to expand
Greedy Best-First Search completeness, time complexity, space complexity, and optimality
Complete: No - only considers next nodes, so may prematurely conclude which path is best
Time Complexity: O(b^m)
Space: O(b^m)
Optimality: No
Summarise the dimensions of Greedy Best-First Search
Bad space complexity, and not complete or optimal as the greedy nature may see it take suboptimal paths
What makes a good heuristic?
Admissibility (validity), Consistency, Informative, Domain-Specific Knowledge, Simplicity & Efficiency
What’s an admissible heuristic?
One that never overestimates the cost to reach the goal state
What’s a consistent heuristic?
One that’s cost to neighbour state to goal state is not less than the cost to goal state
What’s an informative heuristic?
One that differentiates between promising and less promising paths
What’s a heuristic that has domain-specific knowledge?
One that considers processing time and the dependencies of tasks
Whats a simple and efficient heuristic?
One that is easy to compute
How is A* Search different to Greedy Best-First Search?
It considers the next step in advance
A* Search completeness, time complexity, space complexity, and optimality
Complete: Yes - for finite graphs with finite branching factors
Time Complexity: O(b^m)
Space: O(b^m) - worse than greedy best-first search
Optimality: Yes - if admissible and consistent
Describe the optimality of A* Search in 3 steps
1) evaluation function f(n) is non-decreasing, so the estimated cost will be the same or increase
2) therefore, the node sequence is in non-decreasing order of f(n)
3) so, the first goal to be selected for expansion must be an optimal solution
What is a state space?
The set of all configurations/states the problem can exist in
What’s the premise of local-search algorithms?
They keep a current state and explore neighbouring states and evaluate if they’re closer to the goal state
What are the 4 steps of hill-climbing search
1) Initialisation: start with an initial state
2) Evaluation: evaluate the state using an objective function
3) Neighbour Generation: generate neighbouring solutions by making small changes to the current state
4) Selection: select the neighbour solution that provides the biggest improvement in the objective function
What’s the problem with hill-climbing search?
It can get stuck in local maxima, making the search not optimal
What techniques can be used to reach the global maxima in hill-climbing search?
Simulated Annealing, Local Beam
How does simulated annealing search work?
To escape local maxima, allow some ‘bad’ moves but gradually decrease their likelihood. The slower T decreases, the greater the chance of finding the global maxima
How does local beam search work?
Keep track of k states rather than one and select the k best successors until one is a goal state. This can however become narrowly focused in a small region of the search space
Describe the process of genetic algorithms
Each state is represented as a string over a finite alphabet
A fitness function determines the quality of each state
A successor state is produced by combining two parent states
What 3 steps are used to create the next generation of states in genetic algorithms?
1) Selection: states are chosen based on fitness
2) Crossover: genetic information is combined to create offspring
3) Mutation: offspring’s genetic information is subtley, randomly changed to promote diversity
How are constraint satisfaction problems better than greedy best-first search or A* search?
GBFS and A* don’t necessarily make the best move, they just improve the quality of the state. CSPs look inside the state, giving us stronger heuristics to determine where to go
What 3 CSP constraints are there?
Unary constraint: involves a single variable
Binary constraint: involves pairs of variables
Higher-order constraint: involves 3 or more variables
What are constraint graphs?
A graph where nodes are variables and edges are the constraints shared by the variables
What are the 3 CSP states and what do they entail?
Initial state: the empty assignment
Successor function: a value is assigned to an unassigned variable such that there are no conflicts with any constraints
Goal test: the assignment is complete
What type of search do we use for CSPs? Give 3 reasons why
DFS:
We don’t need the path
All solutions are at depth n so there is not optimal solution
You can’t get stuck in loops as there is no way to revisit states
Breifly describe backtracking search and what is does to space complexity
If you go down a branch and it fails, you can go back up
Space complexity marginally improved from O(bd) to O(d)
What 3 heuristics are used to improve backtracking efficiency
1st) Most constrained variable: the variable with fewest legal values
2nd) Most constraining variable: the variable with most constraints on remaining values
3rd) Least constraining variable: given a variable, the value that rules out the fewest neighbouring variables