init subgraph constructor