Intelligence Artificial Intelligence Ian Gent Search: 1.

Slides:



Advertisements
Similar presentations
Uninformed Search in Prolog
Advertisements

Artificial Intelligence: Knowledge Representation
Analysis of Algorithms
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
CS16: Introduction to Data Structures & Algorithms
Heuristic Search techniques
Announcements Course TA: Danny Kumar
1 Directed Depth First Search Adjacency Lists A: F G B: A H C: A D D: C F E: C D G F: E: G: : H: B: I: H: F A B C G D E H I.
Intelligence Artificial Intelligence Ian Gent Search: 2.
CS1022 Computer Programming & Principles
Intelligence Artificial Intelligence Ian Gent Games 1: Game Tree Search.
Intelligence Artificial Intelligence Ian Gent Search: 3.
Intelligence Artificial Intelligence Ian Gent Constraint Programming 1.
Problems and Their Classes
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Complexity ©D.Moshkovits 1 Where Can We Draw The Line? On the Hardness of Satisfiability Problems.
Week 1.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
CSM6120 Introduction to Intelligent Systems
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Intelligence Artificial Intelligence Ian Gent Search: 4 Search Heuristics.
The Theory of NP-Completeness
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
The Theory of NP-Completeness
Chapter 11: Limitations of Algorithmic Power
1 Algorithm Strategies. 2 Introduction zAlgorithms may be grouped into categories or types. zThis is based upon how they go about finding a solution to.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
NP and NP- Completeness Bryan Pearsaul. Outline Decision and Optimization Problems Decision and Optimization Problems P and NP P and NP Polynomial-Time.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Computational Complexity Polynomial time O(n k ) input size n, k constant Tractable problems solvable in polynomial time(Opposite Intractable) Ex: sorting,
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.
Depth First Search Prof. S M Lee Department of Computer Science.
BackTracking CS335. N-Queens The object is to place queens on a chess board in such as way as no queen can capture another one in a single move –Recall.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
Artificial Intelligence Search and Heuristics. “Can a machine think?” Alan Turing asked this question in the 1950 article titled Computing Machinery and.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Chapter 3 Algorithms Complexity Analysis Search and Flow Decomposition Algorithms.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Ricochet Robots Mitch Powell Daniel Tilgner. Abstract Ricochet robots is a board game created in Germany in A player is given 30 seconds to find.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Computability NP complete problems. Space complexity. Homework: [Post proposal]. Find PSPACE- Complete problems. Work on presentations.
Space Complexity. Reminder: P, NP classes P is the class of problems that can be solved with algorithms that runs in polynomial time NP is the class of.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Optimization Problems The previous examples simply find a single solution What if we have a cost associated with each solution and we want to find the.
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.
Artificial Intelligence Solving problems by searching.
Lecture 3: Uninformed Search
The Theory of NP-Completeness
BackTracking CS255.
Introduction to Artificial Intelligence
Lecture 22 Complexity and Reductions
Problem Solving by Searching
Analysis and design of algorithm
CLASSES P AND NP.
Chapter 11 Limitations of Algorithm Power
Search Exercise Search Tree? Solution (Breadth First Search)?
Artificial Intelligence
Artificial Intelligence
Artificial Intelligence
The Theory of NP-Completeness
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #2
Solving Problems by Searching
Week 11 - Wednesday CS221.
Presentation transcript:

Intelligence Artificial Intelligence Ian Gent Search: 1

Intelligence Artificial Intelligence Part I :What is Search? Part II: Presenting search abstractly Part III: Basic search algorithms Search: 1

3 What is AI? zVery hard to define Artificial Intelligence ynot attempt at building machine to pass Turing Test zPerhaps, exploiting power of machines to do tasks normally considered intelligence? zPractical day to day answer is: zAI is what we don’t know how to do yet yOnce we know how to do something, it’s not AI ye.g. optical character recognition, speech recognition yMany AI problems involve combinatorial search

4 Example Search Problem: SAT zWe need to define problems and solutions zPropositional Satisfiability (SAT) yreally a logical problem -- I’ll present as a letters game zProblem is a list of words ycontains upper and lower case letters (order unimportant) ye.g. ABC, ABc, AbC, Abc, aBC, abC, abc zSolution is choice of upper/lower case letter yone choice per letter yeach word to contain at least one of our choices ye.g. AbC is unique solution to above problem.

5 Why is SAT a search problem? zThere is no efficient algorithm known for SAT yall complete algorithms are exponential time z3-SAT is NP-Complete y3-SAT = each word contains exactly 3 letters zNP-Complete ywe can recognise solutions in polynomial time xeasy to check letter choice satisfies each word yall other NP problems can be solved by translation to SAT zMany AI problems fall into NP-Complete class

6 Example: Travelling Salesperson zProblem: graph with an cost for each edge ye.g. zSolution: tour visiting all nodes returning to base ymeeting some cost limit (or reaching minimum cost) ye.g. minimum cost is 21 above zTSP is NP-Complete yeasy to check that tour costs no more than limit y(finding optimal cost in technically different complexity class)

7 Example (Not): Sorting zProblem, a list of numbers ye.g zSolution, list in ascending order ye.g zIn NP (easy to check that result in ascending order) zNot NP-complete ycannot solve SAT via sorting ycan be solved in O(n log n) time zWe know how to do it efficiently, so it’s not AI

8 Final Example: Games zProblem: a position in a Chess/Go/… game zSolution: a strategy to guarantee winning game zHarder than NP problems yit is not easy to check that a strategy wins ycan solve SAT via games zTechnically, games usually PSPACE-complete yAll NP-complete problems in PSPACE z Games are valid AI application zAI usually attacks NP-complete or harder search problems

9 Presenting Search Abstractly zHelps to understand the abstract nature of search ysearch states, search spaces, search trees… yknow what particular search algorithms are trying to do zThere are two kinds of search algorithm yComplete xguaranteed to find solution or prove there is none yIncomplete xmay not find a solution even when it exists xoften more efficient (or there would be no point) xe.g. Genetic Algorithms zFor now concerned with complete algorithms

10 Search States zSearch states summarises the state of search zA solution tells us everything we need to know ye.g. in SAT, whether each letter is UPPER or lower case yin TSP, route taken round nodes of graph zThis is a (special) example of a search state yit contains complete information yit solves the problem zIn general a search state may not do either of those yit may not specify everything about a possible solution yit may not solve the problem or extend to a solution

11 Search States zSearch states summarise the state of search zE.g. in SAT ya search state might be represented by aB zE.g. in TSP ya search state might specify some of the order of visits zE.g. in Chess ya search state might be represented by the board position x(quiz for chessplayers: …and what else?)

12 Generalising Search zWith search states we can generalise search ynot just finding a solution to a problem zGenerally, find a solution which extends search state ye.g. find solution to ABC, ABc, AbC, Abc, aBC, abC, abc which extends aB ythere is no such solution though whole problem solvable zOriginal search problem is to extend null state zSearch in AI by structured exploration of search states

13 Search Space and Search Trees zSearch space is logical space composed of ynodes are search states ylinks are all legal connections between search states xe.g. in chess, no link between states where W castles having previously moved K. yalways just an abstraction ythink of search algorithms trying to navigate this extremely complex space

14 Search Trees zSearch trees do not summarise all possible searches yinstead an abstraction of one possible search zRoot is null state zedges represent one choice ye.g. to set value of A first zchild nodes represent extensions ychildren give all possible choices zleaf nodes are solutions/failures zExample in SAT yalgorithm detects failure early yneed not pick same variables everywhere

15 Why are search trees abstract? zSearch trees are very useful concept ybut as an abstraction zSearch algorithms do not store whole search trees ythat would need exponential space ywe can discard nodes in search tree already explored zSearch algorithms store frontier of search yI.e. nodes in search tree with some unexplored children zVery many search algorithms understandable in terms of search trees yand specifically how they explore the frontier

16 Some classic search algorithms zDepth-first search yI.e. explore all nodes in subtree of current node before any other nodes ypick leftmost and deepest element of frontier zBreadth-first search yexplore all nodes at one height in tree before any other nodes ypick shallowest and leftmost element of frontier zBest-first search ypick whichever element of frontier seems most promising

17 More classic search algorithms zDepth-bounded depth first search ylike depth first but set limit on depth of search in tree zIterative Deepening search yuse depth-bounded search but iteratively increase limit

18 Next week on Search in AI zPresentation of search algorithms in terms of lists ye.g. depth-first = stack, breadth-first = queue zHeuristics in search yhow to pick which variable to set