I'm a little bit confused about the totalSteps variable in the Iterative Deepening section. So, if the goal state is found at the 5th layer, would the answer look something like 1+2+3+4+5? If not, what should it be exactly?

+7 votes

The total steps is the number of is the SUM of all the steps each DFS search took in every round, round is the return from the DFS when it comes back. You will add all of those up when up-till the solution is returned or not found. The overallMaxMemory is the LARGEST amount of memory that was during a single round. So if you had 5 layer. The totalSteps will be the sum of all numNodesCreated during each layer. The overallMaxMemory will be the larges memory(maxRoughMemoryCounter) that was used during one of the 5 layer, not the sum.