title: Shortest path between connected pairs of tuples
body: <p>I'm new at this and i would be really greatfull for any kind of help...I have a list of tuples and I have to find shortest path between connected pairs of tuples.
  For example, I have list called pairs = [(1,2),(2,4),(1,3),(3,1),(4,3)] and i have to find shortest path for:</p>
  
  <pre><code>1 to 2, 1 to 3 and 1 to 4
  2 to 1, 2 to 3 and 2 to 4
  3 to 1, 3 to 2 and 3 to 4
  </code></pre>
  
  <p>In this list pairs, if I search for connection between 1 to 3, I have to possible outcomes:</p>
  
  <pre><code>1) (1,3) 
  2) (1,2)-(2,4)-(4,3)
  </code></pre>
  
  <p>and of course the shortest one is the first one - (1,3)</p>
  
  <p>Thanx...</p>