Podcast
Questions and Answers
In informed search algorithms, what role do heuristics play?
In informed search algorithms, what role do heuristics play?
- They guide the search towards a goal by estimating the remaining cost from a node to the goal. (correct)
- They provide a complete map of the search space, eliminating uncertainty in pathfinding.
- They eliminate the need to explore all possible paths, ensuring the fastest search.
- They guarantee the discovery of the most optimal path, regardless of the search space.
How does a 'Best First' (greedy) search algorithm decide which node to expand next?
How does a 'Best First' (greedy) search algorithm decide which node to expand next?
- It chooses the node that has been in the 'open' list for the longest time.
- It selects the node with the lowest estimated remaining cost to the goal. (correct)
- It picks the node with the smallest global cost from the start node.
- It randomly selects a node from the 'open' list to ensure exploration of all possibilities.
What is a key characteristic of the A* algorithm in terms of its node selection from the open
list?
What is a key characteristic of the A* algorithm in terms of its node selection from the open
list?
- It prioritizes nodes that have been on the open list for the longest duration.
- It selects nodes randomly to ensure exploration of the entire search space.
- It selects the node with the minimum estimated total cost, which is the sum of the cost so far and the estimated remaining cost. (correct)
- It picks the node with the lowest estimated remaining cost, similar to a greedy search.
In the context of A* admissibility, what condition must be met by the heuristic estimates?
In the context of A* admissibility, what condition must be met by the heuristic estimates?
How does the A* algorithm handle a situation where a better path is found to a node that is already on the closed
list?
How does the A* algorithm handle a situation where a better path is found to a node that is already on the closed
list?
What does it mean for a search algorithm to be 'blind' in the context of map traversal?
What does it mean for a search algorithm to be 'blind' in the context of map traversal?
What is the purpose of the estRemCost
variable in the SearchState
class, as used in the A* algorithm?
What is the purpose of the estRemCost
variable in the SearchState
class, as used in the A* algorithm?
How does the 'expand()' method in the Search
class contribute to reconstructing the solution path when using informed search algorithms?
How does the 'expand()' method in the Search
class contribute to reconstructing the solution path when using informed search algorithms?
In the context of A*, what does it signify if heuristic estimates are perfectly accurate?
In the context of A*, what does it signify if heuristic estimates are perfectly accurate?
What role do heuristics play in improving the efficiency of search algorithms?
What role do heuristics play in improving the efficiency of search algorithms?
Which of the following is an example of a greedy algorithm?
Which of the following is an example of a greedy algorithm?
If all heuristic estimates are zero (or identical), how does the A* algorithm behave?
If all heuristic estimates are zero (or identical), how does the A* algorithm behave?
How is the efficiency of a search, specifically by reconstructing the solution path, determined?
How is the efficiency of a search, specifically by reconstructing the solution path, determined?
In what way does the A* algorithm improve upon a simple map traversal search algorithm?
In what way does the A* algorithm improve upon a simple map traversal search algorithm?
When reconstructing the solution path after a search succeeds, what data is used to follow the chain of nodes back to the start?
When reconstructing the solution path after a search succeeds, what data is used to follow the chain of nodes back to the start?
In the provided code snippets, what is the role of the MapLink
class?
In the provided code snippets, what is the role of the MapLink
class?
What is the significance of the 'parent' attribute within the SearchNode class during the operation of the A* algorithm?
What is the significance of the 'parent' attribute within the SearchNode class during the operation of the A* algorithm?
In best-first search strategy, what is the primary criterion for selecting a node from the open list?
In best-first search strategy, what is the primary criterion for selecting a node from the open list?
What condition related to cost estimates ensures the admissibility of the A* algorithm?
What condition related to cost estimates ensures the admissibility of the A* algorithm?
What is indicated if the known distance along a complete, non-optimal path is less than an underestimate of the distance along an incomplete, optimal path?
What is indicated if the known distance along a complete, non-optimal path is less than an underestimate of the distance along an incomplete, optimal path?
If there are accurate estimates, will A* be optimal?
If there are accurate estimates, will A* be optimal?
If all the estimates are 0 (or identical), A* reduces to what kind of search?
If all the estimates are 0 (or identical), A* reduces to what kind of search?
In the lecture, the lecturer talks about the fact that VetSuccessors may have to change in A*, why is this the case?
In the lecture, the lecturer talks about the fact that VetSuccessors may have to change in A*, why is this the case?
What are the classes that are described to be 'open' in the lecture?
What are the classes that are described to be 'open' in the lecture?
In the A* algorithm, if a solution is found in the search space, how is the solution path typically reconstructed?
In the A* algorithm, if a solution is found in the search space, how is the solution path typically reconstructed?
What happens to a node 'X' after it expanded in normal search algorithms?
What happens to a node 'X' after it expanded in normal search algorithms?
When does what happens with the normal search algorithms not apply?
When does what happens with the normal search algorithms not apply?
If it's possible to find a better route, what needs to change?
If it's possible to find a better route, what needs to change?
In the provided map search code, what does the getSuccessors
method in MapState.java
do?
In the provided map search code, what does the getSuccessors
method in MapState.java
do?
What is the purpose of reportSuccess()
?
What is the purpose of reportSuccess()
?
When the reportSuccess()
is run, what will happen to start with?
When the reportSuccess()
is run, what will happen to start with?
In the context of informed search algorithms, what does 'efficiency' refer to when determining performance?
In the context of informed search algorithms, what does 'efficiency' refer to when determining performance?
What would be the implications of using an inadmissible heuristic (overestimating cost) in A* search?
What would be the implications of using an inadmissible heuristic (overestimating cost) in A* search?
Within the search4
algorithms presented, which of the following code enhancements accommodate A* search compared to simpler search methods?
Within the search4
algorithms presented, which of the following code enhancements accommodate A* search compared to simpler search methods?
What is the efficiency?
What is the efficiency?
Flashcards
Informed Search
Informed Search
Search algorithms that use heuristics to guide the search process.
Best First (Greedy) Search
Best First (Greedy) Search
A search strategy that selects the node that appears to be closest to the goal, based on a heuristic.
A* Algorithm
A* Algorithm
An informed search algorithm that minimizes f(n) = g(n) + h(n), where g(n) is the cost from start to node n, and h(n) is the estimated cost from node n to the goal.
A* admissibility
A* admissibility
Signup and view all the flashcards
estRemCost
estRemCost
Signup and view all the flashcards
selectNode()
selectNode()
Signup and view all the flashcards
A* and Estimates
A* and Estimates
Signup and view all the flashcards
Reconstructing the Solution Path
Reconstructing the Solution Path
Signup and view all the flashcards
Parent
Parent
Signup and view all the flashcards
Expands
Expands
Signup and view all the flashcards
reportSucess
()
reportSucess ()
Signup and view all the flashcards
Efficiency
Efficiency
Signup and view all the flashcards
Carta
Carta
Signup and view all the flashcards
MapLink
MapLink
Signup and view all the flashcards
MapState
MapState
Signup and view all the flashcards
Approaches to Open
Approaches to Open
Signup and view all the flashcards
Study Notes
Informed Search and Heuristics
- The lecture discusses informed search and heuristics, best first (greedy) search, and the A* algorithm.
- The concepts of A* admissibility and map traversal with A* are covered.
- The lecture goes over implementing A* and reconstructing the solution path, followed by a recap.
Quiz Details
- The upcoming quiz consisting of 12 multiple choice questions and 3 free-text questions.
- There is a Mock test which contains examples of the multiple choice questions.
Free Text Questions for 8-Puzzle
- An example free-text question involves designing a search engine for the 8-puzzle game.
- The puzzle's configuration must be stored in a 3x3 int array, using '0' to indicate the gap.
- The task involves describing how to implement the getSuccessor() method, ensuring all possible next moves are added to the list of successor states, even at edge cases.
- When answering the free text question, make sure you have all the details of the algorithm.
- Describe the specifics that should happen in the getSuccessor codes
- Make a clear distinction between a state and a node
- Avoid using imprecise language
Map Traversal and Heuristics
- A Map Traversal search algorithm without heuristics is "blind" to the parts of the map it hasn't explored.
- Algorithms only know the cost/distance of expanded nodes without knowing if they are useful choices.
- Heuristics estimate the distance to the goal from each node
Guiding the Search
- Branch-and-bound searches expand effort equally in all directions.
- Knowledge guiding search comes from estimating the remaining cost to the goal from any node n.
- A SearchState may contain a variable estRemCost which the user has to supply to the application
- In map traversal, this could be the straight-line distance to the goal.
- Only estimates, not true costs, are used for this
- Searching is pointless if the true costs are already known!
Greedy Search / Best First Search
- A Best-First search strategy selects the node with the minimum estRemCost from open, i.e., the node closest to a goal.
- This makes it a greedy algorithm which makes use of the heuristics whilst ignoring the global cost with potentially lucky and great estimates if so.
- It is not admissible
A* Algorithm Overview
- The A* Algorithm is a state space searching that combines Branch-and-Bound and Best-First (Greedy) approaches.
- A* select a node
n
fromopen
with minimum estimated costh(n)
of path from start to goal throughn
, where h(n) = g(n) + f(n).- g(n) is the cost from start to n, and f(n) estimates the remaining cost from n to the goal.
- It was first discovered by Peter Hard, Nils Nilsson and Bertram Raphael, working at the Stanford Research Institute (1968)
A* Algorithm Characteristics
- A* is admissible if all f(n) (estRemCosts) are guaranteed to be underestimates.
- The known distance along a complete, non-optimal path will not be less than an underestimate of the distance along the incomplete, optimal path, hence the correct path cannot be selected from open.
- There are limiting cases to improve efficiency and accuracy.
- If all estimates are 0 (or identical), A* reduces to Branch-and-Bound.
- If all the estimates are accurate A* is optimal and the better the estimates, the more efficient A* is.
Admissibility of A*
- When there are 2 competing routes to the goal; through X and through Y
- Suppose the known cost of g(X)=110 and Estimated remaining cost f(X) to goal: 25 vs g(Y)=80 and Estimated remaining cost f(Y) to goal: 40
- As long as estimates are underestimates
Node Selection Approaches from the Open List
- Search problems with variable costs affect how the currentNode is selected off the open list.
- Approaches include Depth-first (stack: last in, first out), breadth-first (queue: first in, first out), and lowest-cost-first (sorted by lowest g(x) first).
- A* uses an open list sorted by lowest h(x)=g(x)+f(x) first.
Search Algorithms
- Search algorithms include both uniformed and informed searches.
- Uninformed search examples: Breadth First Search, Depth First Search, Lower cost / Branch and Bound Search, and Progressive Deepening
- Informed search examples: Best First (Greedy) Search, and A* Search.
Implementing A*
- In the search4 code, changes were made and you can supply estRemCosts for each searchState.
- Additional changes made to selectNode(), and vetSucessors() as well
Nodes on closed
- Initially, place the node, X on open, before expanded it at anytime
- Once fully expanded, this will be placed on closed
- It won't resurface again
Implementing A* - What Happens on the Closed List?
- Node X is placed on
open
with parent A (cost 10, remaining cost 25) open
now has X and B. X is expanded (remaining cost 30, not B which would be 55)- X is moved to the closed list
- Later, a shorter route to X through B (40, remainder 5) emerges
- The node X has its parent and globalCost and totalCost, removed from closed and placed back on open.
Summary of Code Inspection
Carta
provides encapsulated access to the map specific data cities, links, local costs, and estimates.MapLink
andCarta
uses listings of MapLink instances, providing information about a link between two variables.MapState
inherits fromSearchState variables, and also contains
city,
localCostand
estRemCost`.getSuccessors()
inMapState
uses the map information to find successors, and also keeps track of thelocalCost
andestRemCost
.
Solution Path Reconstruction
- It is often necessary to reconstruct the solution path
- The parent of each SearchNode must be recalled
- The parent will be "null" for the start node
- The expand() method from Search must be modified so that the parent of open nodes is now the currentNode
- When a search suceeds, you have to reconstruct the solution path, starting with the currentNode and working with closed, following the chain of parents until you get to the parent "null" node.
- The efficiency of the search can also be calculated with this
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.