Networkx Successors Example, Follow their code on GitHub.