Assignment 3 – Property-Based Testing for Reductions of NP Problems

Assignment 3 – Property-Based Testing for Reductions of NP Problems

Due Friday Fri 4/28 11:59pm

0. Install the Karp language and look at an existing reduction.

You can install Karp via the command-line:

raco pkg install https://github.com/REA1/karp.git --type git-url

Or, you can use DrRacket. Choose the File|Package Manager menu item and paste https://github.com/REA1/karp.git in the Package Source field. Then, click on Show Details and select Auto + Update from the Dependencies Mode popdown menu. Then click Install.

Here is the complete code of the reduction from 3SAT to Indepdent-Set example:

1. Vertex-Cover to Set-Cover

Formulate the problem definition of Vertex-Cover in Karp, as discussed in class.

Complete the problem definition of Set-Cover (also discussed in class) given in set-cover.karp.

Write a reduction from Vertex-Cover to Set-Cover in Karp and property test the reduction to ensure its correctness.

2. Friends

Consider the following decision problem Friends:

Given a group of n people and the information of whether each two of them are friends. Does there exist a subset of k people among them, such that every person is a friend of all the other k-1 people?

Come up with a formal definition for this problem and formulate it in Karp.

Write a reduction from 3SAT to Friends in Karp and property test the reduction to ensure its correctness.

Hint: Try reducing Independent-Set to Friends first. (No need to submit the intermediate step)

Submit your Karp code for all of the above in Canvas.