Answers.Body: <h2>Uninformed Search Techniques</h2>
  <p><strong>Breadth-First Search</strong> needs to store a <em>frontier</em> of nodes to visit next (where &quot;visit&quot; basically means: see if it's the goal, generate its children and add to frontier otherwise). You can visualize the memory requirements of this as a pyramid; initially, you just have the root node in there. As the search process continues and you keep going further down, it will become wider and wider (more memory required). The amount of memory required in the worst case to find a node at depth <span class="math-container">$d$</span> can be expressed as <span class="math-container">$O(b^d)$</span>, where <span class="math-container">$b$</span> is the branching factor (<a href="https://en.wikipedia.org/wiki/Breadth-first_search#Time_and_space_complexity" rel="nofollow noreferrer">see details here</a>). Intuitively, whenever you go one level deeper, your memory requirements multiply by a factor of <span class="math-container">$b$</span> (your pyramid becomes <span class="math-container">$b$</span> times wider; actually this means pyramid is not quite the right shape, it should rapidly curve outwards and become wider much faster than a triangle/pyramid would).</p>
  <p><strong>Depth-First Search</strong> also stores a frontier (or <em>stack</em> in the case of DFS) of nodes to visit next. However, in the case of DFS, this generally grows less quickly. Whenever you visit a node (pop it off of the stack), you generate all of its children and push them on top of the stack. However, whereas BFS would then continue &quot;to the right&quot; by visiting a relatively &quot;old&quot; node and generating all of its children again, DFS continues by going &quot;down&quot; and visiting one of the children that only just got pushed onto the stack. Once DFS has finished a part of the search tree (you can visualize this in your head as DFS having completed searched for example the left half of the pyramid), that entire section no longer needs to be stored in memory. Assuming you have a search tree of finite depth <span class="math-container">$d$</span>, the worst-case space complexity is <span class="math-container">$O(bd)$</span> (you have to search one path all the way down to a level of <span class="math-container">$d$</span>, and for each of those levels have <span class="math-container">$b$</span> nodes in the stack).</p>
  <hr />
  <p>Note that, based on the above, it is not sufficient to characterize your comparison as &quot;uninformed&quot; vs &quot;informed&quot; search. We've only just looked at uninformed search techniques, and already have two different memory requirements.</p>
  <p>In the above, I also did not consider subtleties such as the question of whether or not you're additionally memorizing which nodes of a graph you have already previously visited so that you can avoid visiting them again. This is not necessary in a tree, but may be necessary in a graph with cycles.</p>
  <hr />
  <h2>Informed Search Techniques</h2>
  <p><strong>A</strong>* is probably one of the most canonical examples of informed search algorithms. In terms of worst-case memory requirements, it's really similar to BFS; it also stores a frontier of nodes to visit next, but prioritizes those based on some estimate of &quot;goodness&quot; rather than Breadth-First order. In cases where the information you're using (typically a combination of known/incurred costs + heuristic estimate of future costs) is of extremely poor quality, this can regress to the level of Breadth-First Search, so the worst-case space complexity is the same as that for BFS (<a href="https://en.wikipedia.org/wiki/A*_search_algorithm#Complexity" rel="nofollow noreferrer">see details</a>). In practice, if you have high-quality information (good heuristics), the memory requirements will be <em>much</em> better though; in the case of an ideal/perfect heuristic, your search algorithm will pretty much go directly to the goal and hardly require any memory.</p>
  <p>There is also an algorithm called <a href="https://en.wikipedia.org/wiki/Iterative_deepening_A*" rel="nofollow noreferrer">Iterative Deepening A*</a> which has a much better space complexity, at the cost of often being slower. It is still an informed search algorithm using exactly the same kind of information as A* though.</p>
  <hr />
  <p>So, really, memory requirements cannot be characterized in terms of informed vs. uninformed search; in both cases, there are algorithms that require a lot of memory, and algorithms that require less memory.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T17:56:32.653Z
Answers.Text: so if I get this correctly, might sound really dumb to you but I am trying to wrap my head around this. Lets say for eg. a simple game like chess or checkers. In order to use informed search algorithms you would need to acquire information, such has have players play the game. Then use this data to help you formulate your heuristic search algorithm/ informed search algorithm. So basically store the data you acquired from previous games.On the other hand uninformed algorithms like,Minimax is a dept-first algorithm,hence it has no prior knowledge of the game.Is this right or crap?
Answers.UserDisplayName: JoeyB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T18:00:38.237Z
Answers.Text: @Joey The kinds of algorithms discussed here are not really directly applicable to something like playing chess or checkers. BFS/DFS/A*/etc. are generally used to search for a well-defined goal in some search space. For example, you can use them for path-finding, or puzzle-solving, that kind of thing. You could say that Minimax traverses nodes in a tree in the same order that Depth-First Search would, but it's still quite a bit different; Minimax is trying to learn values of **all** nodes it searches, it's not just searching for a particular goal and stopping when it's found the goal.
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T18:10:09.587Z
Answers.Text: I suppose you could, **very informally**, say Minimax is uninformed since the order in which it traverses the search space is completely fixed ahead of time, and you could say it becomes informed once you add Move Ordering or replace it with something like Monte-Carlo Tree Search (where early iterations in some sense inform where later iterations will go). The uninformed/informed terminology really isn't often used in the context of these algorithms though.
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T18:12:15.523Z
Answers.Text: the reason why I asked which was better uninformed or informed was because I thought Minimax and alpha beta pruning were related to BFS/DFS/IDDFS etc. I am getting even more confused because when one looks at Minimax and DFS you would say they that Minimax is based on DFS. In that DFS is the theoritcal background behind Minimax but no I see it is not,DFS is a totally different algorithm on its on. I am really sorry for this. Can you please point me in the right direction in terms of what algorithms I could use like Minimax to play checkers. I will delete this question.
Answers.UserDisplayName: JoeyB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T18:41:58.087Z
Answers.Text: @Joey Like I mentioned in the previous comment, there is indeed some sort of relationship between DFS and Minimax in that they both would traverse a tree of nodes in the same order. As for game-playing, there really aren't many more options than Minimax (+ hundreds or thousands of variations on it), or MCTS, as discussed in your other question here: https://ai.stackexchange.com/q/7159/1641. I don't see the point in deleting this question by the way, the question itself still makes sense and may be valuable for future visitors to the site.
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T19:09:51.453Z
Answers.Text: When you say they are "hundreds or thousands of variations on it" but I have been googling variations of Minimax and only get alpha beta pruning. Were are these "hundreds or thousands of variations on it"?
Answers.UserDisplayName: JoeyB
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T19:25:00.817Z
Answers.Text: @Joey off the top of my head, main variations after alpha-beta in increasing order of complexity would be; Iterative Deepening (with Alpha-Beta pruning then), Aspiration Search, Principal Variation Search. Around any of those there are lots of other ideas (Killer Move Heuristic, Transposition Tables, Quiescence Search). You can actually finds lots of names on this "joke slide" which argues that AlphaZero (MCTS + Deep Reinforcement Learning) is better than all this old-school stuff: https://pbs.twimg.com/media/DRHHRp_X0AAFRph.jpg:large
Answers.UserDisplayName: Dennis Soemers
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-17T17:25:32.777Z
Answers.LastActivityDate: 2022-01-03T11:27:49.650Z
Answers.LastEditDate: 2022-01-03T11:27:49.650Z
Answers.UserDisplayName: Dennis Soemers
Body: <p>I have extensively researched now for three days straight trying to find which algorithm is better in terms of which algorithm uses up more memory. I know uninformed algorithms, like depth-first search and breadth-first search, do not store or maintain a list of unsearched nodes like how informed search algorithms do. But the main problem with uninformed algorithms is they might keep going deeper, theoretically to infinity if an end state is not found but they exist ways to limit the search like depth-limited search.</p>
  <p>So, am I right in saying that uninformed search is better than informed search in terms of memory with respect to what I said above?</p>
  <p>Can anyone provide me with any references that show why one algorithm is better than the other in terms of memory?</p>
  
Tags: <game-ai><search><efficiency><uninformed-search><informed-search>
Title: Which are more memory efficient: uninformed or informed search algorithms?
UserDisplayName: JoeyB
ThreadText: # Which are more memory efficient: uninformed or informed search algorithms?
  
  (Asked by: username_0 on 2018-07-17)
  
  I have extensively researched now for three days straight trying to find which algorithm is better in terms of which algorithm uses up more memory. I know uninformed algorithms, like depth-first search and breadth-first search, do not store or maintain a list of unsearched nodes like how informed search algorithms do. But the main problem with uninformed algorithms is they might keep going deeper, theoretically to infinity if an end state is not found but they exist ways to limit the search like depth-limited search.
  
  So, am I right in saying that uninformed search is better than informed search in terms of memory with respect to what I said above?
  
  Can anyone provide me with any references that show why one algorithm is better than the other in terms of memory?
  
  **Tags:** game-ai, search, efficiency, uninformed-search, informed-search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-17. Score: 2 | Accepted answer
  
  ## Uninformed Search Techniques
  
  **Breadth-First Search** needs to store a *frontier* of nodes to visit next (where "visit" basically means: see if it's the goal, generate its children and add to frontier otherwise). You can visualize the memory requirements of this as a pyramid; initially, you just have the root node in there. As the search process continues and you keep going further down, it will become wider and wider (more memory required). The amount of memory required in the worst case to find a node at depth $d$ can be expressed as $O(b^d)$, where $b$ is the branching factor ([see details here](https://en.wikipedia.org/wiki/Breadth-first_search#Time_and_space_complexity)). Intuitively, whenever you go one level deeper, your memory requirements multiply by a factor of $b$ (your pyramid becomes $b$ times wider; actually this means pyramid is not quite the right shape, it should rapidly curve outwards and become wider much faster than a triangle/pyramid would).
  
  **Depth-First Search** also stores a frontier (or *stack* in the case of DFS) of nodes to visit next. However, in the case of DFS, this generally grows less quickly. Whenever you visit a node (pop it off of the stack), you generate all of its children and push them on top of the stack. However, whereas BFS would then continue "to the right" by visiting a relatively "old" node and generating all of its children again, DFS continues by going "down" and visiting one of the children that only just got pushed onto the stack. Once DFS has finished a part of the search tree (you can visualize this in your head as DFS having completed searched for example the left half of the pyramid), that entire section no longer needs to be stored in memory. Assuming you have a search tree of finite depth $d$, the worst-case space complexity is $O(bd)$ (you have to search one path all the way down to a level of $d$, and for each of those levels have $b$ nodes in the stack).
  
  ---
  
  Note that, based on the above, it is not sufficient to characterize your comparison as "uninformed" vs "informed" search. We've only just looked at uninformed search techniques, and already have two different memory requirements.
  
  In the above, I also did not consider subtleties such as the question of whether or not you're additionally memorizing which nodes of a graph you have already previously visited so that you can avoid visiting them again. This is not necessary in a tree, but may be necessary in a graph with cycles.
  
  ---
  
  ## Informed Search Techniques
  
  **A**\* is probably one of the most canonical examples of informed search algorithms. In terms of worst-case memory requirements, it's really similar to BFS; it also stores a frontier of nodes to visit next, but prioritizes those based on some estimate of "goodness" rather than Breadth-First order. In cases where the information you're using (typically a combination of known/incurred costs + heuristic estimate of future costs) is of extremely poor quality, this can regress to the level of Breadth-First Search, so the worst-case space complexity is the same as that for BFS ([see details](https://en.wikipedia.org/wiki/A*_search_algorithm#Complexity)). In practice, if you have high-quality information (good heuristics), the memory requirements will be *much* better though; in the case of an ideal/perfect heuristic, your search algorithm will pretty much go directly to the goal and hardly require any memory.
  
  There is also an algorithm called [Iterative Deepening A\*](https://en.wikipedia.org/wiki/Iterative_deepening_A*) which has a much better space complexity, at the cost of often being slower. It is still an informed search algorithm using exactly the same kind of information as A\* though.
  
  ---
  
  So, really, memory requirements cannot be characterized in terms of informed vs. uninformed search; in both cases, there are algorithms that require a lot of memory, and algorithms that require less memory.
  
  > **Comments:**
  > **username_0**: so if I get this correctly, might sound really dumb to you but I am trying to wrap my head around this. Lets say for eg. a simple game like chess or checkers. In order to use informed search algorithms you would need to acquire information, such has have players play the game. Then use this data to help you formulate your heuristic search algorithm/ informed search algorithm. So basically store the data you acquired from previous games.On the other hand uninformed algorithms like,Minimax is a dept-first algorithm,hence it has no prior knowledge of the game.Is this right or crap?  
  > **username_1**: @Joey The kinds of algorithms discussed here are not really directly applicable to something like playing chess or checkers. BFS/DFS/A*/etc. are generally used to search for a well-defined goal in some search space. For example, you can use them for path-finding, or puzzle-solving, that kind of thing. You could say that Minimax traverses nodes in a tree in the same order that Depth-First Search would, but it's still quite a bit different; Minimax is trying to learn values of **all** nodes it searches, it's not just searching for a particular goal and stopping when it's found the goal.  
  > **username_1**: I suppose you could, **very informally**, say Minimax is uninformed since the order in which it traverses the search space is completely fixed ahead of time, and you could say it becomes informed once you add Move Ordering or replace it with something like Monte-Carlo Tree Search (where early iterations in some sense inform where later iterations will go). The uninformed/informed terminology really isn't often used in the context of these algorithms though.  
  > **username_0**: the reason why I asked which was better uninformed or informed was because I thought Minimax and alpha beta pruning were related to BFS/DFS/IDDFS etc. I am getting even more confused because when one looks at Minimax and DFS you would say they that Minimax is based on DFS. In that DFS is the theoritcal background behind Minimax but no I see it is not,DFS is a totally different algorithm on its on. I am really sorry for this. Can you please point me in the right direction in terms of what algorithms I could use like Minimax to play checkers. I will delete this question.  
  > **username_1**: @Joey Like I mentioned in the previous comment, there is indeed some sort of relationship between DFS and Minimax in that they both would traverse a tree of nodes in the same order. As for game-playing, there really aren't many more options than Minimax (+ hundreds or thousands of variations on it), or MCTS, as discussed in your other question here: https://ai.stackexchange.com/q/7159/1641. I don't see the point in deleting this question by the way, the question itself still makes sense and may be valuable for future visitors to the site.  
  > **username_0**: When you say they are "hundreds or thousands of variations on it" but I have been googling variations of Minimax and only get alpha beta pruning. Were are these "hundreds or thousands of variations on it"?  
  > **username_1**: @Joey off the top of my head, main variations after alpha-beta in increasing order of complexity would be; Iterative Deepening (with Alpha-Beta pruning then), Aspiration Search, Principal Variation Search. Around any of those there are lots of other ideas (Killer Move Heuristic, Transposition Tables, Quiescence Search). You can actually finds lots of names on this "joke slide" which argues that AlphaZero (MCTS + Deep Reinforcement Learning) is better than all this old-school stuff: https://pbs.twimg.com/media/DRHHRp_X0AAFRph.jpg:large  
  
  ---
  
  