add priotirization for subgraphs