subset_graph function

Subset graphs based on a given logical condition