Prev: L17, Next: L19

Zoom: Link, TopHat: Link, GoogleForm: Link, Piazza: Link, Feedback: Link.
Tools
📗 You can expand all TopHat Quizzes and Discussions: , and print the notes: , or download all text areas as text file: .
📗 For visibility, you can resize all diagrams on page to have a maximum height that is percent of the screen height: .
📗 Calculator:
📗 Canvas:


Slide:




# Heuristic

📗 Additional information can be given in the form of a heuristic cost from any state to the goal state: this is an estimate or guess of the minimum cost from \(s\) to a goal state: Wikipedia.
➩ The cost from the initial state to a state \(s\) is denoted by \(g\left(s\right)\).
➩ The cost from the state \(s\) to the goal state is denoted by \(h^\star\left(s\right)\), which is unknown during the search.
➩ The estimated value of \(h^\star\left(s\right)\) is called the heuristic cost, denoted by \(h\left(s\right)\).
📗 Heuristic costs can be used to speed up the search.
TopHat Discussion
📗 Search for a page containing an image. Describe how you find the image.
📗 Start here: Link.



# Uniform Cost Search

📗 UCS (Uniform Cost Search, or Dijkstra's Algorithm) expands the state with the lowest current cost \(g\left(s\right)\): Wikipedia.
📗 It is BFS with a priority queue based on \(g\left(s\right)\), and it is equivalent to BFS if the cost of every action is 1.
📗 UCS is complete.
📗 UCS is optimal.
TopHat Quiz
📗 [4 points] Given initial state \(S\) and goal state \(G\), write down the expansion path (list of expanded nodes) for . In case the diagram is not clear, the edge costs are (heuristic on the diagonal).

📗 Answer: .




# Best First Greedy Search

📗 (Best First) Greedy Search expands the state with the lowest heuristic cost \(h\left(s\right)\): Wikipedia.
📗 BFGS is not an abbreviation of Greedy Search, since it usually stands for Broyden Fletcher Goldfarb Shanno algorithm (a version of a gradient descent algorithm).
📗 Greedy uses a priority queue based on \(h\left(s\right)\).
📗 Greedy is incomplete.
📗 Greedy is not optimal.
TopHat Quiz
📗 [4 points] Given initial state \(S\) and goal state \(G\), write down the expansion path (list of expanded nodes) for . In case the diagram is not clear, the edge costs are (heuristic on the diagonal).

📗 Answer: .




# A Search

📗 A Search expands the state with the lowest total cost \(g\left(s\right) + h\left(s\right)\): Wikipedia (for A*).
📗 A Search uses a priority queue based on \(g\left(s\right) + h\left(s\right)\).
📗 A is complete.
📗 A is not optimal.
TopHat Quiz
📗 [4 points] Given initial state \(S\) and goal state \(G\), write down the expansion path (list of expanded nodes) for . In case the diagram is not clear, the edge costs are (heuristic on the diagonal).

📗 Answer: .

TopHat Quiz
📗 [4 points] Given initial state \(S\) and goal state \(G\), write down the expansion path (list of expanded nodes) for . In case the diagram is not clear, the edge costs are (heuristic on the diagonal).

📗 Answer: .




# Admissible Heuristic

📗 A heuristic is admissible if it never over estimates the true cost: \(0 \leq h\left(s\right) \leq h^\star\left(s\right)\): Wikipedia.
➩ The true costs are always assumed to be non-negative \(h^\star\left(s\right) \geq 0\) for this course.
📗 A Search with an admissible heuristic is called A* (A star) search.
📗 A* is complete.
📗 A* is optimal.
TopHat Discussion
📗 Suggest some admissible heuristic for the 15-puzzle game: Link.



# Dominated Heuristic

📗 \(h_{2}\) dominates \(h_{1}\) (or \(h_{1}\) is dominated by \(h_{2}\)) if \(h_{1}\left(s\right) \leq h_{2}\left(s\right) \leq h^\star\left(s\right)\) for every state \(s\).
📗 A* with a dominated heuristic is less informed and worse for A*.
📗 If optimality is not required, then a heuristic that is close but slightly over estimates the true cost can be preferred.
TopHat Quiz (Past Exam Question) ID:
📗 [3 points] Let \(h_{1}\) be an admissible heuristic from a state to the optimal goal, A* search with which ones of the following \(h\) will be admissible?
📗 Choices:





None of the above




# More Variants

📗 Iterative Deepening A* (IDA*) expands states with limit on \(g\left(s\right) + h\left(s\right)\) instead of depth in IDS: Link, Wikipedia.
📗 Beam Search keeps a priority queue with a limited size: Wikipedia.
Example
📗 A* search is often used to control robotic arms. States are usually represented by rotations angles instead of positions. The search space is called the configuration space: Link.
Review Note Review of search algorithms:

📗 Ignore edge cost (equivalently, assume edge costs are all 1)

BFS:
Expand the shallowest node first 
Complete, optimal (if cost is all 1)
Time complexity ~ \(b^{d}\)
Space complexity ~ \(b^{d}\)

DFS:
Expand deepest node first
Incomplete (when D is infinite), hence not optimal
Time complexity ~ \(b^{D}\)
Space complexity ~ \(b D\)

IDS:
"Search like BFS, fringe like DFS"
Complete, optimal (if cost is all 1)
Time complexity: ~ \(b^{d}\)
Space complexity: ~ \(b d\)
Preferred algorithms if heuristic is unknown

📗 Consider edge cost

UCS:
(Generalization of BFS)
Expand least-cost node first (first half cost \(g\left(s\right)\))
Complete, optimal

 \(g\left(s\right)\): first half cost, known.
 \(h^\star\left(s\right)\): second half cost, unknown.
 \(h\left(s\right)\): an estimate/guess for second half cost; user-specified

BFG:
Expand node with lowest \(h\left(s\right)\)
Incomplete, not optimal.
Issue: ignores \(g\left(s\right)\)

A Search:
Expand node with lowest \(g\left(s\right) + h\left(s\right)\)
Complete, but not optimal.
Issue: \(h\left(s\right)\) may be an overestimate of \(h^\star\left(s\right)\), preventing us to expand a node with low true \(h^\star\left(s\right)\).



📗 Notes and code adapted from the course taught by Professors Jerry Zhu, Yudong Chen, Yingyu Liang, and Charles Dyer.
📗 Content from note blocks marked "optional" and content from Wikipedia and other demo links are helpful for understanding the materials, but will not be explicitly tested on the exams.
📗 Please use Ctrl+F5 or Shift+F5 or Shift+Command+R or Incognito mode or Private Browsing to refresh the cached JavaScript.
📗 You can expand all TopHat Quizzes and Discussions: , and print the notes: , or download all text areas as text file: .
📗 If there is an issue with TopHat during the lectures, please submit your answers on paper (include your Wisc ID and answers) or this Google form Link at the end of the lecture.
📗 Anonymous feedback can be submitted to: Form. Non-anonymous feedback and questions can be posted on Piazza: Link

Prev: L17, Next: L19





Last Updated: August 22, 2025 at 10:06 AM