## Question:

I am new to building directed graphs with networkx and I’m trying to work out how to compare two graphs. More specifically, how to tell if a smaller graph is a subgraph (unsure of the exact terminology) of a larger graphAs an example, assume I have the following directed graph:

I would like to be able to check whether a series of smaller graphs are sub-graphs of this initial graph. Returning a True value if they are (graph B), and False if they are not (graph C):

Graph B = Sub-graph of Graph A

Graph C != Sub-graph of Graph A

**Example Code**## Answer:

You are looking for a subgraph isomorphisms.If you have better answer, please add a comment about this, thank you!