Docsity

Artificial Intelligence Solving Problem by Search Uninformed, Exams of Nursing

Partial preview of the text

Download Artificial Intelligence Solving Problem by Search Uninformed and more Exams Nursing in PDF only on Docsity!

Artificial Intelligence

Solving Problem by Search

Uninformed Search and Informed (Heuristic) Search

College of Computer Science, Zhejiang University

Fei Wu

Reference Book: Stuart Russell, Peter Norvig, Artificial Intelligence A Modern Approach (Third Edition)

Problem-Solving by Search

In this part, we show how an agent can act by establishing

goals and considering sequences of actions that might

achieve those goals.

A goal and a set of means for achieving the goal is called a

problem , and the process of exploring what the means can

do is called search.

The types of Problem-solving by Search

Deterministic, fully observable ⇒ single-state problem

agent knows exactly which state it will be in

solution is a sequence

Non-deterministic, Non-observable ⇒ conformant planning

problem

 The problem of conformant planning is that of deciding whether there

exists a linear sequence of actions that will achieve the goal from any

initial state and any resolution of the non-determinism in the problem

 agent may have no idea where it is

 solution (if any) is a sequence

The types of Problem-solving by Search

 Nondeterministic and/or

partially observable ⇒

contingency problem

 percepts provide new

information about current state

solution is a tree or policy

often interleave search,

execution

 Unknown state space ⇒

exploration problem (“online”,

reinforcement learning)

Example: Romania

some assumptions

observable: the environment is observable, so the agent always

knows the current state.

discrete :the environment is discrete, so at any given state there are

only finitely many actions to choose from.

known: the agent knows which states are reached by each action,

i.e., having an accurate map suffices to meet this condition for

navigation problems.

  • deterministic: each action has exactly one outcome. Under these assumptions, the solution to any problem is a fixed sequence of actions. The process of looking for a sequence of actions that reaches the goal is called search.

Well-defined problems and solutions

  • A problem can be defined formally by five components :  Initial state : The initial state that the agent starts in. For example, the initial state for our agent in Romania might be described as In(Arad).  Actions : A description of the possible actions available to the agent. Given a particular state s, ACTIONS(s) returns the set of actions that can be executed in s. We say that each of these actions is applicable in s. For example, from the state In(Arad), the applicable actions are {Go(Sibiu), Go(Timisoara), Go(Zerind)}.  Transition model : A description of what each action does; the formal name for this is the transition model , specified by a function RESULT( s , a ) that returns the state that results from doing action a in state s. We also use the term successor to refer to any state reachable from a given state by a single action. For example, we have RESULT(In(Arad),Go(Zerind)) = In(Zerind)

Well-defined problems and solutions

  • A problem can be defined formally by following components :  Graph (Path): The initial state, actions, and transition model implicitly define the state space of the problem—the set of all states reachable from the initial state by any sequence of actions. The state space forms a directed network or graph in which the nodes are states and the links between nodes are actions. (The map of Romania can be interpreted as a state-space graph if we view each road as standing PATH for two driving actions, one in each direction.) A path in the state space is a sequence of states connected by a sequence of actions.  Goal test: The goal test , which determines whether a given state is a goal state. Sometimes there is an explicit set of possible goal states, and the test simply checks whether the given state is one of them. The agent’s goal in Romania is the singleton set {In(Bucharest )}. Sometimes the goal is specified by an abstract property rather than an explicitly enumerated set of states.

A toy problem : vacuum world Three kinds of actions: Right , Left, Suck

Example problem : vacuum world state space forms a directed graph

Example problem : 8-puzzle The 8-puzzle, an instance of which is shown in Figure 3.4, consists of a 3 × 3 board with eight numbered tiles and a blank space. A tile adjacent to the blank space can slide into the space. The object is to reach a specified goal state, such as the one shown on the right of the figure.

Example problem : 8-puzzle

 The standard formulation of 8-puzzle problem

States: A state description specifies the location of each of the eight tiles and the blank in one of the nine squares.  Initial state: Any state can be designated as the initial state. Note that any given goal can be reached from exactly half of the possible initial states (Exercise 3.4).   Actions: The simplest formulation defines the actions as movements of the blank space Left, Right, Up, or Down. Different subsets of these are possible depending on where the blank is. Transition model: Given a state and action, this returns the resulting state; for example, if we apply Left to the start state in Figure 3.4, the resulting state has the 5 and the blank switched.   Goal test: This checks whether the state matches the goal configuration shown in Figure 3.4. (Other goal configurations are possible.) Path cost: Each step costs 1, so the path cost is the number of steps in the path.

Example problem : 8-queens problem

 The goal of the 8-queens problem is to place eight queens on a

chessboard such that no queen attacks any other. (A queen attacks

any piece in the same row, column or diagonal.) Figure 3.5 shows an

attempted solution that fails: the queen in the rightmost column is

attacked by the queen at the top left.

Example problem : 8-queens problem

Although efficient special-purpose algorithms exist for this

problem and for the whole ꢀ − 푞푢푒푒ꢀ푠 family, it remains

a

useful test problem for search algorithms. There are two

main kinds of formulation. An incremental formulation

involves operators that augment the state description,

starting with an empty state; for the 8-queens problem, this

means that each action adds a queen to the state. A

complete-state formulation starts with all 8 queens on the

board and moves them around. In either case, the path cost

is of no interest because only the final state counts.