Reducing large graphs to small supergraphs: a unified approach