Artificial Intelligence

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.
Additional Topics ARTIFICIAL INTELLIGENCE
Review: Search problem formulation
Uninformed search strategies
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.
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.
Uniform Cost Search Introduction to AI. Uniform cost search A breadth-first search finds the shallowest goal state and will therefore be the cheapest.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
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.
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.
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 Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Lecture 3 Note: Some slides and/or pictures are adapted from Lecture slides / Books of Dr Zafar Alvi. Text Book - Aritificial Intelligence Illuminated.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
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 Problem solving by searching CSC 361 Prof. Mohamed Batouche Computer Science Department CCIS – King Saud University Riyadh, Saudi.
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
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;
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.
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
Lecture 3: Uninformed Search
Uninformed (also called blind) search algorithms)
Problem Solving Agents
EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS
Uninformed Search Chapter 3.4.
Uninformed Search Strategies
G5AIAI – Introduction to AI
Problem Solving as Search
Artificial Intelligence (CS 370D)
Breadth-First Searches
Uninformed Search CS171, Winter 2017
Uninformed Search Introduction to Artificial Intelligence
Solving problems by searching
CS 188: Artificial Intelligence Spring 2007
Problem Solving and Searching
What to do when you don’t know anything know nothing
Iterative Deepening Search
EA C461 – Artificial Intelligence
Searching for Solutions
Breadth-First Searches
Problem Solving and Searching
Depth-First Searches Introduction to AI.
Principles of Computing – UFCFA3-30-1
Artificial Intelligence Problem solving by searching CSC 361
Artificial Intelligence
Artificial Intelligence
Solving Problems by Searching
Search Strategies CMPT 420 / CMPG 720.
Problem Solving by Searching Search Methods :
Depth-First Searches.
Presentation transcript:

Artificial Intelligence Lecture 4 – Uninformed Search Dr. Muhammad Adnan Hashmi 6 December 2018

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 6 December 2018 2

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 6 December 2018 3

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 6 December 2018 4

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 6 December 2018 5

Breadth-first search Expand shallowest unexpanded node Implementation: fringe is a FIFO queue, i.e., new successors go at end 6 December 2018 6

Breadth-first search 6 December 2018 7

Properties of Breadth-first search Complete? Yes (if b is finite) Time? 1+b+b2+b3+… +bd + b(bd-1) = O(bd+1) Space? O(bd+1) (keeps every node in memory) Optimal? Yes (if cost = 1 per step) Space is the bigger problem (more than time). 6 December 2018 8

Preventing Loopy Paths We can have search graphs (instead of trees) Hence paths can go backwards, ABCB Can get paths with loops ABCDB We can also have multiple paths to a node From them, we are interested in the min-cost path The Loop problem is that we “rediscover” nodes that the search has already discovered Need to consider methods to suppress nodes that have already been visited. 6 December 2018 9

Uniform-Cost Search 6 December 2018 11

A S B G C 10 1 5 5 5 15 Consider the following problem… We wish to find the shortest route from node S to node G; that is, node S is the initial state and node G is the goal state. In terms of path cost, we can clearly see that the route SBG is the cheapest route. However, if we let breadth-first search loose on the problem it will find the non-optimal path SAG, assuming that A is the first node to be expanded at level 1.

Once node B has been expanded it is removed from the queue and the revealed node (node G) is added. The queue is again sorted on path cost. Note, node G now appears in the queue twice, once as G10 and once as G11. As G10 is at the front of the queue, we now proceed to goal state. Press space. Node A is removed from the queue and the revealed node (node G) is added to the queue. The queue is again sorted on path cost. Note, we have now found a goal state but do not recognise it as it is not at the front of the queue. Node B is the cheaper node. Press space. We now expand the node at the front of the queue, node A. Press space to continue. Node S is removed from the queue and the revealed nodes are added to the queue. The queue is then sorted on path cost. Nodes with cheaper path cost have priority.In this case the queue will be Node A (1), node B (5), followed by node C (15). Press space. We start with our initial state and expand it… A A 10 1 5 5 S S B B G G G G G G The goal state is achieved and the path S-B-G is returned. In relation to path cost, UCS has found the optimal route. 15 C Size of Queue: 3 Size of Queue: 0 Size of Queue: 1 Size of Queue: 0 Queue: G10, G11, C15 Queue: B, G11, C Queue: Empty Queue: S Queue: A, B, C Queue: Empty Nodes expanded: 3 Nodes expanded: 1 Nodes expanded: 2 Nodes expanded: 0 Current action: Waiting…. Current action: Expanding FINISHED SEARCH Current action: Expanding Current action: Backtracking Current level: 1 Current level: n/a Current level: 0 Current level: 0 Current level: 2 Current level: 1 UNIFORM COST SEARCH PATTERN

Uniform-Cost Search 6 December 2018 14

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? O(bceiling(C*/ ε)) where C* is the cost of the optimal solution Space? O(bceiling(C*/ ε)) Optimal? Yes – given the condition of completeness – you always expand the node with lowest cost O(bceiling(C*/ ε)) can be greater than Ob/d 6 December 2018 15

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 16

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 17

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 18

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 19

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 20

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 21

Depth-first search Expand deepest unexpanded node Implementation: fringe is a LIFO queue, i.e., put successors in the front 6 December 2018 22

Properties of Depth-first search Complete? No: fails in infinite-depth spaces, spaces with loops Complete in finite spaces Time? O(bm): terrible if m is much larger than d But if solutions are dense, may be much faster than breadth-first Space? O(bm), i.e., linear space! Optimal? No 6 December 2018 23

BFS or DFS

Depth-limited search Recursive implementation: 6 December 2018 25

Depth-Limited Search Complete? NO. Why? (l < d OR l > d) Time? O(bl) Space? O(bl) Depth-first is a special case of depth-limited with l being infinite. 6 December 2018 26

Iterative deepening search 6 December 2018 27 27

Iterative deepening search l =0 6 December 2018 28

Iterative deepening search l =1 6 December 2018 29

Iterative deepening search l =2 6 December 2018 30

Iterative deepening search l =3 6 December 2018 31

Iterative Deepening search Number of nodes generated in a depth-limited search to depth d with branching factor b: NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd Number of nodes generated in an iterative deepening search to depth d with branching factor b: NIDS = (d+1)b0 + d b1 + (d-1)b2 + … + 3bd-2 +2bd-1 + 1bd For b = 10, d = 5, NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111 NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456 Overhead = (123,456 - 111,111)/111,111 = 11% 6 December 2018 32

Properties of iterative deepening search Complete? Yes Time? (d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd) Space? O(bd) Optimal? Yes, if step cost = 1 6 December 2018 33

Summary of Algorithms 6 December 2018 34

Questions 6 December 2018 35 35