Karp reduction

From dankwiki