Add import networkx to graph.py