added example using networkx