The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
Satisfiability Next: Graph Problems: Polynomial-Time Up: Combinatorial Problems Previous: Job Scheduling Satisfiability Input description: A set of clauses in conjunctive normal form. Problem description: Is there a truth assignment to the Boolean variables such that every clause is simultaneously satisfied? Discussion: Satisfiability arises whenever we seek a configuration or object that must be consistent with (i.e. satisfy) a given set of constraints. For example, consider the problem of drawing name labels for cities on a map. For the labels to be legible, we do not want the labels to overlap, but in a densely populated region many labels need to be drawn in a small space. How can we avoid collisions? For each of the n cities, suppose we identify two possible places to position its label, say right above or right below each city. We can represent this choice by a Boolean variable , which will be true if city 's label is above , otherwise . Certain pairs of labels may be forbidden, such as when 's above label would obscure 's below label. This pairing can be forbidden by the two-element clause , where means ``not v''. Finding a satisfying truth assignment for the resulting set of clauses yields a mutually legible map labeling if one exists. Satisfiability is the original NP-complete problem. Despite its applications to constraint satisfaction, file:///E|/BOOK/BOOK4/NODE157.HTM (1 of 4) [19/1/2003 1:30:52]
Satisfiability logic, and automatic theorem proving, it is perhaps most important theoretically as the root problem from which all other NP-completeness proofs originate. ● Is your formula in CNF or DNF? - In satisfiability, the constraints are specified as a logical formula. There are two primary ways of expressing logical formulas, conjunctive normal form (CNF) and disjunctive normal form (DNF). In CNF formulas, we must satisfy all clauses, where each clause is constructed by and-ing or's of literals together, such as In DNF formulas, we must satisfy any one clause, where each clause is constructed by or-ing ands of literals together. The formula above can be written in DNF as Solving DNF-satisfiability is trivial, since any DNF formula can be satisfied unless every clause contains both a literal and its complement (negation). However, CNF-satisfiability is NPcomplete. This seems paradoxical, since we can use De Morgan's laws to convert CNF-formulae into equivalent DNF-formulae and vice versa. The catch is that an exponential number of terms might be constructed in the course of translation, so that the translation itself might not run in polynomial time. ● How big are your clauses? - k-SAT is a special case of satisfiability when each clause contains at most k literals. The problem of 1-SAT is trivial, since we must set true any literal appearing in any clause. The problem of 2-SAT is not trivial, but it can still be solved in linear time. This is very interesting, because many problems can be modeled as 2-SAT using a little cleverness. Observe that the map labeling problem described above is an instance of 2-SAT and hence can be solved in time linear in the number of clauses, which might be quadratic in the number of variables. The good times end as soon as clauses contain three literals each, i.e. 3-SAT, for 3-SAT is NPcomplete. Thus in general it will not be helpful to model a problem as satisfiability unless we can do it with two-element clauses. ● Does it suffice to satisfy most of the clauses? - Given an instance of general satisfiability, there is not much you can do to solve it except by backtracking algorithms such as the Davis-Putnam procedure. In the worst case, there are truth assignments to be tested, but fortunately, there are lots of ways to prune the search. Although satisfiability is NP-complete, how hard it is in practice depends on how the instances are generated. Naturally defined ``random'' instances are often surprisingly easy to solve, and in fact it is nontrivial to generate instances of the problem that are truly hard. Still, we would likely benefit by relaxing the problem so that the goal is to satisfy as many clauses as possible. Here optimization techniques such as simulated annealing can be put to work to refine random or heuristic solutions. Indeed, any random truth assignment to the variables will satisfy file:///E|/BOOK/BOOK4/NODE157.HTM (2 of 4) [19/1/2003 1:30:52]
- Page 409 and 410: Arbitrary-Precision Arithmetic If y
- Page 411 and 412: Arbitrary-Precision Arithmetic PARI
- Page 413 and 414: Knapsack Problem Next: Discrete Fou
- Page 415 and 416: Knapsack Problem is a subset of S'
- Page 417 and 418: Discrete Fourier Transform Next: Co
- Page 419 and 420: Discrete Fourier Transform an algor
- Page 421 and 422: Combinatorial Problems Next: Sortin
- Page 423 and 424: Sorting Next: Searching Up: Combina
- Page 425 and 426: Sorting The simplest approach to ex
- Page 427 and 428: Sorting operations, implying an sor
- Page 429 and 430: Searching large performance improve
- Page 431 and 432: Searching Notes: Mehlhorn and Tsaka
- Page 433 and 434: Median and Selection followed by fi
- Page 435 and 436: Generating Permutations Next: Gener
- Page 437 and 438: Generating Permutations The rank/un
- Page 439 and 440: Generating Permutations generating
- Page 441 and 442: Generating Subsets look right when
- Page 443 and 444: Generating Subsets above for detail
- Page 445 and 446: Generating Partitions Although the
- Page 447 and 448: Generating Partitions Two related c
- Page 449 and 450: Generating Graphs generate: ● Do
- Page 451 and 452: Generating Graphs Combinatorica [Sk
- Page 453 and 454: Calendrical Calculations Next: Job
- Page 455 and 456: Calendrical Calculations Gregorian,
- Page 457 and 458: Job Scheduling ● To assign a set
- Page 459: Job Scheduling shop scheduling incl
- Page 463 and 464: Satisfiability Next: Graph Problems
- Page 465 and 466: Graph Problems: Polynomial-Time rec
- Page 467 and 468: Connected Components Testing the co
- Page 469 and 470: Connected Components discussing gra
- Page 471 and 472: Topological Sorting contradiction t
- Page 473 and 474: Minimum Spanning Tree Next: Shortes
- Page 475 and 476: Minimum Spanning Tree help you sort
- Page 477 and 478: Shortest Path Next: Transitive Clos
- Page 479 and 480: Shortest Path easier to program tha
- Page 481 and 482: Shortest Path Related Problems: Net
- Page 483 and 484: Transitive Closure and Reduction
- Page 485 and 486: Transitive Closure and Reduction Al
- Page 487 and 488: Matching augmenting paths and stopp
- Page 489 and 490: Matching Combinatorica [Ski90] prov
- Page 491 and 492: Eulerian Cycle / Chinese Postman ar
- Page 493 and 494: Eulerian Cycle / Chinese Postman Ne
- Page 495 and 496: Edge and Vertex Connectivity Severa
- Page 497 and 498: Edge and Vertex Connectivity Next:
- Page 499 and 500: Network Flow programming model for
- Page 501 and 502: Network Flow Combinatorica [Ski90]
- Page 503 and 504: Drawing Graphs Nicely vertices are
- Page 505 and 506: Drawing Graphs Nicely labs.com/orgs
- Page 507 and 508: Drawing Trees such as the map of th
- Page 509 and 510: Planarity Detection and Embedding N
Satisfiability<br />
Next: Graph Problems: Polynomial-Time Up: Combinatorial Problems Previous: Job Scheduling<br />
Satisfiability<br />
Input description: A set of clauses in conjunctive normal form.<br />
Problem description: Is there a truth assignment to the Boolean variables such that every clause is<br />
simultaneously satisfied?<br />
Discussion: Satisfiability arises whenever we seek a configuration or object that must be consistent with<br />
(i.e. satisfy) a given set of constraints. For example, consider the problem of drawing name labels for<br />
cities on a map. For the labels to be legible, we do not want the labels to overlap, but in a densely<br />
populated region many labels need to be drawn in a small space. How can we avoid collisions?<br />
For each of the n cities, suppose we identify two possible places to position its label, say right above or<br />
right below each city. We can represent this choice by a Boolean variable , which will be true if city<br />
's label is above , otherwise . Certain pairs of labels may be forbidden, such as when 's<br />
above label would obscure 's below label. This pairing can be forbidden by the two-element clause<br />
, where means ``not v''. Finding a satisfying truth assignment for the resulting set of clauses<br />
yields a mutually legible map labeling if one exists.<br />
Satisfiability is the original NP-complete problem. Despite its applications to constraint satisfaction,<br />
file:///E|/BOOK/BOOK4/NODE157.HTM (1 of 4) [19/1/2003 1:30:52]