# Sol6a - CS 577 Introduction to Algorithms Homework Solution...

This preview shows pages 1–2. Sign up to view the full content.

CS 577: Introduction to Algorithms 12/12/06 Homework Solution: 6a Instructor: Shuchi Chawla TA: Siddharth Barman Question 1 1a Given an assignment of variables we can verify in polytime that the boolean formula is satisfied along with the fact that each variable occurs at most thrice. This proves that Read-Thrice 3-SAT RT - SAT is in NP . We reduce 3- SAT to RT - SAT to prove that it is NP -complete. Given a boolean formula φ in 3- CNF we wish to reduce it to ϕ such that in ϕ each literal occurs at most thrice and ϕ is satisfiable iff φ is satisfiable. The idea is to introduce new variables (family y ) for each variable that occurs more than three times in φ . Say φ has boolean variables x 1 to x n . Now, if a particular variable x i and its complement x i occurs m i time ( m i > 3) we introduce additional variables y i 1 to y i m i . We also ensure that for any assignment all the additional variables y i 1 to y i m i get assigned the same value as x i . We replace the occurrence of x i ( x i ) by y i j ( y i j ), this ensures that each literal occurs at most thrice. The caveat regarding equivalence of x i and y i j s follows. In general to ensure that variables x and y i s (superscripts are dropped for now) are assigned the same value we add the following clauses: ( x y 1 ) , ( y 1 y 2 ) , .... , ( y k 1 y k ) and finally ( y k x ). With x = 1, for the clause ( x y 1 ) to hold y 1 must be set to one. Overall when x is set to one, the clause chain propagates the value 1 to all y i s. In the other direction when x

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern