 Hello everyone! This is Alice Gao. In this video, I'm going to discuss the greedy best-first search or greedy BFS algorithm. In the previous video, I introduced the lowest cost-first search algorithm. It uses the cost function to determine which state to explore next. Besides the cost function, the heuristic function is another source of information that a search algorithm can use. Greedy BFS makes use of the heuristic function. In fact, it relies on the heuristic function as the only source of information. For Greedy BFS, the frontier is a priority queue ordered by the heuristic value. At every step, the algorithm removes the path with the smallest heuristic value. Intuitively, we're choosing the state that we think is the closest to the goal according to our heuristic function. Let's trace Greedy BFS on a search graph. We will use the same tie-breaking rule as before. Order the path by their last nodes and choose the one that comes first in alphabetical order. Pause the video and trace the algorithm yourself. Then, keep watching for the answer. Here's the final search tree when the algorithm terminates. Please watch a separate video for the tracing process. Greedy BFS did pretty well on this problem because the heuristic values are quite accurate. Let me discuss the properties of Greedy BFS. First, what are its space and time complexities? Unfortunately, both complexities are exponential. Intuitively, the heuristic function does not improve the worst case scenario. In the worst case, the heuristic function may be completely uninformative. For instance, having a heuristic value of zero for every state. Then, Greedy BFS is equivalent to an uninformed search algorithm and may have to search the entire space to find the goal. What about completeness and optimality? Unfortunately, we have some bad news again. Greedy BFS is neither complete nor optimal. Here's the intuition. Greedy BFS relies on the heuristic function. Unfortunately, we have absolutely no guarantee on the quality of the heuristic function. If the heuristic values are extremely inaccurate, they will cause the algorithm to be stuck on paths that do not terminate or return a path that's not optimal. Let me leave these two examples as practice problems for you. First, construct the search graph where Greedy BFS does not terminate on the search graph. Second, construct a search graph where Greedy BFS terminates but does not return the optimal solution. Basically, I am asking you to prove that Greedy BFS is not complete nor optimal. There are many correct examples you can come up with. Let me give you some hints. For the not complete example, construct a graph with two paths. One path ends with a cycle and the other one ends with a goal state. Then, design the heuristic function such that Greedy BFS will go through the cycle forever. For the not optimal example, again, construct the graph with two paths. Both paths start from the same initial state and end at the same goal state. Then, design the heuristic function such that the algorithm will find and return the suboptimal path first. Try to make your examples as simple as possible. In my opinion, if you can come up with the simplest examples, it shows that you have really understood the algorithm. That's everything on the Greedy Best First Search algorithm. Let me summarize. After watching this video, you should be able to do the following. Explain Greedy Best First Search on a high level. Trace Greedy Best First Search on a search graph. Explain the properties of Greedy BFS. Space complexity, time complexity, completeness, and optimality. Thank you very much for watching. I will see you in the next video. Bye for now.