Changed the reading code to read into networkx graph instead of dict.