title: Dijkstra's Algorithm: why do I end up stuck in this example?
body: <p>I've been trying to trace Dijkstra's shortest path algorithm for the following undirected graph:</p>
  
  <pre>
  
          (B)
         /   \
        /     \
    6  /       \ 9
      /         \ 
     /           \
    /             \
   (A)- 5 -(C)- 1 -(F)----2----(I)
     \            /
      \          / 
    4  \        / 2
        \      /
         \    /
          \  /
           (D)
  
  For clarification:
  (N) will represent nodes, numbers with no formatting will represent weights.
  the edge between A and C has a weight of 5, 
  the edge between C and F has a weight of 1. 
  </pre> 
  
  <p>I'll outline my process here:</p>
  
  <p>Since A is my initial node, the algorithm begins here. Since D is the cheaper path, the algorithm traverses to D. A is now marked as visited, meaning we cannot traverse to it again.</p>
  
  <p>At D it is easy to see that we will move to F.</p>
  
  <p>F is where I start having trouble. Since the shortest path will lead me to C, I'm stuck between two visited nodes with no way to get to I. Can anyone help me?</p>
  
  <p>EDIT: Sorry about the graph guys, this question was originally asked from a phone. I'll get that fixed asap.</p>