Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1

2 Problem Solving and Search in AI Part I

3 Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal problem solving mechanism Systematically explores the alternatives Systematically explores the alternatives Finds the sequence of steps towards a solution Finds the sequence of steps towards a solution Problem Space Hypothesis (Allen Newell, Herbert Simon SOAR: An Architecture for General Intelligence.) SOAR: An Architecture for General Intelligence.) All goal-oriented symbolic activities occur in a problem space All goal-oriented symbolic activities occur in a problem space Search in a problem space is claimed to be a completely general model of intelligence Search in a problem space is claimed to be a completely general model of intelligence

4 Search and Intelligence The ability to achieve goals in the face of variations, difficulties, and complexities posed by the task environment is an essential characteristic of intelligence. The Physical Symbol System Hypothesis together with the idea of Heuristic Search constitute Newell and Simon's proposal for how to computationally realize intelligence

5 Physical Symbol System A physical symbol system "consists of a set of entities, called symbols, which are physical patterns that can occur as components of another type of entity called an expression (or symbol structure). Thus, a symbol structure is composed of a number of instances (or tokens) of symbols related in some physical way (such as one token being next to another). At any instant of time the system will contain a collection of these symbol structures. Besides these structures, the system also contains a collection of processes that operate on expressions to produce other expressions: processes of creation, modification, reproduction and destruction. A physical symbol system is a machine that produces through time an evolving collection of symbol structures. Such a system exists in a world of objects wider than just these symbolic expressions themselves." "A physical symbol system has the necessary and sufficient means for intelligent action." Newell and Simon

6 Stating a Problem as a Search Problem  State space S  Successor function: x  S  SUCCESSORS (x)  Cost of a move  Initial state s 0  Goal test: for state x in S  GOAL? (x) =T or F S 1 3 2

7 Example (Romania) Initial Situation On Holiday in Romania; currently in Arad On Holiday in Romania; currently in Arad Flight leaves tomorrow from Bucharest Flight leaves tomorrow from Bucharest Formulate Goal be in Bucharest be in Bucharest Formulate Problem states: various cities states: various cities operators: drive between cities operators: drive between cities Find Solution sequence of cities sequence of cities must start at starting state and end in the goal state must start at starting state and end in the goal state

8 Example (Romania)

9 Problem formulation A problem is defined by four items: initial state e.g., ``at Arad'' e.g., ``at Arad'' operators (or successor function S(x)) e.g., Arad ==> ZerindArad ==> Sibiu e.g., Arad ==> ZerindArad ==> Sibiu goal test, can be explicit, e.g., x = ``at Bucharest'' explicit, e.g., x = ``at Bucharest'' implicit, e.g., NoDirt(x) implicit, e.g., NoDirt(x) path cost (additive) e.g., sum of distances, number of operators executed, etc. e.g., sum of distances, number of operators executed, etc. A solution is a sequence of operators leading from the initial state to a goal state

10 Selecting a state space Real world is too complex state space must be abstracted for problem solving state space must be abstracted for problem solving (Abstract) state = set of real states (Abstract) operator = complex combination of real actions e.g., “Arad ==> Zerind” represents a complex set of possible routes, detours, rest stops, etc. e.g., “Arad ==> Zerind” represents a complex set of possible routes, detours, rest stops, etc. For guaranteed realizability, any real state “in Arad” must get to some real state “in Zerind” (Abstract) solution = set of real paths that are solutions in the real world

11 Example: Vacuum World Vacuum World Let the world consist of two rooms Each room may contain dirt The agent may be in either room initial: both rooms dirty goal: both rooms clean problem: states: each state has two rooms which may contain dirt (8 possible) actions: go from room to room; vacuum the dirt Solution: sequence of actions leading to clean rooms

12 Example: Vacuum World States? integer dirt and robot locations (ignore dirt amounts) Operators? Left, Right, Suck Goal Test? no dirt Path Cost? one per move Goal states

13 Example: The 8-Puzzle States?integer location of tiles Operators? move blank left, right, up, down Goal Test?= goal state (given) Path Cost?One per move

14 8-Puzzle: Successor Function 1 2 34 56 7 8 1 2 34 5 6 78 1 2 34 56 78 1 2 34 56 78

15 State-Space Graph A representation of all possible legal configurations of the problem resulting from applications of legal operators each node in the graph is a representation a possible legal state each node in the graph is a representation a possible legal state each transition is a representation of a possible legal move applied to a state (resulting in a new state of the problem) each transition is a representation of a possible legal move applied to a state (resulting in a new state of the problem)States: representation of states should provide all information necessary to describe relevant features of a problem state representation of states should provide all information necessary to describe relevant features of a problem stateOperators: Operators may be simple functions representing legal actions; Operators may be simple functions representing legal actions; Operators may be rules specifying an action given that a condition (set of constraints) on the current state is satisfied Operators may be rules specifying an action given that a condition (set of constraints) on the current state is satisfied In the latter case, the rules are sometimes referred to as “production rules” and the system is referred to as a production system. In the latter case, the rules are sometimes referred to as “production rules” and the system is referred to as a production system.

16 Vacuum World State-Space Graph State-space graph does not include initial or goal states Search Problem: Given specific initial and goal states, find a path in the graph from an initial to a goal state An instance of a search problem can be represented as a “search tree” whose root note is the initial state An instance of a search problem can be represented as a “search tree” whose root note is the initial state

17

18 Solution to the Search Problem A solution is a path connecting the initial to a goal node (any one) The cost of a path is the sum of the edge costs along this path An optimal solution is a solution path of minimum cost There might be no solution !

19

20 State Spaces Can be Very Large 8-puzzle  9! = 362,880 states 15-puzzle  16! ~ 1.3 x 1012 states 24-puzzle  25! ~ 1025 states

21 Searching the State Space Often it is not feasible to build a complete representation of the state graph A problem solver must construct a solution by exploring a small portion of the graph For a specific search problem (with a given initial and goal state) we can view the relevant portion as a search tree

22 Searching the State Space

23 Search tree

24 Searching the State Space Search tree

25 Searching the State Space Search tree

26 Searching the State Space Search tree

27 Searching the State Space Search tree

28 ... Portion of Search Tree for an Instance of the 8-Puzzle Problem

29 Simple Problem-Solving Agent Algorithm s0  sense/read initial state GOAL?  select/read goal test Succ  select/read successor function solution  search(s0, GOAL?, Succ) perform(solution)

30 Some Other Problems

31 8-Queens Problem Place 8 queens in a chessboard so that no two queens are in the same row, column, or diagonal. A solutionNot a solution

32 Formulation #1  States: all arrangements of 0, 1, 2,..., or 8 queens on the board  Initial state: 0 queen on the board  Successor function: each of the successors is obtained by adding one queen in an empty square  Arc cost: irrelevant  Goal test: 8 queens are on the board, with no two of them attacking each other  64 x 63 x... x 53 ~ 3 x 10 14 states

33 Formulation #2  States: all arrangements of k = 0, 1, 2,..., or 8 queens in the k leftmost columns with no two queens attacking each other  Initial state: 0 queen on the board  Successor function: each successor is obtained by adding one queen in any square that is not attacked by any queen already in the board, in the leftmost empty column  Arc cost: irrelevant  Goal test: 8 queens are on the board  2,057 states

34 Path Planning What is the state space ?

35 Formulation #1 Cost of one horizontal/vertical step = 1 Cost of one diagonal step =  2

36 Optimal Solution This path is the shortest in the discretized state space, but not in the original continuous space

37 Formulation #2 Cost of one step: length of segment

38 Formulation #2 Cost of one step: length of segment Visibility graph

39 Solution Path The shortest path in this state space is also the shortest in the original continuous space

40 Search Strategies Uninformed (blind, exhaustive) strategies use only the information available in the problem definition Breadth-first search Breadth-first search Depth-first search Depth-first search Uniform-cost search Uniform-cost search Heuristic strategies use “rules of thumb” based on the knowledge of domain to pick between alternatives at each step Graph Searching Applet: http://www.cs.ubc.ca/labs/lci/CIspace/Version4/search/index.html


Download ppt "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."

Similar presentations


Ads by Google