add subgraph generation