SAT problem SAT – Boolean satisfiability problem

Slides:



Advertisements
Similar presentations
P, NP, NP-Complete Problems
Advertisements

NP-Hard Nattee Niparnan.
Hard Problems Some problems are hard to solve. No polynomial time algorithm is known Most combinatorial optimization problems are hard Popular NP-hard.
Max Cut Problem Daniel Natapov.
Clase 2, Parte 1: Conceptos Básicos de Búsqueda. Algoritmo de Ascenso de Colina. Enunciado Tarea 1 Diseño de Algoritmos (Heurísticas Modernas) Gabriela.
Computability and Complexity 23-1 Computability and Complexity Andrei Bulatov Search and Optimization.
Algorithms in Exponential Time. Outline Backtracking Local Search Randomization: Reducing to a Polynomial-Time Case Randomization: Permuting the Evaluation.
MAE 552 – Heuristic Optimization Lecture 3 January 28, 2002.
The Theory of NP-Completeness
MAE 552 – Heuristic Optimization Lecture 4 January 30, 2002.
EAs for Combinatorial Optimization Problems BLG 602E.
MAE 552 – Heuristic Optimization Lecture 5 February 1, 2002.
State-Space Representation Read Chapter 3. Searches you use MapQuest –road maps Google –documents CiteSeer –research documents.
1 Integrality constraints Integrality constraints are often crucial when modeling optimizayion problems as linear programs. We have seen that if our linear.
NP-Complete Problems CSC 331: Algorithm Analysis NP-Complete Problems.
Computer Implementation of Genetic Algorithm
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
COSC 4426 Topics in Computer Science II Discrete Optimization Good results with problems that are too big for people or computers to solve completely
Logic (continuation) Boolean Logic and Bit Operations.
State-Space Representation General Problem Solving via simplification Read Chapter 3.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Exhaustive Search. Brute Force Methods  guarantee best fitness value is found  feasible for ‘small’ data sets only.
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
Clase 3: Basic Concepts of Search. Problems: SAT, TSP. Tarea 1 Computación Evolutiva Gabriela Ochoa
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
“One ring to rule them all” Analogy (sort of) Lord of The Rings Computational Complexity “One problem to solve them all” “my preciousss…”
David Evans CS200: Computer Science University of Virginia Computer Science Lecture 15: Intractable Problems (Smiley.
Lecture 7 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Solving the Logic Satisfiability problem Solving the Logic Satisfiability problem Jesus De Loera.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
Brute Force II.
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
School of Computer Science & Engineering
Hard Problems Some problems are hard to solve.
Richard Anderson Lecture 26 NP-Completeness
Lecture 2-2 NP Class.
Polynomial-Time Reduction
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Expressions and Control Flow in JavaScript
Introduction to the Analysis of Complexity
P and NP CISC4080, Computer Algorithms CIS, Fordham Univ.
Lecture 5 NP Class.
Lecture 24 NP-Complete Problems
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
Richard Anderson Lecture 25 NP-Completeness
NP-Completeness Proofs
Integer Programming (정수계획법)
How Hard Can It Be?.
Computational Complexity
Chapter 34: NP-Completeness
Chapter 3 Brute Force Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
3. Brute Force Selection sort Brute-Force string matching
P and NP CISC5835, Algorithms for Big Data CIS, Fordham Univ.
Integer Programming (정수계획법)
3. Brute Force Selection sort Brute-Force string matching
Instructor: Aaron Roth
Lecture 24 Classical NP-hard Problems
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
3. Brute Force Selection sort Brute-Force string matching
Presentation transcript:

SAT problem SAT – Boolean satisfiability problem Find the assignment to each binary variable so the expression evaluates to TRUE Exhaustive search – EXHAUSTIVE!!! Transform the expression to CNF (Conjunctive Normal Form)

SAT problem Example 4 variables – 24=16 combinations to check If we check 1 million combinations per second, since the big bang (10 billion years ago) we would have checked less than 1% of all combinations

SAT problem Another problem is that after each evaluation we get only 0 (FALSE) or 1 (TRUE), and the result of the evaluation doesn’t tell us what should we do We don’t know how far we are from the solution

TSP TSP – Traveling Salesman Problem The traveling salesman must visit each town exactly ones and return home covering theminimum distance. Textbook examples allow connections between all cities, real world problem are different.

TSP Symmetric dist(i,j) = dist(j,i) Assymmetric dist(i,j) ≠ dist(j,i)

TSP Size of the search space: permutations of n (=20) cities Same tours 2 – … – 5 – 6 – 15 – 3 – 11 – 19 – 17 15 – 3 – 11 – 19 – 17 – 2 – … – 6 3 – 11 – 19 – 17 – 2 – … – 6 – 15 Symmetric TSP: reverse tours are the same

TSP Every tour can be represented in 2n different ways (symmetric TSP), and there are n! ways to permute n numbers |S|=n!/(2n)=(n-1)!/2 For n>6 there are more possible solutions to the TSP than to SAT.

TSP vs. SAT n SAT TSP 3 8 1 4 16 5 32 12 6 64 60 7 128 360 256 2520 … n=10 S≈181000 n=20 S ≈1016 n=50 S ≈1062 “Only” 1021 liters of water on the planet Better evaluation for TSP than for SAT!

Problem solving In every problem we must specify: 1. Representation 2. Objective (goal) 3. Evaluation function

Representation of SAT n variable that are logical bits, we represent a candidate solution as a binary string of length n. Each element in the string corresponds to one variable of the problem. The size of the search space is 2n.

Objective SAT: find the vector of bits such that the Boolean statement is satisfied TSP: minimize the total distance traveled by the salesman subject to constraint of visiting each city exactly once and returning ti the starting city. min ∑ dist(x,y)

Evaluation function The evaluation function assigns a number to each candidate solution, indicating its quality. TSP: map each tour to its corresponding total distance. When choosing the evaluation function it must have the best value when the solution is found.

Evaluation function SAT: every approximate solution evaluates to FALSE and this doesn’t give us any useful information on how to improve one candidate solution to other, or how to search for better alternative.

Tiling 64 squares = 32*2 62 squares = 31*2

Tiling 64 squares = 32*2 62 squares = 31*2

Matches and triangles Given 6 matches construct 4 equilateral triangles where the length of each side is equal to the length of a match. 2 triangles, 5 matches (1 match remaining): We are searching in the wrong search space!!!

Matches and triangles Given 6 matches construct 4 equilateral triangles where the length of each side is equal to the length of a match. 2 triangles, 5 matches (1 match remaining): We are searching in the wrong search space!!! Solution!

Mr. and Mrs. Smith’s party

Mr. and Mrs. Smith’s party

Mr. and Mrs. Smith’s party

Mr. and Mrs. Smith’s party Mrs. Smith is person 4.