title: Finding Shortest Paths of weighted graph using stacks
body: <p>I will be given some kind of this graph as in the picture below. I've searched some algorithms but it seams as if it is something impossible for me to figure them out. In fact using <a href="http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm" rel="nofollow noreferrer">Floyd–Warshall algorithm</a> it is kinda of possible, but unfortunately I'm only allowed to use stacks (instead of matrices). I also looked for <a href="http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm" rel="nofollow noreferrer">Dijkstra's algorithm</a> but I could not get the relationship with my problem.<img src="https://i.stack.imgur.com/z6bfG.png" alt="picture"></p>
  
  <p>Clearly my aim is to get all <strong>shortest paths</strong> from one point to another one. As I mentioned I will just output the solution from my <strong>stack</strong> in a vector string. I guess I have to visit each node and what I am most afraid is of getting stacked in a loop or even loosing the track during the search.
  Also note that this is <strong>not a directed graph</strong>. If  Dijkstra's algorithm is applicable here I would be very grateful if anyone of you would guide me and I would really appreciate any help, suggestion, idea or even a vision for not getting stacked in a loop or loosing the track while searching.</p>
  
  <p>Thanks in advance.</p>