how to use networkx (python library)