title: What does the beam size represent in the beam search algorithm?
body: <p>I have a question about the <em>beam search algorithm</em>. </p>
  
  <p>Let's say that <code>n = 2</code> (the number of nodes we are going to expand from every node). So, at the beginning, we only have the root, with 2 nodes that we expand from it. Now, from those two nodes, we expand two more. So, at the moment, we have 4 leafs. We will continue like this till we find the answer. </p>
  
  <p><em>Is this how beam search works? Does it expand only <code>n = 2</code> of every node, or it keeps 2 leaf nodes at all the times?</em> </p>
  
  <p>I used to think that <code>n = 2</code> means that we should have 2 active nodes at most from each node, not two for the whole tree.</p>