fix Subgraph and add minimize and maximize of Subgraph