I've been doing some extensive work with graphs in python and I'd recommend not using networkx
for larger problems. Since the library is pure python it is perfect for smaller graphs and portability, but for larger subgraph isomorphisms I've found that graph-tool
works very well.
The function call you are looking for in graph-tool is under the topology section: