Problem Solving by searching, Lecture notes of Artificial Intelligence

Solve some problems of searching algorithm

Typology: Lecture notes

2018/2019

Uploaded on 12/07/2019

dovuongquocthinh
dovuongquocthinh ๐Ÿ‡ป๐Ÿ‡ณ

2 documents

1 / 43

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SOLVING PROBLEMS
BY SEARCHING
Nguyแป…n Ngแปc Thแบฃo
CS420 โ€“Artificial Intelligence
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b

Partial preview of the text

Download Problem Solving by searching and more Lecture notes Artificial Intelligence in PDF only on Docsity!

SOLVING PROBLEMS

BY SEARCHING

Nguyแป…n Ngแปc Thแบฃo [email protected] CS420 โ€“ Artificial Intelligence

Outline

  • Problem-Solving Agents
  • Example Problems
  • Searching for Solutions

A touring holiday in Romania

What makes a good trip at Arad?

  • take in the sights, enjoy the foods, etc.
  • avoid hangovers
  • โ€ฆ However, there will be your friendโ€™s wedding tomorrow at Bucharest!!!

Goal-based agents

  • Intelligent agents are supposed to maximize their

performance measure.

  • Different factors for performance measure โ†’ making decisions involves many tradeoffs
  • Goals help organize behavior by limiting the objectives that

the agent is trying to achieve and the actions it considers.

Traveling from Arad to Bucharest

Goal-based agents in Romania

  • The agent initially does not know which road to follow

โ†’ unknown environment, try an action randomly

  • Suppose the agent has a map of Romania.

An agent with several immediate options of unknown value

can decide what to do by first examining future actions that

eventually lead to states of known value.

  • The agent discovers many hypothetical

journey and finds a journey that

eventually gets to Bucharest.

Solving problem by searching

  • Search: the process of looking for a sequence of actions

that reaches the goal

  • A search algorithm takes a problem as input and returns a

solution in the form of an action sequence.

  • Execution phase: once a solution is found, the

recommended actions are carried out.

  • While executing the solution, the agent ignores its percepts when choosing an action โ†’ open-loop system

Solving problem by searching

function SIMPLE-PROBLEM-SOLVING-AGENT( percept ) returns an action persistent : seq , an action sequence, initially empty state , some description of the current world state goal , a goal, initially null problem , a problem formulation state โ† UPDATE-STATE( state, percept ) if seq is empty then goal โ† FORMULATE-GOAL( state ) problem โ† FORMULATE-PROBLEM( state, goal ) seq โ† SEARCH( problem ) if seq = failure then return a null action action โ† FIRST( seq ) seq โ† REST( seq ) return action

The state space

  • The set of all states reachable from the initial state by any

sequence

  • Implicitly defined by the initial state, actions, and transition model
  • Directed graph โ€“ nodes are states and the links between

nodes are actions.

  • A path in the state space is a sequence of states connected by a sequence of actions.

Well-define problems and solutions

  • Goal test: determine whether a given state is a goal state
    • The goal is specified by either an explicit set of possible goal states or an abstract property.
    • E.g., ๐ผ๐‘›(๐ต๐‘ข๐‘โ„Ž๐‘Ž๐‘Ÿ๐‘’๐‘ ๐‘ก), checkmate
  • Path cost: a function that assigns a numeric cost to each

path

  • Nonnegative, reflecting the agentโ€™s performance measure
  • E.g., ๐‘ ๐ผ๐‘› ๐ด๐‘Ÿ๐‘Ž๐‘‘ , ๐บ๐‘œ ๐‘๐‘’๐‘Ÿ๐‘–๐‘›๐‘‘ , ๐ผ๐‘› ๐‘๐‘’๐‘Ÿ๐‘–๐‘›๐‘‘ = 75
  • An optimal solution has the lowest path cost.

Formulating problems by abstraction

  • Abstraction is critical for automated problem solving
    • Real-world is too detailed to model exactly
    • Create an approximate, simplified, model of the world for the computer to deal with
  • The choice of a good abstraction thus involves
    • Removing as much detail as possible while
    • Retaining validity and ensuring that the abstract actions are easy to carry out

Example Problems

  • Toy Problems
  • Real-world Problems

The Vacuum-cleaner world

  • States: determined by both the agent location and the dirt

locations

  • 2 ร— 2 2 = 8 possible world states (๐‘› ร— 2 ๐‘› in general)
  • Initial state: Any state can be designated as the initial state.
  • Actions: Left, Right, and Suck
  • Larger model may include Up and Down, etc.
  • Transition model: The actions have their expected effects.
  • Except that moving Left in the leftmost square, moving Right in the rightmost square, and Sucking in a clean square have no effect.
  • Goal test: whether all the squares are clean
  • Path cost: each step costs 1

The Vacuum-cleaner world

The state space for the vacuum world Links denote actions: L = Left, R = Right, S = Suck.