Lecture 28 Summary

This was a student submission lecture. See the activity summary for an overview of the lecture.


This lecture focuses on showing the basic ideas for doing reductions, and starts establishing a set of problems that are NP-complete.


The instructor reviews the list of NP-complete problems introduced last time.

The instructor makes the point that being able to map one problem into another is an essential skill in the study of algorithms.



This is an activity slide. You can stop the video at 3:03.

At 10:50, the instructor asks, "What algorithm did you use?" A student responds, "Guess and check." Another student responds, "We started at the top, going down the graph and determining what truth value was necessary at each node." The instructor repeats this response, "Top-down to get the solution, bottom-up to verify." You should stop the video here to let students respond.

At 11:48, the instructor asks, "How many solutions would you have to try to get the right answer by guess-and-verify?" A student responds, "2^5"

At about 12:05 the instructor claims that it is save to set X1 to true and X5 to true - and then says that this reduces the number of cases to consider to 8. This remark is actually wrong. The UW students did not pick up on this. It would be safe to just skip this - stop to ask how many solutions to consider (at 11:48), and then skip to slide 1.4 at 12:54.

The instructor says that this activity reinforces the idea that what we will do is generate a solution and verify it.


Here the instructor explains that a non-deterministic algorithm is an algorithm that is allowed to guess.

The instructor explains that the idea behind the proof of Cook's algorithm is converting the behavior of a Turing machine into a boolean circuit.


Here we discuss how to convert a boolean circuit into a boolean formula.



It is noteworthy that any formula can be expressed in this form, so the assumption that the formula is in this form is not limiting.


This is an activity slide. You can stop the video at 20:09.

If you can find a solution like 2.15 (showing the reasoning behind there being no satisfying truth assignment) that would be best.



The reduction from 3-SAT to independent set is where we make the leap from problems dealing with logic to problems in graph theory.





This is an activity slide, but the instructor chose not to do it as an activity slide. Do this as an activity only if you feel that you have plenty of time; if you do the activity, you can stop the video at 32:20 to let the students work. If you don't do this as an activity, stop the video for the questions the instructor asks.

At 32:47, the instructor asks, "Why do 2, 7 and 3 form a cover?" A student responds, "Every edge is touched by one of those vertices."

At 33:16, he asks, "Why does this show that vertex cover is NP-complete?" The student response is hard to hear, but the instructor repeats it.


At 34:37, the instructor asks, "What's the largest clique in this graph?" A student responds, "2, 4, 5, 7 which has size 4." Stop here to let students respond.


This is an activity slide. You can stop the video at 35:42.

At 38:25, the instructor asks, "What's the largest clique in the graph you built?" A student responds, "1, 4, 5, 6" Stop here to let students respond.

At 38:52, he asks, "Is this a coincidence?" The students respond, "No." No need to stop here.



At 40:45, the instructor asks, "Is there a Hamiltonian Circuit in this graph?" The student response is hard to hear, but the instructor shows the Hamiltonian Circuit.


The instructor just gives a sketch of the reduction.


This is an activity slide. You can stop the video at 43:15.

At 44:30, the instructor says, "You have to start and end at the same vertex." You may wish to point this out to the students before they start working on the activity.


At 46:26, the instructor asks, "If you have a solution to the Travelling Salesman Problem, how would you use it to solve the Hamiltonian Circuit problem?" A student responds, "Put cost 1 on all edges." The instructor responds, "The Travelling Salesman Problem must operate on a complete graph." A student responds, "Start with the complete graph, then add cost 1 to edges in G and cost infinity to all other edges." The instructor comments, "So if there is a solution to the Travelling Salesman Problem with cost n, that gives us our Hamiltonian Circuit." You should stop after the original question to let students respond.

The instructor comments that the whole idea of NP-completeness is turning one problem into another. Sometimes the reduction is very simple, and sometimes it is very complicated, like the reduction from 3-SAT to Independent Set..