Added helper function to determine if a graph is a subgraph of another.