CSC 380: Design and Analysis of Algorithms Dr. Curry Guinn
Quick Info Dr. Curry Guinn CIS 2015 guinnc@uncw.edu www.uncw.edu/people/guinnc 962-7937 Office Hours: MWF: 10:00am-11:00m and by appointment
Outline of today Satisfiability 3-SAT What’s the problem? How would we code this problem?
The Satisfiability Problem Given a set of propositional logic clauses, find an assignment of truth values to each symbol so that all of the clauses are true. (P -> Q & S) & (~P & ~Q) & (S | ~Q)
3SAT is a special case All clauses contain the disjunction of 3 terms Disjunction means OR Each term is of the form P or ~P. (P | Q | ~S) & (~P | ~Q | ~S) & (P | ~Q | S) It turns out that any SAT case, can be transformed into 3SAT
3SAT is an NP-complete problem Which means that it is map-able to other NP-complete problems such as Traveling salesman Clique Map coloring Knapsack, Etc. What do I mean by “map-able”?
Suppose we want to actually write code to solve this problem How do we do it? Analysis Design Implement Test
Analysis Can we write down the problem?
Write down the problem Find a set of truth assignments for the propositional symbols such that are of the clauses are true. Each clause consist of a disjunction (OR) of three terms. Each term is either a proposition symbol or its negation (i.e., P or ~P). More generally, for a particular problem, we will have n different propositional symbols and m different clauses. Do you want to add anything?
Find the nouns. Why?
Find the nouns. Why? Find a set of truth assignments for the propositional symbols such that all of the clauses are true. Each clause consist of a disjunction (OR) of three terms. Each term is either a proposition symbol or its negation (i.e., P or ~P). More generally, for a particular problem, we will have n different propositional symbols and m different clauses.
Start making UML diagrams of the classes Term Clause Symbol TruthAssignment Problem
See board and IDE
For Next Class, Monday No Homework Enjoy the weekend