use subgraph contains method