P is a subset of NP Let prob be a problem in P There is a deterministic algorithm alg that solves prob in polynomial time O(n k ), for some constant k.

Slides:



Advertisements
Similar presentations
Induction of Decision Trees (IDT)
Advertisements

Proof of correctness; More reductions
Introduction to Algorithms NP-Complete
Learning from Observations Chapter 18 Section 1 – 3.
Machine Learning A Quick look Sources:
Homework. Homework (next class) Read Chapter 2 of the Experience Management book and answer the following questions: Provide an example of something that.
NP-complete and NP-hard problems Transitivity of polynomial-time many-one reductions Concept of Completeness and hardness for a complexity class Definition.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Tractable and intractable problems for parallel computers
Graphs 4/16/2017 8:41 PM NP-Completeness.
1 Polynomial Church-Turing thesis A decision problem can be solved in polynomial time by using a reasonable sequential model of computation if and only.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
1 Polynomial Time Reductions Polynomial Computable function : For any computes in polynomial time.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
88- 1 Chapter 8 The Theory of NP-Completeness P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class.
Analysis of Algorithms CS 477/677
LEARNING DECISION TREES
Chapter 11: Limitations of Algorithmic Power
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
Ref: Pfleeger96, Ch.31 NP-Complete Problems Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
February 20, 2015CS21 Lecture 191 CS21 Decidability and Tractability Lecture 19 February 20, 2015.
Induction of Decision Trees (IDT) CSE 335/435 Resources: – –
Information Theory and Games (Ch. 16). Information Theory Information theory studies information flow Under this context information has no intrinsic.
Themes of Presentations Rule-based systems/expert systems (Catie) Software Engineering (Khansiri) Fuzzy Logic (Mark) Configuration Systems (Sudhan) *
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
INTRODUCTION TO MACHINE LEARNING. $1,000,000 Machine Learning  Learn models from data  Three main types of learning :  Supervised learning  Unsupervised.
Inductive learning Simplest form: learn a function from examples
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Artificial Intelligence
Machine Learning A Quick look Sources: Artificial Intelligence – Russell & Norvig Artifical Intelligence - Luger By: Héctor Muñoz-Avila.
Lecture 22 More NPC problems
LEARNING DECISION TREES Yılmaz KILIÇASLAN. Definition - I Decision tree induction is one of the simplest, and yet most successful forms of learning algorithm.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
Space Complexity. Reminder: P, NP classes P NP is the class of problems for which: –Guessing phase: A polynomial time algorithm generates a plausible.
Learning from Observations Chapter 18 Through
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 024: Design & Analysis of Algorithms Chapter 9: NP Completeness Sedgewick Chp:40 David Luebke’s Course Notes / University of Virginia, Computer Science.
NP-COMPLETENESS PRESENTED BY TUSHAR KUMAR J. RITESH BAGGA.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Decision Trees. What is a decision tree? Input = assignment of values for given attributes –Discrete (often Boolean) or continuous Output = predicated.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-Completeness (Nondeterministic Polynomial Completeness) Sushanth Sivaram Vallath & Z. Joseph.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
CSE 6311 – Spring 2009 ADVANCED COMPUTATIONAL MODELS AND ALGORITHMS Lecture Notes – Feb. 3, 2009 Instructor: Dr. Gautam Das notes by Walter Wilson.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
COMPLEXITY. Satisfiability(SAT) problem Conjunctive normal form(CNF): Let S be a Boolean expression in CNF. That is, S is the product(and) of several.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
NP-Completeness A problem is NP-complete if: It is in NP
The NP class. NP-completeness
Advanced Algorithms Analysis and Design
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
Hard Problems Introduction to NP
Chapter 11 Limitations of Algorithm Power
NP-Complete Problems.
CS154, Lecture 13: P vs NP.
The Theory of NP-Completeness
P is a subset of NP Let prob be a problem in P
CSE 589 Applied Algorithms Spring 1999
Machine Learning: Decision Tree Learning
Presentation transcript:

P is a subset of NP Let prob be a problem in P There is a deterministic algorithm alg that solves prob in polynomial time O(n k ), for some constant k That same algorithm alg runs in a nondeterminsitc machine (it just do not use the oracle) Thus, alg has the same polynomial complexity, O(n k ) Thus, prob is in NP

Why Guess & Check Implies NP If a problem prob satisfies Guess and Check prob …. solution The nondeterministic version polynomial prob …. solution

Induction of Decision Trees CSE 335/435 Resources: – (article: Think About It: Artificial Intelligence & Expert Systems ) – –

Motivation # 1: Analysis Tool Suppose that a company have a data base of sales data, lots of sales data How can that company’s CEO use this data to figure out an effective sales strategy Safeway, Giant, etc cards: what is that for?

Motivation # 1: Analysis Tool (cont’d) Ex’ple Bar Fri Hun Pat TypeReswai t x1 no yes some french yes x4 no yes full thai no yes x5 no yes no full french yes no x6 x7 x8 x9 x10 x11 Sales data “if buyer is male & and age between & married then he buys sport magazines” induction Decision Tree

Motivation # 1: Analysis Tool (cont’d) Decision trees has been frequently used in IDSS Some companies: SGI: provides tools for decision tree visualization Acknosoft (France), Tech:Inno (Germany): combine decision trees with CBR technology Several applications Decision trees are used for Data Mining

Parenthesis: Expert Systems Have been used in (Sweet; How Computers Work 1999):  medicine  oil and mineral exploration  weather forecasting  stock market predictions  financial credit, fault analysis  some complex control systems Two components:  Knowledge Base  Inference Engine

The Knowledge Base in Expert Systems A knowledge base consists of a collection of IF-THEN rules: if buyer is male & age between & married then he buys sport magazines if buyer is male & age between then he buys PC games magazines Knowledge bases of fielded expert systems contain hundreds and sometimes even thousands such rules. Frequently rules are contradictory and/or overlap

The Inference Engine in Expert Systems The inference engine reasons on the rules in the knowledge base and the facts of the current problem Typically the inference engine will contain policies to deal with conflicts, such as “select the most specific rule in case of conflict” Some expert systems incorporate probabilistic reasoning, particularly those doing predictions

Expert Systems: Some Examples MYCIN. It encodes expert knowledge to identify kinds of bacterial infections. Contains 500 rules and use some form of uncertain reasoning DENDRAL. Identifies interpret mass spectra on organic chemical compounds MOLGEN. Plans gene-cloning experiments in laboratories. XCON. Used by DEC to configure, or set up, VAX computers. Contained 2500 rules and could handle computer system setups involving modules.

Main Drawback of Expert Systems: The Knowledge Acquisition Bottle-Neck The main problem of expert systems is acquiring knowledge from human specialist is a difficult, cumbersome and long activity. NameKB #Rules Const. time (man/years) Maint. time (man/years) MYCIN KA N/A XCONKA KB = Knowledge Base KA = Knowledge Acquisition

Motivation # 2: Avoid Knowledge Acquisition Bottle-Neck GASOIL is an expert system for designing gas/oil separation systems stationed of-shore The design depends on multiple factors including: proportions of gas, oil and water, flow rate, pressure, density, viscosity, temperature and others To build that system by hand would had taken 10 person years It took only 3 person-months by using inductive learning! GASOIL saved BP millions of dollars

Motivation # 2 : Avoid Knowledge Acquisition Bottle-Neck NameKB #Rules Const. time (man/years) Maint. time (man/months) MYCIN KA N/A XCONKA GASOILIDT BMTKA (IDT) (0.3) 2 (0.1) KB = Knowledge Base KA = Knowledge Acquisition IDT = Induced Decision Trees

Example of a Decision Tree Patrons? noyes none some waitEstimate? no yes 0-10 >60 Full Alternate? Reservation? Yes no yes No no Bar? Yes no yes Fri/Sat? NoYes yes no yes Hungry? yes No Alternate? yes Yes no Raining? no yes no yes

Definition of A Decision Tree A decision tree is a tree where: The leaves are labeled with classifications (if the classification is “yes” or “no”. The tree is called a boolean tree) The non-leaves nodes are labeled with attributes The arcs out of a node labeled with an attribute A are labeled with the possible values of the attribute A

Some Properties of Decision Trees Decision trees represent rules (or more formally logical sentences):  r (patrons(r,full)  waitingTime(r,t)  t > 60   willWait(r)) Decision trees represent functions: F: Patrons × WaitExtimate × Hungry × type × Fri/Sat × Alternate × Raining  {True,False} F(Full, >60, _, _, _, _, _) = No F(Full,10-30,Yes,_,_,Yes,Yes) = Yes …

Some Properties of Decision Trees (II) Question: What is the maximum number of rows does the table defining F has assuming that each attribute A i has 2 values? Lets consider a Boolean function: F: A 1 × A 2 × … × A n  {Yes, No} F can obviously be represented in a table: A 1 A 2 … An An y/n

Some Properties of Decision Trees (III) Answer: 2 n because: F: A 1 × A 2 × … × A n  {Yes, No} 2 2 … 2 The number of possible combinations is 2 × 2 × … × 2 = 2 n This means that representing these tables and processing them requires a lot of effort Question: How many functions F: A 1 × A 2 × … × A n  {Yes, No} are there assuming that each attribute A i has 2 values? Answer: 2 # of rows in table = 2 2 n

Some Properties of Decision Trees (IV) We observed that given a decision tree, it can be represented as a Boolean function. Answer: Yes!. Make A 1 first node, A 2 second node, etc. (Brute force) Question: Given a Boolean function: F: A 1 × A 2 × … × A n  {Yes, No} Where each of A i can take a finite set of attributes. Can F be represented as a decision tree?

Some Properties of Decision Trees (V) Representing a table one may have several possible decision trees As an example, the next slide shows a table This table has at least 2 decision trees:  The example decision tree of the restaurant of Slide # 12  The brute force Which is the best decision tree, why?

Example Ex’ple Bar Fri Hun PatAltTypewait x1 no yes some yesFrench yes x4 no yes full yes Thai yes x5 no yes no full yesFrench no x6 yes no yes some noItalianyes x7 yes no none noBurgerno x8 no yes some no Thaiyes x9 yes no full noBurgerno x10 yes full yesItalianno x11 noNo no none no Thaino

Homework Assignment: 1.We never test the same attribute twice along one branch in a decision tree. Why not? 2.See next slides (Slide # 26 in particular)

Our Current List of NP-Complete Problems CNF-sat Circuit-sat (Input)OutputDecision Problem Answer is “yes” or “no” (CNF) values of variables making formula true (Circuit) values of input making the circuit’s output true “Are there values of variables making the CNF true?” “Are there values of input making the circuit’s output true?”

Complete Graphs A complete graph is one where there is an edge between every two nodes A C B G

Clique Clique: A complete subgraph of a graph A C B D F G E H Problem (Clique): Find the clique with the largest number of nodes in a graph

Clique is NP-Complete Proving NP completeness can be difficult Clique CNF-sat Circuit-sat Homework

CNF Can Be Reduced into Clique Why we need to formulate the decision problem? First we need to formulate Clique as a decision problem: Decision Problem (Clique): Given a graph and a value K, is there a clique of size K (i.e., with K nodes) in the graph? Because we want to show a reduction such that the decision problem for CNF-sat is true if and only if the decision problem for the Clique is true