Implementation of Dijkstra's algorithm with Networkx, reveicing a print error
Question: I'm trying to read a file with source target weight values respectively to
find the shortest path and print that path with the final weight. I'm using
Networkx to use the Dijkstra function. However, when I execute, I receive this
notice:  
`<function shortest_path at 0x7f9a13c39230> <function bidirectional_dijkstra
at 0x7f9a13c48140>`

I initially used just the `shortest_path` function thinking I somehow messed
up using it, thus using the `bidirectional_dijkstra` function.

The file in question has dummy data titled example.txt: ` D1 D5 7 D1 D2 6 D5
D4 7 D5 D3 7 D5 D3 3 D5 D2 4 D2 D2 1 D4 D3 1`

My method in Python:

    
    
    #!/usr/bin/env python
    import os.path
    import networkx as nx
    from sys import argv
    
    
    #!script, filename = argv
    #assigns example to open the file example.txt
    example = open("example.txt", "r") 
    
    print("\n This is what we have in our file:\n")
    
    #prints the open file
    print example.read()
    
    G =nx.Graph()
    
    for line in example:
        source, target, weight = line.split() 
        nx.shortest_path(G,[source, target, weight])
    
    print ( nx.shortest_path)
    print ( nx.bidirectional_dijkstra)
    #for some reason, this is printing:
    #
    #<function shortest_path at 0x7fe480d56230>
    #<function bidirectional_dijkstra at 0x7fe480d65140>
    


Answer: So, I was receiving the message because I had not properly defined an edge.
Here's the updated code:

    
    
       import os.path
       import networkx as nx
       from sys import argv
    
    
       #!script, filename = argv
       #assigns example to open the file example.txt
       example = open("/example.txt", "r") 
    
    
       G =nx.Graph()
    
       for line in example:
           line = line.split()
           G.add_edge(line[0], line[1], weight=line[2])
           #nx.shortest_path(G,[source, target, weight])
    
       print nx.shortest_path(G)
       print nx.average_shortest_path_length(G)
    

