State Spaces Introduction to Artificial Intelligence Dr. Robin Burke.

Slides:



Advertisements
Similar presentations
Artificial Intelligence: Knowledge Representation
Advertisements

Cooperating Intelligent Systems
Heuristic Search techniques
Announcements Course TA: Danny Kumar
Artificial Intelligence By Mr. Ejaz CIIT Sahiwal.
Problem Solving Well-formed predicate calculus expressions provide a means of describing objects and relations in a problem domain and inference rule.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Formal Description of a Problem
CSC 423 ARTIFICIAL INTELLIGENCE
Best-First Search: Agendas
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.
A RTIFICIAL I NTELLIGENCE Problem-Solving Solving problems by searching.
Chapter Two: Finite Automata
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
State-Space Searches. State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
Artificial Intelligence
Toy Problem: Missionaries and Cannibals
Problem solving by Searching Problem Formulation.
Intelligent agents Intelligent agents are supposed to act in such a way that the environment goes through a sequence of states that maximizes the performance.
Intelligent agents Intelligent agents are supposed to act in such a way that the environment goes through a sequence of states that maximizes the performance.
Dr Eleni Mangina – COURSE: LOGIC PROGRAMMING (during a joint degree with Fudan University in Software Engineering) DEPT. OF COMPUTER SCIENCE UCD Problem.
1 Chapter 3 Knowledge Representation. 2 Chapter 3 Contents l The need for a good representation l Semantic nets l Inheritance l Frames l Object oriented.
Artificial Intelligence Problem solving by searching CSC 361
Artificial Intelligence Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
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 Problem Solving We view many situations in life as problems we need to solve Also, much of human behavior can be considered problem solving, even if.
For Friday Finish chapter 3 Homework: –Chapter 3, exercise 6 –May be done in groups. –Clarification on part d: an “action” must be running the program.
Solving Problems by Searching
State-Space Searches.
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Copyright R. Weber Search in Problem Solving Search in Problem Solving INFO 629 Dr. R. Weber.
1 State Space of a Problem Lecture 03 ITS033 – Programming & Algorithms Asst. Prof.
Formal Description of a Problem In AI, we will formally define a problem as –a space of all possible configurations where each configuration is called.
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.
Knowledge and search, page 1 CSI 4106, Winter 2005 Knowledge and search Points Properties of knowledge  Completeness  Objectivity  Certainty  Formalizability.
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.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
For Friday Read chapter 4, sections 1 and 2 Homework –Chapter 3, exercise 7 –May be done in groups.
Problem Solving Agents
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Knowledge Representation Fall 2013 COMP3710 Artificial Intelligence Computing Science Thompson Rivers University.
Search as a problem solving technique. Consider an AI program that is capable of formulating a desired goal based on the analysis of the current world.
Solving problems by searching A I C h a p t e r 3.
G5AIAI Introduction to AI
ARTIFICIAL INTELLIGENCE
Knowledge Representation
The Decision-making Process
Problem solving by Searching
Heuristic Search Introduction to Artificial Intelligence
Introduction to Artificial Intelligence
Some problems Cse-402 K3r20,k3r23.
Problem Solving by Searching
Uninformed Search Introduction to Artificial Intelligence
Chapter Two: Finite Automata
Artificial Intelligence Problem solving by searching CSC 361
4. Computational Problem Solving
Some problems Cse-402 K3r20,k3r23.
A General Backtracking Algorithm
Problem Solving by Searching Search Methods :
Knowledge Representation
State-Space Searches.
ARTIFICIAL INTELLIGENCE
State-Space Searches.
State-Space Searches.
Problem Solving by Searching Search Methods :
Presentation transcript:

State Spaces Introduction to Artificial Intelligence Dr. Robin Burke

Details Moodle  still not set up TA  Ola Ayoola   contact her for any questions about assignments, marking, practicals,  contact me for content-related questions

Problem Solving Specific subarea of AI  solving well-defined puzzle-like problems Classic example  Three missionaries and three cannibals must cross a river using a boat which can carry at most two people, under the constraint that, for both banks, if there are missionaries present on the bank, they cannot be outnumbered by cannibals (if they were, the cannibals would eat the missionaries.) The boat cannot cross the river by itself with no people on board.  (originally, the “jealous husbands problem” from medieval times) Solution = the sequence of boat trips that will get the groups across

Problem Solving One of the first applications of AI  GPS (General Problem Solver)  Newell and Simon 1956 Logical puzzles  “8 puzzle”

Sudoku

Sudoku solved

An AI solution We need a representation  a formal description of the problem  the starting state of the problem  the termination condition (success)  the constraints  the possible moves We need an algorithm  how do we go about constructing a solution?

Steps to solution 1.Define the problem precisely 2.Create a representation capable of explicitly encoding all important aspects of the problem 3.Encode the problem in the representation 4.Select and apply appropriate problem- solving method

The Farmer Jones River Problem Farmer Jones owns a small boat (Bounty), goat, a pet wolf (don’t ask!), and a prize cabbage. To get to the annual cabbage show he must cross from the south bank of the river to the north bank, but Bounty will only allow him to travel with one other object (it’s a big cabbage!). If left unattended, the wolf will eat the goat and the goat will eat the cabbage. How can farmer Jones take his goat, wolf and cabbage to the show? ?

Problem There is a lot of extraneous detail in the description What really matters in the problem?  objects  states of the world  constraints Simplifying assumptions  can ignore rowing of the boat  can ignore tying the boat to the dock, etc.

States and Operators States  conditions of the world relative to the problem Special States  starting state (the problem)  ending state (the solution)  illegal states Operators  actions that take the world from one state to another

Farmer States Operators Also, constraints  states that are illegal

Representation Language How to encode the problem? We need to represent  the position of four objects we ignore the boat because the farmer is always with the boat  either north or south bank A natural choice is a tuple A?B?C?D? ( ),,, farmerwolfgoatcabbage

Represention Initial State  (S, S, S, S) Goal State  what constitutes a solution  (N, N, N, N)

Actions An action takes one state of the world and turns it into another Carry Goat North  start with a world in which the Goat is on the South bank  end up with a world in which the Goat is on the North bank  nothing else changes Representation  Move(Goat, North) (S, ?wolf, S, ?cabbage) => (N, ?wolf, N, ?cabbage)  ?wolf is a variable representing the position of the wolf  using variables saves me from having to write four rules

Constraints Certain states of the world are not permitted  wolf eats goat (only if farmer not present) (N, S, S, ?cabbage) (S, N, N, ?cabbage)  goat eats cabbage (only if farmer not present) (N, ?wolf, S, S) (S, ?wolf, N, N)

8-puzzle States? Operators?

Solving the Farmer Problem Representation is complete  there are eight actions  there are 2 4 = 16 states How to solve? Simplest approach  try all possible combinations of actions the shortest solution is seven steps there are 8 7 = about 2 million 7 step sequences  many combinations are impossible  some combinations lead to illegal situations Move(cabbage, north) can’t be the first move

Example – One Solution… One 7 step solution to the river problem. FWGC FWGC M-G-N S1: (S,S,S,S) F W G C M-G-N S2: (N,S,N,S) S8: (N,N,N,N) M-F-S F W G C S7: (S,N,S,N) M-C-N FW G C S6: (N,N,S,N) F W GC M-G-S S5: (S,N,S,S) FWG C M-W-N S4: (N,N,N,S) M-F-S FW G C S3: (S,S,N,S)

State Space Conceptualize the problem as a graph Each state is a node Each action is an edge We start at some initial node  trying to set to some destination  the edges we cross constitute the list of actions to take initial s1s2 s3 goal

XX X X X X Our State Space ( S,S,S,S ) ( N,S,S,S ) ( S,N,S,S ) ( S,S,N,S ) ( N,N,N,S ) ( N,S,N,S ) ( S,N,N,S ) ( S,S,S,N ) ( N,S,S,N ) ( S,N,S,N ) ( N,N,S,N ) ( S,S,N,N ) ( N,N,N,N ) ( N,S,N,N ) ( S,N,N,N ) MGN MCS MCN MGS MFN MFS MWN MWS MFN MFS ( N,N,S,S ) MWN MWS Illegal nodes...

Search Formulate the problem as one of search We start with the initial state  we define “successor states” as ones that we can reach legally from that state  at each successor state we check to see if we are in the final state, if so, we are done we check to see if the state is illegal, if so, we ignore this state otherwise, we keep searching

Nodes Repeated states  we never want to go back to the same state Move (Goat, North), Move (Goat, South), Move(Goat, North) etc. wasted actions  but there may be multiple ways to reach the same state need to distinguish some paths might be better than others Search Nodes  a search node is state path to the state

Search Tree Use search nodes  (instead of states) Useful properties  the graph is acyclic  only one way to reach a given node therefore, the state space becomes a search tree  the solution / path is part of the representation

Search Tree (ignore illegal states) ( S,S,S,S ), {} ( S,N,S,S ), {...} ( S,S,N,S ), {MGN, MFS} ( N,N,N,S ), {MGN, MFS, MWN} ( N,S,N,S ), {MGN} ( S,S,S,N ), {...} ( S,N,S,N ), {...} ( N,N,S,N ), {...} ( N,N,N,N ), {...} ( N,S,N,N ), {MGN, MFS, MCN} MGN MCN MGS MFS MWN MGN MFS MCN MGS MWN ( N,N,S,N ), {...} ( S,N,S,N ), {...} ( N,N,N,N ), {...} MGN MFS

Toy example Search space quite small  10 legal states of 16 possible Every path leads to success  or quick failure Only one legal first move People sometimes have trouble, though  the idea of “progress” is defeated

Search algorithms For a real problem  impossible to examine entire search space We need a search algorithm  determines how to move through the search tree  which nodes to examine and in what order

Basic idea Given  a set of nodes N  a successor function f that takes a node n returns all of the nodes S reachable from n in a single action Algorithm  pick n from N (somehow)  s = state(n)  p = path(n)  S = f(s)  for all s’, a  S if s is solution, done if s is illegal, discard else create new node n a = N = N – n + n a  repeat

Search strategies All of the interesting action is here  “Pick n from N”  Selecting the node to “expand” Classes of strategies  uninformed search no knowledge of the search space is assumed do not prefer one state over another  informed search use knowledge of the search space heuristic search

Tuesday Read Chapter