Remove unused subgraph