subgraph masks in max-flow