title: implement file data and using Dijkstra function to work in python
body: <p>I created a function by using dijkstra module to work on map shortest path.
  And now, I'm trying to implement a file data and use that function to work on it.</p>
  
  <p>Here is my function code:</p>
  
  <pre><code>nodes = {'A', 'B', 'C', 'D', 'E'}
  
  edges = [('A', 'B', 3), ('B', 'A', 3), ('A', 'C', 5), ('C', 'A', 5), 
           ('A', 'E', 2), ('E', 'A', 2), ('B', 'D', 2), ('D', 'B', 2),
           ('D', 'C', 1), ('C', 'D', 1), ('C', 'E', 2), ('E', 'C', 2),
           ('D', 'E', 4), ('E', 'D', 4)]
  
  g = (nodes, edges)
  src = 'D'
  
  prev, dist = dijkstra(g, src)
  </code></pre>
  
  <p>And here is my file data:</p>
  
  <pre><code>4 5 0.35
  5 4 0.35
  4 7 0.37
  5 7 0.28
  7 5 0.28
  5 1 0.32
  0 4 0.38
  0 2 0.26
  7 3 0.39
  1 3 0.29
  2 7 0.34
  6 2 0.40
  3 6 0.52
  6 0 0.58
  6 4 0.93
  </code></pre>
  
  <p>How to implement the file and replace the nodes and edges by the data of the file?</p>