Use networkx.drawing.nx_agraph instead of networkx.drawing.nx_pydot. It is multiple times faster when it comes to reading large dot files.