ARTIFICIAL INTELLIGENCE

Slides:



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

Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Artificial Intelligence Solving problems by searching
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Artificial Intelligence for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CSC 423 ARTIFICIAL INTELLIGENCE
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
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.
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.
Artificial Intelligence Chapter 3: Solving Problems by Searching
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?
Using Search in Problem Solving
Solving problems by searching
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.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
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.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 02 : Search.
Search Tamara Berg CS 560 Artificial Intelligence Many slides throughout the course adapted from Dan Klein, Stuart Russell, Andrew Moore, Svetlana Lazebnik,
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
1 Solving problems by searching 171, Class 2 Chapter 3.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Lecture 3: 18/4/1435 Searching for solutions. Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
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.
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.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 3 –Problem Solving Agents State space search –Programming Assignment Thursday.
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.
Artificial Intelligence Solving problems by searching.
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
ARTIFICIAL INTELLIGENCE
Solving problems by searching
Breadth First and Depth First
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
ECE 448 Lecture 4: Search Intro
Introduction to Artificial Intelligence
Problem Solving as Search
Artificial Intelligence
Solving problems by searching
Lecture 1B: Search.
Problem Solving and Searching
Artificial Intelligence
Problem Solving and Searching
Artificial Intelligence Problem solving by searching CSC 361
Solving problems by searching
Solving problems by searching
Solving problems by searching
Problem Solving by Searching Search Methods :
Solving Problems by Searching
CS440/ECE 448 Lecture 4: Search Intro
Solving problems by searching
Presentation transcript:

ARTIFICIAL INTELLIGENCE CS 414 ARTIFICIAL INTELLIGENCE LECTURE 02

Agents An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through actuators.

Agents

Solving problems by searching We will consider the problem of designing goal-based agents in fully observable, deterministic, discrete, known environments. The agent must find a sequence of actions that reaches the goal. The performance measure is defined by reaching the goal and how “expensive” the path to the goal is

Search problem components Initial state : Actions : Transition model : What state results from performing a given action in a given state? Goal state : Path cost : Assume that it is a sum of nonnegative step costs

Search Space Definitions State A description of a possible state of the world Initial state the state in which the agent starts the search Goal test Conditions the agent is trying to meet Goal state Any state which meets the goal condition Action Function that maps (transitions) from one state to another

Example: Romania On vacation in Romania; currently in Arad and flight leaves tomorrow from Bucharest.

Example: Romania Initial state : Arad Actions : Go from one city to another Transition model : If you go from city A to city B, you end up in city B Goal state : Bucharest Path cost : Total distance traveled

State space The initial state, actions, and transition model define the state space of the problem. State space : The set of all states reachable from initial state by any sequence of actions. Can be represented as a directed graph where the nodes are states and links between nodes are actions.

Building Goal-Based Agents What are the key questions needing to be addressed? What goal does the agent need to achieve? What knowledge does the agent need? What actions does the agent need to do?

Search Example: Route Finding Actions: go straight, turn left, turn right Goal: shortest? fastest? most scenic?

Search Example: 8-Puzzle Actions: move tiles (e.g., Move2Down) Goal: reach a certain configuration

– Agent location and dirt location – How many possible states? Actions Example: Vacuum world Initial State States : – Agent location and dirt location – How many possible states? Actions – Left, right, suck Vacuum world state space graph

Example: River Crossing A farmer wants to get his cabbage, sheep, wolf across a river. He has a boat that only holds two. He and at most one item on boat. Unsupervised, wolf bites sheep, sheep eats cabbage. How should computers solve this?

Example: River Crossing State space S : all valid configurations Initial states = {(CSDF, _ )}  S Goal states G = {( _ , CSDF )}  S Cost(s,s’) = 1 for all transitions. Initial State Goal State

Example: River Crossing State space S :

Search Example: Water Jugs Problem Given 4-liter and 3-liter pitchers, how do you get exactly 2 liters into the 4-liter pitcher? 4 3

Water Jugs Problem State: (x, y) for # liters in 4-liter and 3-liter pitchers, respectively Actions: empty, fill, pour water between pitchers Initial state: (0, 0) Goal state: (2, *) 4 3

Actions / Successor Functions 1. (x, y | x < 4) (4, y) “Fill 4” 2. (x, y | y < 3) (x, 3) “Fill 3” 3. (x, y | x > 0) (0, y) “Empty 4” 4. (x, y | y > 0) (x, 0) “Empty 3” 5. (x, y | x+y ≥ 4 and y > 0) (4, y - (4 - x)) “Pour from 3 to 4 until 4 is full” 6. (x, y | x+y ≥ 3 and x > 0) (x - (3 - y), 3) “Pour from 4 to 3 until 3 is full” 7. (x, y | x+y ≤ 4 and y > 0) (x+y, 0) “Pour all water from 3 to 4”

State space

Solving problems by searching Problem solving We want: To automatically solve a problem We need: A representation of the problem Algorithms that use some strategy to solve the problem defined in that representation

Uninformed Search on Trees Uninformed means we only know: The goal test The successors() function But not which non-goal states are better For now, also assume state space is a tree Search process constructs a "search tree" root is the start state leaf nodes are: unexpanded nodes (in the Frontier list) "dead ends" (nodes that aren't goals and have no successors because no operators were applicable) goal node is last leaf node found

Uninformed Search Strategies Uninformed Search: strategies that order nodes without using any domain specific information, i.e., don’t use any information stored in a state BFS: breadth-first search Queue (FIFO) used for the Frontier remove from front, add to back DFS: depth-first search Stack (LIFO) used for the Frontier remove from front, add to front CLICK EACH SUB

Depth First Search ( DFS ) Expand deepest unexpanded node

Depth First Search ( DFS )

Depth First Search ( DFS )

Depth First Search ( DFS )

Depth First Search (DFS) Put start state in the agenda Loop Get a state from the agenda If goal, then return Expand state (put children to the front of agenda) Avoiding loops Don’t add a node to the agenda if it’s already in the agenda Don’t expand a node (or add it to the agenda) if it has already been expanded.

Depth-First Search (DFS) S start # of nodes tested: 0, expanded: 0 expnd. node Frontier {S} 5 2 4 A B C CLICK DESC: 1. interior nodes, 2. leaf nodes, 3. arcs 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 1, expanded: 1 expnd. node Frontier {S} S not goal {A,B,C} S start 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 2, expanded: 2 S start expnd. node Frontier {S} S {A,B,C} A not goal {D,E,B,C} 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 3, expanded: 3 S start expnd. node Frontier {S} S {A,B,C} A {D,E,B,C} D not goal {H,E,B,C} 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 4, expanded: 4 expnd. node Frontier {S} S {A,B,C} A {D,E,B,C} D {H,E,B,C} H not goal {E,B,C} S start 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 5, expanded: 5 expnd. node Frontier {S} S {A,B,C} A {D,E,B,C} D {H,E,B,C} H {E,B,C} E not goal {G,B,C} S start 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 6, expanded: 5 expnd. node Frontier {S} S {A,B,C} A {D,E,B,C} D {H,E,B,C} H {E,B,C} E {G,B,C} G goal {B,C} no expand S start 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 H

Depth-First Search (DFS) # of nodes tested: 6, expanded: 5 expnd. node Frontier {S} S {A,B,C} A {D,E,B,C} D {H,E,B,C} H {E,B,C} E {G,B,C} G {B,C} S start 5 2 4 A B C CLICK ONCE 9 4 6 2 D E 6 G goal 1 F 7 path: S,A,E,G cost: 15 H