 Hello, everyone. This is Alice Gao. In this video, I will discuss a problem with multipath pruning and how to fix this problem by constructing a consistent heuristic function. So far, multipath pruning seems like a great idea. It can make a search algorithm more efficient by allowing it to explore fewer states and find a goal more quickly. Unfortunately, multipath pruning could cause a problem. Multipath pruning specifies that we should keep the first path found to any node and discard all other path. What if the first path is not the one with the least cost? If this happens, multipath pruning could cause a search algorithm to discard the optimal solution. Let's consider two search algorithms, the lowest cost first search and the A star search. We will answer two questions for each algorithm. First, could multipath pruning cause the algorithm to discard the optimal solution? If the answer is yes, we need to show an example. If the answer is no, we need to prove it. Second, if multipath pruning causes the algorithm to discard the optimal solution, what can we do about it? Can we modify the algorithm to ensure that it still finds an optimal solution even with multipath pruning? Let's consider LCFS first. Can LCFS with multipath pruning discard the optimal solution? If your answer is no, you need to explain why. If your answer is yes, you need to come up with an example of when this happens. Pause the video and come up with an answer. Then keep watching. The answer is no, this is not possible. LCFS with multipath pruning is still optimal. Please watch a separate video for detailed explanation. Next, let's consider A star search. Assume that we're running A star search with an admissible heuristic function. Can A star search with multipath pruning discard the optimal solution? If your answer is no, please explain why. Given informal proof, if your answer is yes, please come up with an example of when this happens. Pause the video and come up with your answer. Then keep watching. Unfortunately, the answer is yes. We can construct a search graph for which A star with multipath pruning will discard the optimal solution. If you haven't come up with an example yourself, this is a perfect opportunity to do so. Pause the video and work on your example. Come up with a search graph and specify the cost on the edges. Try to make your search graph as simple as possible. If you can come up with a simple example, it means that you have really understood the essence of this problem. Please watch a separate video for the example that I came up with. I challenge you to come up with an example that's simpler than mine. We just learned some bad news. Multipath pruning can cause A star to discard the optimal solution. How can we fix it? There are several strategies. First strategy, we can find the discard all the longer path to the node on the frontier. However, discarding all the longer path seems wasteful. Some of the longer path may be quite close to a goal node. A better choice would be to replace the longer path with the shorter ones that we just found. This is strategy number two. So far, both strategies are quite computationally intensive. If the frontier is large, searching for a path on the frontier may take a long time. Can we avoid this work altogether? For the third strategy, we want to ensure that the algorithms find the shortest path to a node before finding any longer path. This is possible since we have control over one thing, the heuristic function. If we choose a heuristic function intelligently, then A star search with multipath pruning can be optimal. Let's take a look at how we should choose a heuristic function to ensure that A star search with multipath pruning is optimal. We call that if we don't perform multipath pruning, the optimality of A star search requires a heuristic function to be admissible. We can define an admissible heuristic by using this inequality. Consider any node m and any goal node g. The left-hand side is the heuristic estimate of the cost of the cheapest path from m to g. The extra term h of g is not a problem, since the heuristic value of a goal node should be zero. The right-hand side is the actual cost of the cheapest path from m to g. In other words, with an admissible heuristic, for every path to a goal node, the estimated cost of the path should be less than or equal to the actual cost of the path. Now, if we perform multipath pruning, we need a heuristic function to satisfy a stronger condition. The heuristic needs to be consistent. A consistent heuristic requires that for any two nodes m and n, the estimated cost of the cheapest path from m to n is less than or equal to the actual cost of the cheapest path from m to n. In other words, take the previous inequality for an admissible heuristic function and replace the second goal node g with any node n. This inequality must hold not only when the second node is a goal node, but when the second node can be any node. In practice, it is challenging to verify the definition of a consistent heuristic function directly, since we need to check every pair of nodes in the search graph. Fortunately, every consistent heuristic satisfies the monotone restriction, which is a simpler condition and easier to verify. The monotone restriction requires that for any directed edge from m to n, the same inequality must be satisfied. The monotone restriction is simpler, since we do not need to consider every pair of nodes. We only need to consider any pair of nodes that are directly connected by an edge. Finally, if the heuristic is consistent, then a star search with multipath pruning is optimal. The Poole and McWorth book provides a proof of this. Check it out if you're interested. After this discussion, you might be wondering about the question, how can we come up with a consistent heuristic? I'm not aware of a general procedure to do this. Fortunately, most admissible heuristic functions are consistent. In fact, it is challenging to come up with a heuristic that's admissible but not consistent. Therefore, it's often sufficient to construct an admissible heuristic and verify that it is also consistent using the monotone restriction. That's everything on fixing the problem with multipath pruning. Let me summarize. After watching this video, you should be able to do the following. Explain why LCFS with multipath pruning will not discard the optimal solution. Explain why A star search with multipath pruning may discard the optimal solution. Describe several strategies to make A star with multipath pruning optimal. Define a consistent heuristic. Thank you very much for watching. I will see you in the next video. Bye for now. you