Solving problems by searching Chapter 3, part 2 Modified by Vali Derhami.

Slides:



Advertisements
Similar presentations
Artificial Intelligent
Advertisements

Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES
Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Uninformed search strategies
Solving problems by searching Chapter 3 Artificial Intelligent Team Teaching AI (created by Dewi Liliana) PTIIK 2012.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Uninformed (also called blind) search algorithms) This Lecture Chapter Next Lecture Chapter (Please read lecture topic material before.
Properties of breadth-first search Complete? Yes (if b is finite) Time? 1+b+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node.
CS 480 Lec 3 Sept 11, 09 Goals: Chapter 3 (uninformed search) project # 1 and # 2 Chapter 4 (heuristic search)
Blind Search1 Solving problems by searching Chapter 3.
Search Strategies Reading: Russell’s Chapter 3 1.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
1 Chapter 3 Solving Problems by Searching. 2 Outline Problem-solving agentsProblem-solving agents Problem typesProblem types Problem formulationProblem.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
PSU CS 370 – Artificial Intelligence Dr. Mohamed Tounsi Artificial Intelligence 3. Solving Problems By Searching.
Search Search plays a key role in many parts of AI. These algorithms provide the conceptual backbone of almost every approach to the systematic exploration.
1 Lecture 3 Uninformed Search. 2 Uninformed search strategies Uninformed: While searching you have no clue whether one non-goal state is better than any.
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
1 Lecture 3: 18/4/1435 Uninformed search strategies Lecturer/ Kawther Abas 363CS – Artificial Intelligence.
Touring problems Start from Arad, visit each city at least once. What is the state-space formulation? Start from Arad, visit each city exactly once. What.
Artificial Intelligence for Games Uninformed search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
Uninformed (also called blind) search algorithms This Lecture Read Chapter Next Lecture Read Chapter (Please read lecture topic material.
Search Strategies CPS4801. Uninformed Search Strategies Uninformed search strategies use only the information available in the problem definition Breadth-first.
UNINFORMED SEARCH Problem - solving agents Example : Romania  On holiday in Romania ; currently in Arad.  Flight leaves tomorrow from Bucharest.
Artificial Intelligence for Games Depth limited search Patrick Olivier
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
CHAPTER 3 CMPT Blind Search 1 Search and Sequential Action.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Review: Search problem formulation
Searching the search space graph
Artificial Intelligence Chapter 3: Solving Problems by Searching
1 Lecture 3 Uninformed Search. 2 Complexity Recap (app.A) We often want to characterize algorithms independent of their implementation. “This algorithm.
1 Lecture 3 Uninformed Search
Lecture 3 Uninformed Search.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
Artificial Intelligence
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Prof. Carla P. Gomes Module: Search I (Reading R&N: Chapter.
An Introduction to Artificial Intelligence Lecture 3: Solving Problems by Sorting Ramin Halavati In which we look at how an agent.
SOLVING PROBLEMS BY SEARCHING Chapter 3 August 2008 Blind Search 1.
A General Introduction to Artificial Intelligence.
1 Solving problems by searching Chapter 3. Depth First Search Expand deepest unexpanded node The root is examined first; then the left child of the root;
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
Solving problems by searching Chapter 3 Modified by Vali Derhami.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 3 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
1 search CS 331/531 Dr M M Awais REPRESENTATION METHODS Represent the information: Animals are generally divided into birds and mammals. Birds are further.
Pengantar Kecerdasan Buatan
Uninformed search strategies A search strategy is defined by picking the order of node expansion Uninformed search strategies use only the information.
Problem Solving as Search. Problem Types Deterministic, fully observable  single-state problem Non-observable  conformant problem Nondeterministic and/or.
Problem Solving by Searching
Implementation: General Tree Search
Solving problems by searching A I C h a p t e r 3.
1/27 Informed search algorithms Chapter 4 Modified by Vali Derhami.
1 Solving problems by searching Chapter 3. 2 Outline Problem types Example problems Assumptions in Basic Search State Implementation Tree search Example.
WEEK 5 LECTURE -A- 23/02/2012 lec 5a CSC 102 by Asma Tabouk Introduction 1 CSC AI Basic Search Strategies.
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Artificial Intelligence Solving problems by searching.
Lecture 3 Problem Solving through search Uninformed Search
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Uninformed Search Chapter 3.4.
Uninformed Search Strategies
Problem Solving as Search
Solving problems by searching
Artificial Intelligence
Presentation transcript:

Solving problems by searching Chapter 3, part 2 Modified by Vali Derhami

2/43 Implementation: general tree search انتخاب گره از مجموعه لبه براي گسترش بر اساس استراتژی جستجو. بررسي رسيدن به هدف براي گره انتخابي. بسط گره انتخابي و درج در صف

3/43 Search strategies A search strategy is defined by picking the order of node expansion Strategies are evaluated along the following dimensions: completeness: does it always find a solution if one exists? time complexity: How long does it take to find solution (number of nodes generated) space complexity: How much memory is needed to perform the search? maximum number of nodes in memory optimality: does it always find a optimal solution? Time and space complexity are measured in terms of b: maximum branching factor of the search tree حداكثر تعداد پسين هاي هر درخت d: depth of the least-cost solution كم ترين عمق هدف. m: maximum depth of the state space (may be ∞) طولاني ترين مسير در فضاي حالت

4/43 Uninformed search strategies Uninformed search strategies use only the information available in the problem definition Breadth-first search Uniform-cost search Depth-first search Depth-limited search Iterative deepening search

5/43 Breadth-first search جستجوي اول سطح Expand shallowest unexpanded node گسترش دادن سطحي ترين گره هاي گسترش نيافته Implementation: fringe is a FIFO queue, i.e., new successors go at end

6/43 Breadth-first search جستجوي اول سطح Expand shallowest unexpanded node گسترش دادن سطحي ترين گره هاي گسترش نيافته Implementation: fringe is a FIFO queue, i.e., new successors go at end

7/43 Breadth-first search جستجوي اول سطح Expand shallowest unexpanded node گسترش دادن سطحي ترين گره هاي گسترش نيافته Implementation: fringe is a FIFO queue, i.e., new successors go at end

8/43 Breadth-first search جستجوي اول سطح Expand shallowest unexpanded node گسترش دادن سطحي ترين گره هاي گسترش نيافته Implementation: fringe is a FIFO queue, i.e., new successors go at end

9/43 Properties of breadth-first search Complete? Yes (if b is finite) Time? :تعداد گره هاي توليد شدهb+b 2 +b 3 +… +b d + b(b d -1) = O(b d+1 ) Space? O(b d+1 ) (keeps every node in memory) Optimal? Yes (if cost = 1 per step) Space is the bigger problem (more than time) مسائل با جستجوي پيچيدگي نمايي به جز براي نمونه هاي كوچك توسط روشهاي ناآگاهانه قابل حل نيستند

10/43

11/43 Uniform-cost search جستجوي هزينه يكنواخت Expand least-cost unexpanded node Implementation: fringe = queue ordered by path cost Equivalent to breadth-first if step costs all equal Complete? Yes, if step cost ≥ ε Time? # of nodes with g ≤ cost of optimal solution, O(b [1+(C*/ ε)] ) where C * is the cost of the optimal solution O(b [1+(C*/ ε)] ) can be much greater than O(b d ) Space? # of nodes with g ≤ cost of optimal solution, O(b [(C*/ ε)] ) Optimal? Yes –if step cost ≥ ε

12/43 Depth-first search جستجوي عمق اول Expand deepest unexpanded node گسترش عميق ترين گره گسترش نيافته Implementation: fringe = LIFO queue, i.e., put successors at front

13/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

14/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

15/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

16/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

17/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front اين سه گره مشكي ازحافظه پاك مي شود.

18/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

19/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

20/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

21/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

22/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

23/43 Depth-first search Expand deepest unexpanded node Implementation: fringe = LIFO queue, i.e., put successors at front

24/43 Properties of depth-first search Complete? No: fails in infinite-depth spaces, spaces with loops Modify to avoid repeated states along path  complete in finite spaces Time? O(b m ): terrible if m is much larger than d mحداكثر عمق هر گره but if solutions are dense, may be much faster than breadth-first Space? bm+1, O(bm), i.e., linear space! Optimal? No

25/43 Depth-first search Back tracking search: A type of Depth- firt search Back Traking: only one successor is generated at a time rather than all successors Space: O(m)

26/43 Depth-limited search = depth-first search with depth limit l,i.e., nodes at depth l اگر d>l آنگاه كامل نيست حتي اگر m محدود باشد اگر d<l انتخاب شود غير بهينه است. Time? O(b l ), Space? bl+1, O(bl), L=∞ => Depth firth

27/43 Depth-limited search Recursive implementation:

28/43 Iterative deepening search جستجوي عميق شونده تكراري جستجوي اول عمق كه بهترين محدوديت عمق را با افزايش تدريجي محدوديت تا زماني كه به هدف رسد ،مي يابد. مزاياي هر دو روش اول عمق و جستجوي سطح اول.

29/43 Iterative deepening search l =0

30/43 Iterative deepening search l =1

31/43 Iterative deepening search l =2

32/43 Iterative deepening search l =3

33/43 Iterative deepening search Number of nodes generated in a depth-limited search to depth d with branching factor b: N DLS = b 1 + b 2 + … + b d-2 + b d-1 + b d Number of nodes generated in an iterative deepening search to depth d with branching factor b: N IDS = d b 1 + (d-1)b 2 + … + 3b d-2 +2b d-1 + 1b d For b = 10, d = 5, N IDS = , , ,000 = 123,450 N BFS = , , , ,990 = 1,111,100. Overhead = (123, ,111)/111,111 = 11%

34/43 Properties of iterative deepening search Complete? Yes Time? d b 1 + (d-1)b 2 + … + b d = O(b d ) Space? O(bd) Optimal? Yes, if step cost = 1

35/43 Bidirectional search جستجوي دو طرفه انجام جستجوي همزمان يكي از حالت اوليه به سمت جلو و ديگري از هدف به سمت عقب توقف وقتي كه دو جستجو به هم مي رسند. Time: O(b d/2 )+ O(b d/2 )= O(b d/2 ) << O(b d ) Space: O(b d/2 ) مهمترين ضعف هم اين نياز به فضا است. Complete and optimal (for uniform step costs) if both searches are breadth-first; other combinations may sacrifice completeness, optimality, or both.

36/43 Summary of algorithms

37/43 Repeated states Failure to detect repeated states can turn a linear problem into an exponential one!

38/43 Graph search

39/43 انواع مساله 1- مسايل تك حالته در محيط هاي قطعي و كاملا رويت پذير Deterministic, fully observable عامل اطلاعات كامل (Global information)از محيط و اثر عمليات خود را مي داند. 2- مسايل بدون حس گر (منطبق) (چند حالته هم ناميده مي شود.) در محيطهاي قطعي عامل وضعيت فعلي خود را نميداند ولي اثر عمليات خود را مي داند. 3- مسايل اقتضايي Contingency محيط نيمه رويت پذير و يا غير قطعي عامل اثر عمليات خود را نمي داند. اگر نايقيني ناشي از اقدام عامل ديگر مساله را تخاصمي (Adversarial) گويند. 4- مسايل اكتشافي exploration Problem حالتها و اقدامات ناشناخته

40/43 Example: vacuum world Single-state, start in #5. Solution?

41/43 Example: vacuum world Single-state, start in #5. Solution? [Right, Suck] Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution?

42/43 Example: vacuum world Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution? [Right,Suck,Left,Suck] Contingency Nondeterministic: Suck may dirty a clean carpet Partially observable: location, dirt at current location. Percept: [L, Clean], i.e., start in #5 or #7 Solution?

43/43 Example: vacuum world Sensorless, start in {1,2,3,4,5,6,7,8} e.g., Right goes to {2,4,6,8} Solution? [Right,Suck,Left,Suck] Contingency Nondeterministic: Suck may dirty a clean carpet Partially observable: location, dirt at current location. Percept: [L, Clean], i.e., start in #5 or #7 Solution? [Right, if dirt then Suck]