CITS3001. Algorithms, Agents and Artificial Intelligence. Semester 1, 2015

Similar documents
Solving problems by searching

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3

Uninformed Search Strategies AIMA 3.4

Chapter3. Problem-Solving Agents. Problem Solving Agents (cont.) Well-defined Problems and Solutions. Example Problems.

CS 8520: Artificial Intelligence

Basic Search. Fall Xin Yao. Artificial Intelligence: Basic Search

Uninformed Search Strategies AIMA

Informed Search Algorithms

Search EECS 395/495 Intro to Artificial Intelligence

Search EECS 348 Intro to Artificial Intelligence

Solving Problems: Blind Search

Solving Problems by Searching

Problem Solving and Search

521495A: Artificial Intelligence

KI-Programmierung. Basic Search Algorithms

CS 380: Artificial Intelligence Lecture #3

ARTIFICIAL INTELLIGENCE (CSC9YE ) LECTURES 2 AND 3: PROBLEM SOLVING

Problem Solving as Search. CMPSCI 383 September 15, 2011

CS486/686 Lecture Slides (c) 2015 P.Poupart

CS486/686 Lecture Slides (c) 2014 P.Poupart

Artificial Intelligence

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Solving problems by searching

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday

Search Algorithms. Uninformed Blind search. Informed Heuristic search. Important concepts:

Solving problems by searching

Search I. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig

Solving Problems by Searching

CSC 2114: Artificial Intelligence Search

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3.

ARTIFICIAL INTELLIGENCE SOLVING PROBLEMS BY SEARCHING. Chapter 3

Chapter 2. Blind Search 8/19/2017

4. Solving Problems by Searching

Uninformed Search. Problem-solving agents. Tree search algorithms. Single-State Problems

Chapter 3 Solving problems by searching

CAP 4630 Artificial Intelligence

Artificial Intelligence

Solving Problems by Searching

Outline. Solving problems by searching. Problem-solving agents. Example: Romania

Solving Problems by Searching (Blindly)

Uninformed search strategies (Section 3.4) Source: Fotolia

Solving problems by searching

CS 771 Artificial Intelligence. Problem Solving by Searching Uninformed search

Problem Solving and Search in Artificial Intelligence

Uninformed Search strategies. AIMA sections 3.4,3.5

Uninformed Search Methods

AI: problem solving and search

CS 4100 // artificial intelligence

Problem solving and search

Problem solving and search

Lecture 3. Uninformed Search

ARTIFICIAL INTELLIGENCE. Pathfinding and search

Announcements. Project 0: Python Tutorial Due last night

Informed search algorithms

Artificial Intelligence Problem Solving and Uninformed Search

Chapter 3: Solving Problems by Searching

Lecture 4: Search 3. Victor R. Lesser. CMPSCI 683 Fall 2010

Artificial Intelligence

Chapter 3. A problem-solving agent is a kind of goal-based agent. It decide what to do by finding sequences of actions that lead to desirable states.

Artificial Intelligence

Problem Solving Agents

Ar#ficial)Intelligence!!

3 SOLVING PROBLEMS BY SEARCHING

Multiagent Systems Problem Solving and Uninformed Search

CS 520: Introduction to Artificial Intelligence. Review

Problem solving and search

Goal-Based Agents Problem solving as search. Outline

Today s s lecture. Lecture 2: Search - 1. Examples of toy problems. Searching for Solutions. Victor R. Lesser

Uninformed Search. Chapter 3

Solving Problems by Searching

Solving Problems by Searching

Solving Problem by Searching. Chapter 3

Solving problems by searching. Chapter 3

Uninformed Search. Chapter 3. (Based on slides by Stuart Russell, Subbarao Kambhampati, Dan Weld, Oren Etzioni, Henry Kautz, and other UW-AI faculty)

COMP3702/7702 Artificial Intelligence Week2: Search (Russell & Norvig ch. 3)" Hanna Kurniawati"

Set 2: State-spaces and Uninformed Search. ICS 271 Fall 2015 Kalev Kask

Artificial Intelligence Uninformed search

CS242 Uninformed Search

Problem solving Basic search. Example: Romania. Example: Romania. Problem types. Intelligent Systems and HCI D7023E. Single-state problem formulation

Informed Search CS457 David Kauchak Fall 2011

Solving Problems by Searching

AI: Week 2. Tom Henderson. Fall 2014 CS 5300

CMU-Q Lecture 2: Search problems Uninformed search. Teacher: Gianni A. Di Caro

HW#1 due today. HW#2 due Monday, 9/09/13, in class Continue reading Chapter 3

COMP219: Artificial Intelligence. Lecture 7: Search Strategies

AGENTS AND ENVIRONMENTS. What is AI in reality?

9/7/2015. Outline for today s lecture. Problem Solving Agents & Problem Formulation. Task environments

Solving Problems by Searching

Blind (Uninformed) Search (Where we systematically explore alternatives)

PEAS: Medical diagnosis system

Introduction to Multi-Agent Programming

ITCS 6150 Intelligent Systems. Lecture 3 Uninformed Searches

A4B36ZUI - Introduction ARTIFICIAL INTELLIGENCE

Problem Solving & Heuristic Search

Why Search. Things to consider. Example, a holiday in Jamaica. CSE 3401: Intro to Artificial Intelligence Uninformed Search

Uninformed Search B. Navigating through a search tree. Navigating through a search tree. Navigating through a search tree

Informed (Heuristic) Search. Idea: be smart about what paths to try.

Vorlesung Grundlagen der Künstlichen Intelligenz

Artificial Intelligence

S A E RC R H C I H NG N G IN N S T S A T T A E E G R G A R PH P S

Transcription:

CITS3001 Algorithms, Agents and Artificial Intelligence Semester 1, 2015 Wei Liu School of Computer Science & Software Eng. The University of Western Australia 6. Uninformed search algorithms AIMA, Ch. 3

Summary We will formalise the definition of a problem for an agent to solve, conceptualising o The environment o The goal to achieve o The actions available o etc. We will describe the fundamental search algorithms available to agents CITS3001: Algorithms, Agents and AI 2 6. Uninformed search

Problem-solving and search We have seen that most intelligent agent models have o Some knowledge of the state of the world o A notion of how actions or operations change the state of the world o A notion of the cost of each possible action o One or more goals, or states of the world, that they would like to bring about Finding a sequence of actions that changes the world from its current state to a desired goal state is a search problem o Or a basic planning problem Usually we want to find the cheapest sequence o The cost of a sequence of actions (or a path) is just the sum of their individual costs Search algorithms are the cornerstone of AI We will examine o How all of the above concepts are formalised o The most common search strategies CITS3001: Algorithms, Agents and AI 3 6. Uninformed search

A running example Our running example (taken from AIMA) is a simplified road map of part of Romania The state of the world is our current location The only operator available is to drive from one city to a connected city The cost of an action is the distance between the cities The start state is where we start from (Arad) The goal state is where we want to get to (Bucharest) A solution is a sequence of cities that we drive through In general the state of the world is described abstractly, focussing only on the features relevant to the problem CITS3001: Algorithms, Agents and AI 4 6. Uninformed search

A second example: the 8-puzzle Slide the tiles in the puzzle until the goal state is reached The state is the current layout of the tiles The only operator is to slide a tile into the blank square o Or to slide the blank square The cost of each action is 1 The start state is the puzzle s initial configuration The goal state is as shown A solution is a sequence of tile-moves CITS3001: Algorithms, Agents and AI 5 6. Uninformed search

A third example: missionaries and cannibals Start state: 3 missionaries, 3 cannibals, and one boat that holds up to 2 people, all on one side of a river Goal state: everybody on the other side of the river Current state: the positions of the people and the boat o A state is legal only if no one gets eaten o i.e. cannibals never outnumber missionaries Operator: 1 or 2 people cross the river in the boat Cost: 1 Figure taken from: http://www.aiai.ed.ac.uk/~gwickler/missionaries.html CITS3001: Algorithms, Agents and AI 6 6. Uninformed search

Contd. MMMCCCB φ MMCC MCB MMMC CCB MMMCC CB MMMCCB C MMM CCCB MMMCB CC MC MMCCB MMCCB MC CC MMMCB CCCB MMM C MMMCCB CCB MMMC MCB MMCC φ MMMCCCB CITS3001: Algorithms, Agents and AI 7 6. Uninformed search

A generalised search algorithm The fundamental idea is o At any given moment we are in some state s o s will usually offer several possible actions o Choose one action to explore first o Keep s and the other actions to explore later, in case the first one doesn t deliver Action-selection is determined by a search strategy We picture a search tree of states, expanding outwards from the initial state of the problem GeneralSearch (problem, strategy): initialise the tree with the initial state of problem while no solution found if there are no possible expansions left then return failure else use strategy to choose a leaf node x to expand if x is a goal state then return success else expand x add the new nodes to the tree CITS3001: Algorithms, Agents and AI 8 6. Uninformed search

Contd. CITS3001: Algorithms, Agents and AI 9 6. Uninformed search

An alternative formulation Given o A set of possible states S o A start state s 0 o A goal function g(s) {true, false} o A terminal condition t(s) {true, false} U = {s 0 } -- unvisited nodes V = {} -- visited nodes while U {} s = select a node from U if s V -- occurs check (optional) then discard s else if g(s) then return success else if t(s) -- cut-off check (optional) then discard s else V = V + {s} U = U {s} + successors(s) The data structure used to store U can impose an order in which the nodes will be visited o e.g. a priority queue where nodes are stored in the order in which they should be visited CITS3001: Algorithms, Agents and AI 10 6. Uninformed search

Comparing search strategies The performance of search strategies is generally compared in four ways Completeness: is the strategy guaranteed to find a solution, assuming that there is one? Optimality: is the strategy guaranteed to find the optimal solution? Time complexity: how long does the strategy take to find a solution? Space complexity: how much memory is needed to conduct the search? The complexities are often expressed in terms of o b: maximum branching factor of the tree o m: maximum depth of the search space o d: depth of the least-cost solution CITS3001: Algorithms, Agents and AI 11 6. Uninformed search

Uninformed search strategies Breadth-first search o Expand the shallowest node next Uniform-cost search o Expand the lowest-cost node next Depth-first search o Expand the deepest node next Depth-limited search o Depth-first, but with a cut-off depth Iterative deepening depth-first search o Repeated depth-limited, with increasing cut-offs Bidirectional search o Search from both ends concurrently In the next lecture, we will look at informed search strategies, that use additional information CITS3001: Algorithms, Agents and AI 12 6. Uninformed search

Breadth-first search Expand the shallowest node next o Expand all nodes at one level before moving down Complete: yes, if b is finite Optimal: yes, if all step-costs are equal Time: O(1 + b + b 2 + + b d ) = O(b d ) Space: O(b d ), because all of the nodes at one level must be stored simultaneously CITS3001: Algorithms, Agents and AI 13 6. Uninformed search

Breadth-first contd. Space is the big problem You might wait thirteen days to solve a problem o But who has a petabyte of memory!? Welcome to AI! CITS3001: Algorithms, Agents and AI 14 6. Uninformed search

Uniform-cost search Expand the lowest-cost node next o Basically a version of breadth-first that allows for varying step-costs Complete: yes, if all step-costs 0 Optimal: as above Time: O(n), where n is the number of nodes with cost less than the optimum Space: as above CITS3001: Algorithms, Agents and AI 15 6. Uninformed search

Depth-first search Expand the deepest node next o Follow one path until you can go no further, then backtrack to the last choice point and try an alternative CITS3001: Algorithms, Agents and AI 16 6. Uninformed search

Depth-first contd. Usually needs an occurs-check (as per Page 10) to prevent looping Complete: no, fails in infinite-depth spaces Optimal: no, could hit any solution first Time: O(b m ), follows paths all the way down Space: O(bm), because it only needs to store the current path plus untried alternatives Space is a huge advantage The other metrics can be big disadvantages CITS3001: Algorithms, Agents and AI 17 6. Uninformed search

Depth-limited search Depth-first, but with a cut-off depth o Terminate paths at depth l o cf. t(s) on Page 10 Sometimes used to apply depth-first search to infinite (or effectively infinite) spaces o Find best solution with limited resources o e.g. game-playing (Lecture 8) Works well if we have a good way to choose l o e.g. the Romanian map has diameter 9 CITS3001: Algorithms, Agents and AI 18 6. Uninformed search

Iterative deepening depth-first search Repeated depth-limited, with increasing cut-offs o Probe deeper and deeper, iteratively increasing l CITS3001: Algorithms, Agents and AI 19 6. Uninformed search

Iterative deepening contd. Complete: yes Optimal: yes, for constant step-costs o And easily adapted to varying step-costs Time: O((d+1)b 0 + db 1 + (d 1)b 2 + + b d ) = O(b d ) Space: O(bd) The multiplying factors in the time complexity come from the repeated expansion of nodes near the root But this is not normally a big problem o For typical values of b, the last layer of the tree dominates the space requirements And it s worth it for the space complexity! Iterative deepening allows a system to adapt to resource limits o In this context it acts an anytime algorithm o Find an initial (hopefully usable) solution, then try to find a better one A common optimisation is start off l bigger than 0 CITS3001: Algorithms, Agents and AI 20 6. Uninformed search

Bidirectional search Search from both ends concurrently Usually expands many fewer nodes than unidirectional o 2b d/2 << b d But raises many other difficulties o There may be many goal states to start from o Formalising backward steps may be difficult o The backwards branching factor may be much bigger than b o The cost of checking when the two sides meet may be high e.g. chess o There are many, many checkmate positions o Was the last move a capture? o As above o Positions can be complex CITS3001: Algorithms, Agents and AI 21 6. Uninformed search

Summary Iterative deepening offers o the completeness and optimality of breadth-first o the space advantage of depth-first CITS3001: Algorithms, Agents and AI 22 6. Uninformed search