 Hello everyone, this is Alice Gao. In this video, I'm going to trace depth first search on a search graph. This is the search graph. I'm going to add nodes to the frontier in alphabetical order. During this process, I will keep track of the frontier and the search tree. Let's get started. Let's add the initial state S to the frontier and to the search tree. Step 1, the most recent node added to the frontier was S. S is the first node expanded. Remove S from the frontier. S is not a goal, let's expand S. S has three successors, D, E, and P. Add them to the frontier in alphabetical order, also add them to the search tree. Step 2, the most recent node added to the frontier was P. Let's label P as the second node expanded. Remove P from the frontier. P is not a goal, let's expand P. P has one successor, Q. Let's add Q to the frontier and to the search tree. Step 3, the most recent node added to the frontier was Q. Q is the third node expanded. Remove Q from the frontier. Q is not a goal, let's expand Q. Q has no successor, there's nothing to add to the frontier and to the search tree. The most recent node added to the frontier was E. E is the fourth node expanded. Remove E from the frontier. E is not a goal, let's expand E. E has two successors, H and R. Add them to the frontier in alphabetical order and add them to the search tree. There are three steps left. In step 5, we will expand R and add F to the frontier. In step 6, we will expand F and add C and G to the frontier. Finally, step 7, the most recent node added to the frontier was G. G is the seventh node expanded. Remove G from the frontier. G is a goal node, let's return the path S, E, R, F, G as a solution. Let me make some observations. First, DFS goes down one path until completion. If it doesn't find a goal on the path, it will backtrack and go down the next path. In this example, DFS reached Q and discovered that it was a dead end, so it backtracked to E and continued with the search. The order of adding nodes to the frontier is important. Because we added nodes to the frontier in alphabetical order, we ended up removing them in reverse alphabetical order. That's why DFS started by exploring the right-mode path in the search tree. If we added nodes to the frontier in reverse alphabetical order, then DFS would start by exploring the left-mode path in the search tree. I encourage you to try tracing DFS for this case. That's everything for this example on tracing DFS on a search graph. Thank you very much for watching. I will see you in the next video. Bye for now.