Artificial Intelligence Lecture 10. Outline Problem Solving using Search Search consists of –state space –operators –start state –goal states A Search.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Knowledge Representation
Advertisements

Heuristic Search techniques
Problem solving with graph search
State Space Representation and Search
CSC411Artificial Intelligence 1 Chapter 3 Structures and Strategies For Space State Search Contents Graph Theory Strategies for Space State Search Using.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Part2 AI as Representation and Search
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Search Techniques MSc AI module. Search In order to build a system to solve a problem we need to: Define and analyse the problem Acquire the knowledge.
Chapter 5 Decrease and Conquer. Homework 7 hw7 (due 3/17) hw7 (due 3/17) –page 127 question 5 –page 132 questions 5 and 6 –page 137 questions 5 and 6.
CSC 423 ARTIFICIAL INTELLIGENCE
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
C++ Programming: Program Design Including Data Structures, Third Edition Chapter 21: Graphs.
CSE332: Data Abstractions Lecture 16: Topological Sort / Graph Traversals Tyler Robison Summer
CSE332: Data Abstractions Lecture 16: Topological Sort / Graph Traversals Dan Grossman Spring 2010.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Structures and Strategies for State Space Search
Structures and Strategies for State Space Search
Artificial Intelligence Chapter 3: Solving Problems by Searching
Using Search in Problem Solving
Using Search in Problem Solving
1 Structures and Strategies for State Space Search 3 3.0Introduction 3.1Graph Theory 3.2Strategies for State Space Search 3.3Using the State Space to Represent.
Chapter 5.4 Artificial Intelligence: Pathfinding.
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.
Solving Problems by Searching
State-Space Searches.
Binary Trees Chapter 6.
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
3.0 State Space Representation of Problems 3.1 Graphs 3.2 Formulating Search Problems 3.3 The 8-Puzzle as an example 3.4 State Space Representation using.
Chapter 5.4 Artificial Intelligence: Pathfinding.
Artificial Intelligence Lecture 9. Outline Search in State Space State Space Graphs Decision Trees Backtracking in Decision Trees.
MA/CSSE 473 Day 12 Insertion Sort quick review DFS, BFS Topological Sort.
Chapter 2 Graph Algorithms.
Artificial Intelligence LECTURE 3 ARTIFICIAL INTELLIGENCE LECTURES BY ENGR. QAZI ZIA 1.
Chapter 14 Graphs. © 2004 Pearson Addison-Wesley. All rights reserved Terminology G = {V, E} A graph G consists of two sets –A set V of vertices,
Representing and Using Graphs
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Today’s Topics FREE Code that will Write Your PhD Thesis, a Best-Selling Novel, or Your Next Methods for Intelligently/Efficiently Searching a Space.
CS 415 – A.I. Slide Set 5. Chapter 3 Structures and Strategies for State Space Search – Predicate Calculus: provides a means of describing objects and.
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.
Lecture 13 Jianjun Hu Department of Computer Science and Engineering University of South Carolina CSCE350 Algorithms and Data Structure.
Graph Traversal BFS & DFS. Review of tree traversal methods Pre-order traversal In-order traversal Post-order traversal Level traversal a bc d e f g hi.
Discrete Structures Trees (Ch. 11)
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Basic Problem Solving Search strategy  Problem can be solved by searching for a solution. An attempt is to transform initial state of a problem into some.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Ver Chapter 13: Graphs Data Abstraction & Problem Solving with C++
Artificial Intelligence Lecture No. 6 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
© 2006 Pearson Addison-Wesley. All rights reserved 14 A-1 Chapter 14 Graphs.
Search in State Spaces Problem solving as search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way.
Solving problems by searching A I C h a p t e r 3.
February 11, 2016Introduction to Artificial Intelligence Lecture 6: Search in State Spaces II 1 State-Space Graphs There are various methods for searching.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Discrete Structures Li Tak Sing( 李德成 ) Lectures
Introduction to Artificial Intelligence
Problem Solving by Searching
CS Fall 2016 (Shavlik©), Lecture 8, Week 5
State-Space Searches.
State-Space Searches.
State-Space Searches.
Presentation transcript:

Artificial Intelligence Lecture 10

Outline Problem Solving using Search Search consists of –state space –operators –start state –goal states A Search Tree is an efficient way to represent a search There are a variety of specific search techniques, including –Depth-First Search –Breadth-First Search –Others which use heuristic knowledge (in future lectures)

What do these problems have in common? Find the layout of chips on a circuit board which minimize the total length of interconnecting wires Write a program which can play chess against a human Build a system which can find human faces in an arbitrary digital image Decrypt data which has been encrypted but you do not have the key Answer –they can all be formulated as search problems

Setting Up a State Space Model State-space Model is a Model for The Search Problem –usually a set of discrete states X e.g., in driving, the states in the model could be towns/cities Start State - a state from X where the search starts Goal State(s) –a goal is defined as a target state –For now: all goal states have utility 1, and all non-goals have utility 0 –there may be many states which satisfy the goal e.g., drive to a town with an airport –or just one state which satisfies the goal e.g., drive to Las Vagas Operators –operators are mappings from X to X e.g. moves from one city to another that are connected with a road (legal)

Summary: Defining Search Problems A statement of a Search problem has 4 components 1. A set of states 2. A set of “operators” which allow one to get from one state to another 3. A start state S 4. A set of possible goal states G, or ways to test for goal states Search solution consists of –a sequence of operators which transform S into a a unique goal state G (this is the sequence of actions the we would take to maximize the success function) Representing real problems in a search framework –may be many ways to represent states and operators –key idea: represent only the relevant aspects of the problem

Example 1: Formulation of Map Problem Set of States –individual cities –e.g., San Francisco, Seattle, Las Vegas, Phoenix, Chicago Operators –freeway routes from one city to another –e.g. San Francisco to Seattle, etc Start State –current city where we are, San Francisco Goal States –set of cities we would like to be in –e.g., cities which are cooler than Seattle Solution –a sequence of operators which get us a specific goal city, e.g., Irvine to SF via 5, SF to Reno via 80, etc

State Space Graph: Map Navigation not to be confused with Search Tree!! S G A B D E C F S = start, G = goal, other nodes = intermediate states, links = legal transitions

Abstraction Definition of Abstraction: Navigation Example: how do we define states and operators? –First step is to abstract “the big picture” i.e., solve a map problem nodes = cities, links = freeways/roads (a high-level description) this description is an abstraction of the real problem –Can later worry about details like freeway onramps, refueling, etc Abstraction is critical for automated problem solving –must create an approximate, simplified, model of the world for the computer to deal with: real-world is too detailed to model exactly –good abstractions retain all important details Process of removing irrelevant detail to create an abstract representation: ``high-level”, ignores irrelevant details

Qualities of a Good Representation Given a good representation/abstraction, solving a problem can be easy! Conversely, a poor representation makes a problem harder Qualities which make a Representation useful: –important objects and relations are emphasized –irrelevant details are suppressed –natural constraints are made explicit and clear –completeness –concise –efficient

Example 2: Puzzle-Solving as Search You have a 3-gallon and a 4-gallon You have a faucet with an unlimited amount of water You need to get exactly 2 gallons in 4-gallon jug State representation: (x, y) –x: Contents of four gallon –y: Contents of three gallon Start state: (0, 0) Goal state(s) G = {(2, 0), (2, 1), (2, 2)} Operators –Fill 3-gallon (0,0)->(0,3), fill 4-gallon (0,0)->(4,0) –Fill 3-gallon from 4-gallon (4,0)->(1,3), –Fill 4-gallon from 3-gallon (0,3)->(3,0) or (1,3)->(4,0) or (2,2)->(4,0)…. –Empty 3-gallon into 4-gallon, empty 4-gallon into 3-gallon –Dump 3-gallon down drain (0,3)->(0,0), dump 4-gallon down drain (4,0)->(0,0)

Example 3: The “8-Puzzle” Problem Goal State Start State

Search Basics When the answer is not straight foreword, you must search for a solution. But because of the sheer magnitude of some situations, it is hard to incorporate into AI. Combination explosions cause the sheer magnitude of these problems. Combination explosions are when the possibilities for a solution explode (increase very rapidly) The math field of combinatorics study how these combination explosions occur. The commonly accepted theorem states that the number of ways N objects can be combined equals N! (N factorial). Because of the enormous number of possibilities, it is almost never a good idea to try every single possibility

Search Basics (Definitions) Node: A discrete point and possible goal Terminal Node: A node that ends a path Search Space: The set off all nodes Goal: The node that is the object of the search Heuristic: Information about the likelihood that any specific node is a better choice to try next, rather than another node Solution Path: A directed graph of the nodes visited that lead to the solution

Search Space Most search spaces are in the form of a tree. A tree looks like an upside down tree that contains nodes. The following is an example of a tree:

Evaluation of Searching Algorithm Evaluating a search technique can sometimes be very difficult. But the most basic measuring techniques are: –Speed in which the solution is found –The quality of the solution Both criterions are basically equally important, but in some case one might take priority over the other.

DFS The Depth-First search explores each possible path to find the path's conclusion or the goal. If the path does not contain the goal the search tries another path by backtracking. The following image shows the path the search takes when trying to find the goal ‘F':

DFS (Conclusion) As you can see, the search almost had to check every node in order to find the answer, but it did find the right answer. This search is very reliable but sometimes can take a long time or even turn into an exhaustive search (a search that looks a every point until it reaches the goal). The Depth-First search can also be modified to go from the right to the left

DFS (Pros and Cons) Advantages: –Always finds the goal Disadvantages: –Often can be slow –Can result in an exhaustive search –Can get stuck in long paths that don't lead to the goal

BFS The Breadth-First search technique is exactly the same as the Depth-First except that the Breadth-First checks each node on a level until it proceeds to the next level. The example below demonstrates this technique with the goal of node ‘C':

BFS (Pros and Cons) Advantages: –Always finds the goal –Good for shallow trees Disadvantages: –Often can be slow in deep trees –Can result in an exhaustive search

Hill-Climbing search The Hill-Climbing search uses heuristics to find the direction which leads towards the goal. The name "hill-climbing" comes from an analogy: – A hiker is lost halfway up/down (depends on if you are an optimist) a mountain at night. His camp is at the top of the mountain. Even though it is dark, the hiker knows that every step he takes up the mountain is a step towards his goal. So a hill-climbing search always goes to the node closest to the goal.

Traversal of graphs To traverse means to visit the vertices (nodes) in some systematic order.vertices Various traversal methods for trees are: –preorder: visit each node before its children. –postorder: visit each node after its children. –inorder (for binary trees only): visit left –subtree, node, right subtree. A small portion of a tree (Maybe in shortest path).

Examples of undirected graphs Observe that 1. Every free tree with n vertices contains exactly n - 1 edges 2. If we add any edge to a free tree, we get a cycle

Depth First and Breadth First Search VertexAdj. List a(b, c, d, e) b(a, d, e) c(a, f, g) d(a, b, e) VertexAdj. List e(a, b, d) f(c, g) g(c, f)

Depth First Search (DFS) DFS of an undirected graph involves only two types of arcs. 1. Tree arcs. 2. Back arcs (there is no distinction between back arcs and forward arcs) Cross arcs also don't exist because given any two vertices, if there exists an arc between them, then one of them will be an ancestor and the other a descendant in the DFS.

Breadth First Search Breadth First Search is also known as Forward- Chaining Graph search algorithms must eliminate loops from solution path

Heuristic Search A heuristic is a method that might not always find the best solution but is guaranteed to find a good solution in reasonable time. –By sacrificing completeness it increases efficiency. –Useful in solving tough problems which could not be solved any other way. solutions take an infinite time or very long time to compute. The classic example of heuristic search methods is the travelling salesman problem. Heuristic Search methods Generate and Test AlgorithmHeuristic Search –generate a possible solution which can either be a point in the problem space or a path from the initial state. –test to see if this possible solution is a real solution by comparing the state reached with the set of goal states. –if it is a real solution, return. Otherwise repeat from 1. This method is basically a depth first search as complete solutions must be created before testing. It is often called the British Museum method as it is like looking for an exhibit at random. A heuristic is needed to sharpen up the search.

Questions & Answers ???????