Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Artificial Intelligence: Knowledge Representation
Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
Artificial Intelligence Solving problems by searching
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Solving Problem by Searching
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Artificial Intelligence Problem Solving Eriq Muhammad Adams
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
EIE426-AICV 1 Blind and Informed Search Methods Filename: eie426-search-methods-0809.ppt.
CSC 423 ARTIFICIAL INTELLIGENCE
Artificial Intelligence (CS 461D)
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
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.
CS 380: Artificial Intelligence Lecture #3 William Regli.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Solving problems by searching
Problem-solving agents
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving problems by searching This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Artificial Intelligence
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 3 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
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.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 3 –Problem Solving Agents State space search –Programming Assignment Thursday.
Solving problems by searching A I C h a p t e r 3.
G5AIAI Introduction to AI
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
WEEK 5 LECTURE -A- 23/02/2012 lec 5a CSC 102 by Asma Tabouk Introduction 1 CSC AI Basic Search Strategies.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
ARTIFICIAL INTELLIGENCE
Solving problems by searching
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Artificial Intelligence Lecture No. 6
Problem Solving by Searching
Artificial Intelligence
Solving problems by searching
Solving problems by searching
Artificial Intelligence
Solving problems by searching
Solving problems by searching
ARTIFICIAL INTELLIGENCE
Solving problems by searching
Solving Problems by Searching
Solving problems by searching
Presentation transcript:

Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information Systems

Dr.Abeer Mahmoud (CHAPTER-3) PROBLEM SOLVING AND SEARCH

Dr.Abeer Mahmoud WHY SEARCH? 3 Not just city route search –Many AI problems can be posed as search Game-playing: Sequence of moves to win a game. Speech Recognition Sequence of moves to recognize the speech O Shortest path on a map. o Search : Finding a good/best solution to a problem amongst many possible solutions. Many AI problems can be posed as search If goal found=>success; else, failure

Dr.Abeer Mahmoud CHAPTER OUTLINE Problem-solving agents Problem types, formulation & Examples Basic search algorithms 4 1.Uninformed search algorithms (blind search) o (these algorithms are given no information about the problem other than its definition) 2.Informed search algorithms (heuristic search ) o (these algorithms have some idea of where to look for solutions and whether one non goal state is more promising than another in reaching goal)

Dr.Abeer Mahmoud 5 Problem-solving agents

Dr.Abeer Mahmoud 6  The simplest agent (reflex agent) which base their actions on direct mapping from states to actions  Disadv: such agent cannot operate well in environments for which this mapping would be too large  But Goal based agents can achieve successes by considering future actions desirability of their outcomes  On kind of goal based agent called problem solving agent  Problem solving agents : decide what to do by finding sequences of actions that lead to desirable states

Dr.Abeer Mahmoud 7 Problem types, formulation & Examples

Dr.Abeer Mahmoud How problem is solved? Step 1Goal formulation Step 2.Problem formulation – a process of deciding what actions and states to consider Step 3 Search – systematic exploration of the sequence of alternative states that appear in a problem solving process Step 4 Solution – reach the right action Step 5 Execution – recommended actions can be accomplished

Dr.Abeer Mahmoud 9 1.Define the problem and its solution FormulateSearchExecutes

Dr.Abeer Mahmoud 10 1.Define the problem and its solution  Agent task is to find out which sequence of actions will get to a goal state  Hence, before it can do this, it needs to decide what sorts of actions & states to consider Formulate

Dr.Abeer Mahmoud 11  Ex, if agent will consider details “move left foot forward an inch ” or “ turn the steering wheel one degree left”, then the agent will probably never find a way out…….why?  Because at this level of details there are too many steps to find solution Formulate Formulate =The process of deciding actions and states to consider 1.Define the problem and its solution

Dr.Abeer Mahmoud 12  If agent has a map (additional knowledge), finding the best choice= Search  Ex, if agent at a specific city “Riyad” and “ want to go Madenah”, and there are three paths to achieve the goal then which to select ? May be random? Search Search Algorithm =takes problem as input and returns a solution in the form of an action sequence 1.Define the problem and its solution

Dr.Abeer Mahmoud 13 Requirements of a good search strategy: 1. It causes motion Otherwise, it will never lead to a solution. 2. It is systematic Otherwise, it may use more steps than necessary. 3. It is efficient Find a good, but not necessarily the best, answer. Search 1.Define the problem and its solution

Dr.Abeer Mahmoud 14  Once a solution is found the action it recommends can be carried out Executes 1.Define the problem and its solution

Dr.Abeer Mahmoud 15 Initial stateOperatorNeighbour hood (Successor Function) State Space Goal testPath cost The initial state of the problem, defined in some suitable manner A set of actions that moves the problem from one state to another The set of all possible states reachable from a given state The set of all states reachable from the initial state A test applied to a state which returns if we have reached a state that solves the problem How much it costs to take a particular path 1.Define the problem and its solution

Dr.Abeer Mahmoud 16 Examples

Dr.Abeer Mahmoud Example: Traveling in Romania

Dr.Abeer Mahmoud State-space Problem Formulation A problem is defined by four items: 1. initial state e.g., "at Arad“ 2. actions or successor function S(x) = set of action–state pairs e.g., S(Arad) = {, … } 3. goal test (or set of goal states) e.g., x = "at Bucharest”, Checkmate(x) 4. path cost (additive) e.g., sum of distances, number of actions executed, etc. c(x,a,y) is the step cost, assumed to be ≥ 0 A solution is a sequence of actions leading from the initial state to a goal state

Dr.Abeer Mahmoud Problem Ex: The 8-puzzle states? operators? goal test? path cost? Initial stateGoal state 19

Dr.Abeer Mahmoud states? locations of tiles operators? move blank left, right, up, down goal test? = goal state (given) path cost? 1 per move Problem Ex: The 8-puzzle Initial stateGoal state 20

Dr.Abeer Mahmoud Problem Ex: The 8-queens problem 21

Dr.Abeer Mahmoud states? -any arrangement of n<=8 queens -such that no queen attacks any other.[not on same row or same column or diagonal] initial state? no queens on the board actions? - add queen to any empty square -or add queen to leftmost empty square such that it is not attacked by other queens. goal test? 8 queens on the board, none attacked. path cost? 1 per move Problem Ex: The 8-queens problem

Dr.Abeer Mahmoud 23 State Space Search: Water Jug Problem “You are given two jugs, a 4-litre one and a 3-litre one. Neither has any measuring markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 litres of water into 4-litre jug.” 4-litre 3-litre

Dr.Abeer Mahmoud 24 4-litre 3-litre AB

Dr.Abeer Mahmoud 25 A empty B 4-litre 3-litre

Dr.Abeer Mahmoud 26 A B empty 4-litre 3-litre

Dr.Abeer Mahmoud 27 A B empty 4-litre 3-litre Fill B from A

Dr.Abeer Mahmoud 28 A 1 B litre 3-litre Fill B from A

Dr.Abeer Mahmoud 29 A 1 B 4-litre 3-litre empty B

Dr.Abeer Mahmoud 30 A 1 B 4-litre 3-litre Transmit from A to B

Dr.Abeer Mahmoud 31 A B 1 4-litre 3-litre Fill A again

Dr.Abeer Mahmoud 32 A B 1 4-litre 3-litre Fill A again

Dr.Abeer Mahmoud 33 A 2 1 B litre 3-litre Transmit from A to B

Dr.Abeer Mahmoud 34 A 2 1 B 4-litre 3-litre empty B goal

Dr.Abeer Mahmoud Water Jug Problem: A State Space Search State space: set of ordered pairs of integers (x, y) such as x = 0,1,2,3, or 4 for amount of water in 4-gallon jug, y = 0, 1, 2, or 3 for amount of water in the 3-gallon jug. The start state : (0,0). The goal state : is (2,n) for any value of n.

Dr.Abeer Mahmoud 36 After formulating the problem, a search through the states is needed to find a solution

Dr.Abeer Mahmoud 37 One of searching techniques is search tree or graph A state is a (representation of) a physical configuration. A node is a data structure constituting part of a search tree includes : state, parent node, action, path cost g(x).

Dr.Abeer Mahmoud 38 Many ways to represent node, ex : data structure with 5 components stateParent node actionPath costdepth The state in state space which the node corresponds The node in search tree that generated this node The action that was applied to parent to generate the node Cost from initial state to the node The number of steps along the path from the initial states Implementing a Search-What we need to store

Dr.Abeer Mahmoud 39  Search process constructs a “Search tree”  Root is the start node (initial state).  Leaf nodes are: unexpanded nodes (in the nodes list).  “ dead ends ” (nodes that aren’t goals and have no successors).  Solution desired may be: just the goal state. a path from start to goal state.  The search tree is the explicit tree generated during the search by the search strategy.  The search space is the implicit tree (OR graph) defined by initial state and the operators. State-Space Search Algorithm

Dr.Abeer Mahmoud 40 Tree Search Algorithms Basic idea:  offline, simulated exploration of state space by generating successors of already-explored states (expanding states).

Dr.Abeer Mahmoud 41 Search Space of Vacuum World Problem: Graph

Dr.Abeer Mahmoud 42 Search Space of Vacuum World Problem: Tree

Dr.Abeer Mahmoud 43 How Good is the found Solution?

Dr.Abeer Mahmoud Completeness -Is the strategy guaranteed to find a solution if there is a one Time Complexity - How long does it take to find a solution? 44 Space Complexity How much memory does it take to perform the search? Optimality Does the strategy find the optimal solution where there are several solutions?

Dr.Abeer Mahmoud Actions in Searching a Tree Fundamental actions (operators) that you can take: 1. “Expand”: Ask a node for its children 2. “Test”: Test a node for whether it is a goal Undiscovered Nodes The set of nodes that have not yet been discovered as being reachable from the root 45

Dr.Abeer Mahmoud 46 Fringe Nodes This is the set of nodes that (open nodes) – have been discovered – have not yet been “processed”: 1.have not yet expanded for the children 2.(have not yet tested if they are a goal ) Actions in Searching a Tree (cont..)

Dr.Abeer Mahmoud Actions in Searching a Tree (cont..) Visited Nodes This is the set of nodes that – have been discovered – have been processed: 1.have discovered all their children 2.(have tested whether are a goal) Also called – closed nodes 47

Dr.Abeer Mahmoud Action on finding a Goal “First match”: Usually we just want one goal, or just to know whether or not one exists on discovering a goal, then “return true” “All Matches”: Sometimes want all goals on discovering a goal, then record the fact that have found it, but continue with the search 48

Dr.Abeer Mahmoud Thank you End of Chapter 3-part1 49