Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.

Slides:



Advertisements
Similar presentations
Cooperating Intelligent Systems
Advertisements

Artificial Intelligence Solving problems by searching
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
January 26, 2003AI: Chapter 3: Solving Problems by Searching 1 Artificial Intelligence Chapter 3: Solving Problems by Searching Michael Scherger Department.
Comp 307 Problem Solving and Search Formalize a problem as State Space Search Blind search strategies Heuristic search.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
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.
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
Artificial Intelligence (CS 461D)
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
Artificial Intelligence Lecture No. 7 Dr. Asad Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
SEARCH APPLICATIONS David Kauchak CS30 – Spring 2015.
14 Jan 2004CS Blind Search1 Solving problems by searching Chapter 3.
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
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
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2004.
Artificial Intelligence
Searching the search space graph
Toy Problem: Missionaries and Cannibals
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
1 Solving Problems by Searching. 2 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space.
Solving problems by searching
1 Lecture 3 Uninformed Search
Problem-solving agents
1 Solving problems by searching Chapter 3. 2 Why Search? To achieve goals or to maximize our utility we need to predict what the result of our actions.
Solving Problems by Searching
Artificial Intelligence Course outline Introduction Problem solving Generic algorithms Knowledge Representation and Reasoning Expert Systems Uncertainty.
Review: Search problem formulation Initial state Actions Transition model Goal state (or goal test) Path cost What is the optimal solution? What is the.
1 Problem Solving and Searching CS 171/271 (Chapter 3) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Lecture 2-2CS250: Intro to AI/Lisp Implementing Search Lecture 2-2 January 14 th /19 th, 1999 CS250.
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department Read Russell & Norvig Sections (Also read Chapters 1 and 2 if.
Informed State Space Search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Problem Reduction Search: AND/OR Graphs & Game Trees Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Artificial Intelligence
AI in game (II) 권태경 Fall, outline Problem-solving agent Search.
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
Lecture 3: Uninformed Search
1 Solving problems by searching 171, Class 2 Chapter 3.
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.
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;
Goal-based Problem Solving Goal formation Based upon the current situation and performance measures. Result is moving into a desirable state (goal state).
Solving problems by searching 1. Outline Problem formulation Example problems Basic search algorithms 2.
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.
1 Solving Problems by Searching. 2 Terminology State State Space Goal Action Cost State Change Function Problem-Solving Agent State-Space Search.
Introduction to Artificial Intelligence (G51IAI) Dr Rong Qu Blind Searches - Introduction.
Solving problems by searching A I C h a p t e r 3.
1 CS B551: Elements of Artificial Intelligence Instructor: Kris Hauser
Blind Search Russell and Norvig: Chapter 3, Sections 3.4 – 3.6 CS121 – Winter 2003.
Search I Tuomas Sandholm Read Russell & Norvig Sections (Also read Chapters 1 and 2 if you haven’t already.) Next time we’ll cover topics related.
Biointelligence Lab School of Computer Sci. & Eng. Seoul National University Artificial Intelligence Chapter 8 Uninformed Search.
Solving problems by searching
Problem Solving and Searching
Problem Solving and Searching
Solving Problems by Searching
Presentation transcript:

Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur

CSE, IIT Kharagpur2 Search Frameworks State space search –Uninformed / Blind search –Informed / Heuristic search Problem reduction search Game tree search Advances –Memory bounded search –Multi-objective search –Learning how to search

CSE, IIT Kharagpur3 State space search Basic Search Problem: –Given: [S, s, O, G]where S is the (implicitly specified) set of states s is the start state O is the set of state transition operators G is the set of goal states –To find a sequence of state transitions leading from s to a goal state Variants (to be considered later) –Finding the shortest sequence –When operators have an associated cost

CSE, IIT Kharagpur4 8-puzzle problem State description (S) –Location of each of the eight tiles (and the blank) Start state (s) –The starting configuration (given) Operators (O) –Four operators, for moving the blank left, right, up or down Goals (G) –One or more goal configurations (given)

CSE, IIT Kharagpur5 8-queens problem Placing 8 queens on a chess board, so that none attacks the other Formulation – I –A state is any arrangement of 0 to 8 queens on board –Operators add a queen to any square Formulation – II –A state is any arrangement of 0-8 queens with none attacked –Operators place a queen in the left-most empty column Formulation – III –A state is any arrangement of 8 queens, one in each column –Operators move an attacked queen to another square in the same column

CSE, IIT Kharagpur6 Missionaries and cannibals Three missionaries and three cannibals are on one side of a river, along with a boat that can hold one or two people. Find a way to get everyone to the other side, without ever leaving a group of missionaries outnumbered by cannibals State: (#m, #c, 1/0) –#m denotes the number of missionaries in the first bank –#c denotes the number of cannibals in the first bank –The last bit indicates whether the boat is in the first bank. Starting state: (3, 3, 1) Goal state: (0, 0, 0) Operators: Boat carries (1, 0) or (0, 1) or (1, 1) or (2, 0) or (0, 2)

CSE, IIT Kharagpur7 Outline of a search algorithm 1.Initialize: Set OPEN = {s} 2.Fail: If OPEN = { }, then terminate with failure 3.Select: Select a state, n, from OPEN 4.Terminate: If n  G, terminate with success 5.Expand: Generate the successors of n using O and insert them in OPEN 6.Loop: Go To Step 2. Compare: OPEN is a queue (FIFO) versus a stack (LIFO) Is this algorithm guaranteed to terminate? Under what circumstances will it terminate?

CSE, IIT Kharagpur8 Complexity b: branching factor d: depth of the goal Breadth-first search: –Time: 1 + b + b 2 + b 3 + … + b d = O(b d ) –Space:O(b d ) Depth-first search: –Time: O(b m ), where m denotes depth of state space tree –Space:O(bm)

CSE, IIT Kharagpur9 Tradeoff between space and time Iterative deepening –Perform DFS repeatedly using increasing depth bounds –Works in O(b d ) time and O(bd) space Bi-directional search –Possible only if the operators are reversible –Works in O(b d/2 ) time and O(b d/2 ) space

CSE, IIT Kharagpur10 Saving the explicit space 1.Initialize: Set OPEN = {s}, CLOSED = { } 2.Fail: If OPEN = { }, then terminate with failure 3.Select: Select a state, n, from OPEN and save in CLOSED 4.Terminate: If n  G, terminate with success 5.Expand: Generate the successors of n using O. For each successor, m, insert m in OPEN only if m  [OPEN  CLOSED] 6.Loop: Go To Step 2.

CSE, IIT Kharagpur11 Some more general problems Search for Optimization: –Given: [S, s, O, G]where S is the (implicitly specified) set of states s is the start state O is the set of state transition operators each having some cost G is the set of goal states each having some cost –To find: –A minimum cost sequence of transitions to a goal state –A sequence of transitions to the minimum cost goal –A minimum cost sequence of transitions to a min cost goal –Are all these fundamentally different problems?

CSE, IIT Kharagpur12 Principle of Optimality for Dynamic Programming Any subsequence of an optimal sequence of transitions is also optimal. –This gives us the handle to grow an optimal partial solution into an optimal solution –Intermediate states (in a path from a start state to a goal state) may represent partial solutions –This does not hold for the longest path problem

CSE, IIT Kharagpur13 Uniform Cost Search This algorithm assumes that all operators have a cost: 1.Initialize: Set OPEN = {s}, CLOSED = { } Set C(s) = 0 2.Fail: If OPEN = { }, then terminate with failure 3.Select: Select the minimum cost state, n, from OPEN Save n in CLOSED 4.Terminate: If n  G, terminate with success 5.Expand: Generate the successors of n using O. For each successor, m: If m  [OPEN  CLOSED] Set C(m) = C(n) + C(n,m) and insert m in OPEN If m  [OPEN  CLOSED] Set C(m) = min {C(m), C(n) + C(n,m)} If C(m) has decreased and m  CLOSED, move it to OPEN 6.Loop: Go To Step 2.

CSE, IIT Kharagpur14 Searching with costs If all operator costs are positive, then the algorithm finds the minimum cost sequence of transitions to a goal. –No state comes back to OPEN from CLOSED If operators have unit cost, then this is same as BFS What happens if negative operator costs are allowed?

CSE, IIT Kharagpur15 Branch-and-bound 1.Initialize: Set OPEN = {s}, CLOSED = { }. Set C(s) = 0, C* =  2.Terminate: If OPEN = { }, then return C* 3.Select: Select a state, n, from OPEN and save in CLOSED 4.Terminate: If n  G and C(n) < C*, then Set C* = C(n) and Go To Step 2. 5.Expand: If C(n) < C* generate the successors of n For each successor, m: If m  [OPEN  CLOSED] Set C(m) = C(n) + C(n,m) and insert m in OPEN If m  [OPEN  CLOSED] Set C(m) = min {C(m), C(n) + C(n,m)} If C(m) has decreased and m  CLOSED, move it to OPEN 6.Loop: Go To Step 2.