title: A* algorithm example - is it correct
body: <p>I've following graph:</p>
  
  <p><img src="https://i.stack.imgur.com/p2Lnr.png" alt="enter image description here"></p>
  
  <p>If I use A* algorithm, I get this sollution:</p>
  
  <pre><code>                      S (0+1=1)
                      /          \
                    /             \
            a(3+3=6)                b(2+3=5)
          /    |    \                /       \
        /      |     \              /         \
    c(4+0=4) b(6+3=9) d(6+0=6)    d(5+0=5)    c(7+0=7)
  </code></pre>
  
  <p>Question: which solution will we find, using algorithm A* and heuristic estimates(see graph)</p>
  
  <p>Sollution:</p>
  
  <ul>
  <li><p>select b(=5):</p>
  
  <pre><code>                  S (0+1=1)
                  /          \
                /             \
        a(3+3=6)               b(2+3=5)
  </code></pre></li>
  <li><p>select d(=5):</p>
  
  <pre><code>                 S (0+1=1)
                  /          \
                /             \
        a(3+3=6)                b(2+3=5)
                                 /       \
                                /         \
                              d(5+0=5)    c(7+0=7)
  </code></pre></li>
  <li><p>Stop searching - because "cost 5"  is less than a(3+3=6) -> we don't search for other solutions ? 
  Solution is: 
  <strong>s-b-d, cost = 5</strong></p></li>
  </ul>
  
  <p>Is it right  ?</p>