Added networkx dependency and improved setup.py