Artificial Intelligence

Size: px
Start display at page:

Download "Artificial Intelligence"

Transcription

1 University of Cagliari M.Sc. degree in Electronic Engineering Artificial Intelligence Academic Year: 07/08 Instructor: Giorgio Fumera Exercises on search algorithms. A -litre and a -litre water jugs are available, together with a source of water. The two jugs are initially empty. Your task is to fill one of the jugs with exactly one litre of water, leaving the other empty, by drawing the lowest possible amount of water from the source. To this aim you are only allowed to add water from the source to one of the jugs until the jug is full, or to empty one of the jugs by throwing away the water it contains, or to pour the water of one of the jugs into the other until the former is empty or the latter is full (whatever happens first). (a) Formulate the above task as a search problem, by precisely defining the state space, the initial state, the goal test, the set of possible actions and the path cost. (b) Solve the above problem using the uniform cost search strategy, avoiding repeated states: build the search tree until a solution is found, by clearly showing the order of expansion of each node, the actions associated to the edges of the tree and their cost, the state and the path cost of each node. (c) Discuss the possibility of using informed search strategies for this problem.. The block s world is a well-known toy domain used in AI for planning problems related to robots. It consists of a set of blocks of various size, shape, and color, possibly identified by a letter or by a number, and placed on a surface (e.g., on a table); the blocks can be stacked into one or more piles, possibly with some constraints (depending, e.g., on their size); the goal is to form a target set of piles starting from a given initial configuration, by moving one block at a time, either to the table or atop another pile of blocks, and only if it is not under another block. Consider a simple version of this problem, in which there are five blocks numbered from to. The figure below shows two possible configurations of such blocks; note that the relative position of the piles does not matter, thus the configuration on the left is equivalent to the one in the middle. Every block can be either on the table or atop any another block. The goal is to stack the blocks into a single pile in the sequence shown in the right, from (at the top of the pile) to (at the bottom of the pile), starting from a given set of piles, by moving the smallest possible number of blocks. Only a block that is not under another block can be moved, and can be only placed either on the table or atop another pile. (a) Formulate the above version of the block s world as a search problem, by precisely defining the state space, the initial state, the goal test, the set of possible actions and the path cost. (b) Assuming that the initial configuration is the one shown on the left in the figure above, and considering a heuristic function defined as the number of blocks that are not in the highest pile (or in one of the highest piles), show how the A* search strategy builds the search tree by expanding only the first four nodes, avoiding repeated states. Cleary show the order of expansion of each node, the actions

2 associated to the edges of the tree and their cost, and the state, the path cost and the value of the heuristic of each node. (c) Define another possible admissible heuristic, and clearly motivate its admissibility.. The map-colouring problem consists of finding an assignment of k > different colours to the regions of a given map, in such a way that no pair of neighbouring regions (whose borders do not consist of a single point) are given the same colour. This is a well-known problem of topological graph theory, derived from a practical cartographic task, and it is known that a solution with k = exists for any map. (a) Formulate the map-colouring problem, for k = colours, as a search problem, by precisely defining the state space, the initial state, the goal test, the set of possible actions and the path cost. (b) What is the depth of the solution(s)? What is the branching factor of the search tree? (c) Considering the proposed formulation, what uninformed search strategy do you deem more suitable to solve this problem, in terms of space and time complexity? Do you think that informed search strategies can be more efficient or more effective? (Clearly motivate your answers.)

3 Solution Exercise (a) A state of this problem corresponds to the amount of water (e.g., in litres) in the two jugs, and can thus be represented by an ordered pair of numbers (b, b ), where b corresponds to the largest jug. Taking into account the allowed actions, it follows that the state space is the set of integer pairs (b, b ) such that b {0,,..., } and b {0,,, } (note that it is not possible to make the two jugs contain a non-integer amount of water in litres, using the available actions). Note that not all actions are reversible, and therefore the state space is an oriented graph. A node (state) A = (b, b ) of the state space is connected to another node B = (b, b ) by an oriented edge from A to B, if B can be reached from A through one of the allowed actions; for instance, state (, ) is connected to (, 0) since the latter can be obtained by the former by throwing away the water in the largest jug. The initial state is (0, 0). There are two goal states: (, 0) and (0, ). Actions can be described as follows: a : adding water from the source to the smallest jug until that jug is full: (b, b ) (b, ); a : adding water from the source to the largest jug until that jug is full: (b, b ) (, b ); a : empty the smallest jug: (b, b ) (b, 0); a : empty the largest jug: (b, b ) (0, b ); a : pour the water from the largest to the smallest jug until the former is empty or the latter is full: (b, b ) (b ( b ), ), if b > b, or (b, b ) (0, b + b ), if b + b ; a 6 : pour the water from the smallest to the largest jug until the former is empty or the latter is full: (b, b ) (, b ( b )), if b > b, or (b, b ) (b + b, 0), if b + b. These actions can be represented by a successor function SF which, given a state (b, b ), returns all the pairs ((b, b ), a) where (b, b ) is the state that can be obtained from (b, b ) by the action a (a can be any description of the corresponding action, e.g., a character string). To define the path cost, note that the goal definition includes the requirement of drawing the lowest possible amount of water from the source. It follows that the path cost is the total amount of water (in litres) that has been drawn from the source, and thus the cost of each action is given by the corresponding amount of water drawn from the source. It easily follows that the cost of a is b l, the cost of a is b l, whereas all the other actions have a null cost. (b) The search tree built by the uniform cost search strategy is shown in the figure below. The state associated to each node is shown as a pair (b, b ). The corresponding path cost is shown on the left. The number on the right (in boldface) denotes the order in which that node has been expanded, i.e., when it has been selected from the fringe to generate its successors. On every edge the cost of the corresponding action is shown (actions are not explicitly shown, but can be easily identified). If a successor of a node being expanded is already present in the search tree with a lower path cost, it is not added to the tree.

4 (c) The state space is very small: it is not difficult to see that its size is at most, since no more than distinct pairs of integers (b, b ) with 0 b and 0 b exist. The branching factor is small as well, since at most six different actions can be carried out from every state. Therefore, if repeated states are avoided as described above, a solution can be reached by any uninformed search strategy by expanding and generating a small number of nodes. This means that informed search strategies are not useful for this problem. Moreover, it is difficult to define effective, admissible heuristics for this problem. For instance, it is not difficult to see that in this case relaxing one or more of the constraints (i.e., the constraint that water must be added to a jug until it is full, thrown away from a jug until it is empty, or poured from a jug until it is empty or the other jug is full) does not lead to a problem in which it is possible to compute the exact cost of the solution from every node (state). Esercizio (a) The state space is made up of the set of distinct arrangements of the five blocks into one or more (up to five) piles. A state can be represented by a set of sequences of the numbers,...,, where each sequence corresponds to one pile. For instance, assuming that the block numbers of a pile, from top to bottom, are listed in a sequence from left to right, the arrangement on the left (and in the middle) in the above figure is represented by the set {(,, ), (, )} (remember that there is no intrinsic ordering between the elements of a set, and therefore the set above is equivalent to the set {(, ), (,, )}). Accordingly, the goal state is (,,,, ). The actions can be formally described as follows: given a state {(b,,..., b,n ),..., (b p,,..., b p,np )}, where p denotes the number of piles ( p ) and n k the number of blocks in the k-th pile (n k for each k, and p k= n k = ), the actions consist of moving one of the p blocks b k, (on the top of one of the piles) either to the table, generating a new pile (only if the corresponding n k > ), or atop one of the other p piles. The successor function SF gets as input the description s of a state and returns all the pairs (s, a) where s is one of the states obtained as described above, and a the description of the corresponding action. The actions can be described by indicating the number of the block that has been moved, b k,, and its new position, i.e., the number of the block atop of which it has been placed, or the table (which can be denoted by the number 0). For instance, from state {(,, ), (, )} the action (, 0) consists of moving the block to the table, leading to the state {(, ), (), (, )}, and (, ) consists of moving the block atop the block, leading to the state {(,,, ), ()}. Finally, since the goal definition is to reach the target configuration by moving the smallest possible number of blocks, it follows that the path cost is given by the number of actions that have been carried out, and thus every action has a unit cost. (b) The search tree obtained by the A* search strategy after the expansion of the first four nodes, using the heuristic given in the text and avoiding the repeated states, is shown in the figure below. The A* evaluation function (path cost + heuristic) is shown below each state. The numbers inside circles denote the order in which the corresponding node has been expanded. Note that the third node has no successors, since the only action that can be carried out on its state leads to the state of its parent node, which is already in the tree. Note also the fourth node to be expanded can be chosen among two nodes that have the same value of the evaluation function (both these nodes are denoted with the number ); in this case a random choice has to be made: the figure shows the successors of both nodes for the sake of completeness.

5 (c) Another possible admissible heuristic is the following: let n be the number of blocks above which there is a block different from the one in the goal state; then the heuristic is defined as n/. For instance, if the goal state is {(,,,, )}, in the state {(,, ), (, )}: there is no block atop block, which counts as 0; there is no block atop block, contrary to the goal state: this counts as ; block is atop block, instead of block : this counts as ; block is atop block, instead of block : this counts as ; block is atop block, instead of block : this counts as. This means that the value of the heuristic function for state {(,, ), (, )} is / =, i.e., at least two blocks must be moved to reach the goal state. It is not difficult to see that this heuristic is admissible: by moving one block from any state s, at most two other blocks will have a different block atop in the resulting state s, and therefore in s at most two more blocks than in s can have the correct block atop as in the goal state. Exercise (a) Any given map can be represented as an undirected graph G, in which every node corresponds to a distinct region, and every edge connects a pair of nodes corresponding to neighbouring regions. An example is shown in the figure below, for a map with five regions. R R R R R R R R R R Every node of G can be labelled with the colour that is assigned to the corresponding region. In the following the four available colours (labels) will be denoted as c,..., c. It is also useful to represent

6 partial solutions in which only some regions have already been assigned a colour: to this aim, the absence of a colour can be denoted with the symbol c 0. A possible problem formulation is the following: A state corresponds to any assignment of labels (colours), including partial assignments, to the nodes of G, such that no pair of nodes connected by an edge (i.e., no neighbouring regions in the map) have the same label, except for c 0. The initial state is the graph G with all nodes (regions) labelled as c 0. The goal states are the graphs G in which all nodes have a label different from c 0. The actions correspond to assigning a label c k, with k {c,..., c }, to a node with label c 0 (i.e., assigning a colour to an uncoloured region), provided that no connected node has the same label c k. Accordingly, the state space is in a directed graph whose nodes correspond to the above states (partially or fully coloured maps), and every edge connects a state s with at least one node n of G labelled with c 0 to a state identical to s except for the label of n. The successor function SF takes as argument the graph G with a given label assignment, and returns every possible pairs (G, a) where G is obtained from G by assigning a permitted label to one of its nodes with label c 0, and a denotes the corresponding action, i.e., the node to which a label has been new assigned and the newly assigned label. In the goal formulation there are no requirements that can be expressed in terms of a path cost. It follows that actions have no cost, and that informed search strategies cannot be used. Note that map-colouring is an instance of so-called constraint satisfaction problems, for which specific algorithms exist. Let R denote the number of regions. It is easy to see that in the above formulation every goal state has depth R, indeed, every action consists of assigning a permitted colour to a region previously uncoloured. It also follows that every node of the search tree at depth R is a solution. The branching factor depends on the number of regions (nodes of G) with label c 0, and on the number of colours that can be assigned to each of such regions without violating the constraint of the map-colouring problem. For instance, the branching factor of the initial state is R, since all the four available colours can be assigned to every region. It is easy to see that the branching factor decreases with the depth of the search tree. (b) In the above formulation the branching factor of some nodes can be high. On the other hand, not all permitted, partial label assignments lead to a solution; in other words, during the construction of the search tree some leaves at depth d < R can correspond to assignments of colours to d regions of G such that no label assignment to the remaining R d regions fulfils the constraint of the map-colouring problem. This means that the corresponding nodes of the search tree have no successors. Since all solutions have depth R, breadth-first search expands all the nodes up to depth R included, and keeps in memory all the generated nodes. Uniform-cost search is not applicable, since the path cost is not defined. Depth-first search keeps in memory only the nodes of the search tree in a single path (including their sibling nodes); moreover, it finds a solution as soon as it explores one of the paths of depth R, which means that the nodes in the other paths toward different solutions are not expanded. This means that depth-first search is more efficient than breadth-first search (although the above argument does not prove that their asymptotic worst-case time complexity is different). Finally, for the reason pointed out above, informed search strategies cannot be applied to this problem.

CAP 4630 Artificial Intelligence

CAP 4630 Artificial Intelligence CAP 4630 Artificial Intelligence Instructor: Sam Ganzfried sganzfri@cis.fiu.edu 1 http://www.ultimateaiclass.com/ https://moodle.cis.fiu.edu/ 2 Solving problems by search 3 8-puzzle 4 8-queens 5 Search

More information

1 Introduction and Examples

1 Introduction and Examples 1 Introduction and Examples Sequencing Problems Definition A sequencing problem is one that involves finding a sequence of steps that transforms an initial system state to a pre-defined goal state for

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Academic year 2016/2017 Giorgio Fumera http://pralab.diee.unica.it fumera@diee.unica.it Pattern Recognition and Applications Lab Department of Electrical and Electronic Engineering

More information

Artificial Intelligence Search: summary&exercises. Peter Antal

Artificial Intelligence Search: summary&exercises. Peter Antal Artificial Intelligence Search: summary&exercises Peter Antal antal@mit.bme.hu 1 A problem is defined by: An initial state, e.g. Arad Successor function S(X)= set of action-state pairs e.g. S(Arad)={

More information

CS 5522: Artificial Intelligence II

CS 5522: Artificial Intelligence II CS 5522: Artificial Intelligence II Search Algorithms Instructor: Wei Xu Ohio State University [These slides were adapted from CS188 Intro to AI at UC Berkeley.] Today Agents that Plan Ahead Search Problems

More information

CS540 Uninformed Search

CS540 Uninformed Search CS540 Uninformed Search Xiaojin Zhu jerryzhu@cs.wisc.edu Computer Sciences Department University of Wisconsin, Madison slide 1 Main messages Many AI problems can be formulated as search. Iterative deepening

More information

Chapter 3: Solving Problems by Searching

Chapter 3: Solving Problems by Searching Chapter 3: Solving Problems by Searching Prepared by: Dr. Ziad Kobti 1 Problem-Solving Agent Reflex agent -> base its actions on a direct mapping from states to actions. Cannot operate well in large environments

More information

Artificial Intelligence Uninformed search

Artificial Intelligence Uninformed search Artificial Intelligence Uninformed search A.I. Uninformed search 1 The symbols&search hypothesis for AI Problem-solving agents A kind of goal-based agent Problem types Single state (fully observable) Search

More information

Uninformed Search. CPSC 322 Lecture 5. September 14, 2007 Textbook 2.4. Graph Search Searching Depth-First Search

Uninformed Search. CPSC 322 Lecture 5. September 14, 2007 Textbook 2.4. Graph Search Searching Depth-First Search Uninformed Search CPSC 322 Lecture 5 September 14, 2007 Textbook 2.4 Uninformed Search CPSC 322 Lecture 5, Slide 1 Lecture Overview 1 Graph Search 2 Searching 3 Depth-First Search Uninformed Search CPSC

More information

CS242 Uninformed Search

CS242 Uninformed Search CS242 Uninformed Search Lecturer: Ji Liu Thanks for Jerry Zhu's slides slide 1 Main messages Many (classic) AI problems can be formulated as search. Iterative deepening is good when you don t know much.

More information

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

Search I. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig Search I slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig Problem-Solving Agents Intelligent agents can solve problems by searching a state-space State-space Model the agent s model of

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching 1 Terminology State State Space Initial State Goal Test Action Step Cost Path Cost State Change Function State-Space Search 2 Formal State-Space Model Problem = (S, s, A,

More information

Problem Solving and Search

Problem Solving and Search Artificial Intelligence Problem Solving and Search Dae-Won Kim School of Computer Science & Engineering Chung-Ang University Outline Problem-solving agents Problem types Problem formulation Example problems

More information

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.

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. 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. A problem can be defined by four components : 1. The

More information

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

Informed (Heuristic) Search. Idea: be smart about what paths to try. Informed (Heuristic) Search Idea: be smart about what paths to try. 1 Blind Search vs. Informed Search What s the difference? How do we formally specify this? A node is selected for expansion based on

More information

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

CS 4700: Foundations of Artificial Intelligence. Bart Selman. Search Techniques R&N: Chapter 3 CS 4700: Foundations of Artificial Intelligence Bart Selman Search Techniques R&N: Chapter 3 Outline Search: tree search and graph search Uninformed search: very briefly (covered before in other prerequisite

More information

Heuristic (Informed) Search

Heuristic (Informed) Search Heuristic (Informed) Search (Where we try to choose smartly) R&N: Chap. 4, Sect. 4.1 3 1 Recall that the ordering of FRINGE defines the search strategy Search Algorithm #2 SEARCH#2 1. INSERT(initial-node,FRINGE)

More information

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department

Princess Nora University Faculty of Computer & Information Systems ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department Princess Nora University Faculty of Computer & Information Systems 1 ARTIFICIAL INTELLIGENCE (CS 370D) Computer Science Department (CHAPTER-3-PART1) PROBLEM SOLVING AND SEARCH (Course coordinator) WHY

More information

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions Dr. Amotz Bar-Noy s Compendium of Algorithms Problems Problems, Hints, and Solutions Chapter 1 Searching and Sorting Problems 1 1.1 Array with One Missing 1.1.1 Problem Let A = A[1],..., A[n] be an array

More information

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies

Part I. Instructor: Dr. Wei Ding. Uninformed Search Strategies can find solutions to problems by. Informed Search Strategies Informed Search and Exploration Part I Instructor: Dr. Wei Ding Fall 2010 1 Motivation Uninformed Search Strategies can find solutions to problems by Systematically generating new states Testing them against

More information

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence CS 188: Artificial Intelligence Today Informed Search Informed Search Heuristics Greedy Search A* Search Instructor: Marco Alvarez University of Rhode Island (These slides were created/modified by Dan

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 9. István Szapudi Institute for Astronomy University of Hawaii March 21, 2018 Outline Reminder 1 Reminder 2 3 Reminder We have demonstrated

More information

CS188: Artificial Intelligence, Fall 2008

CS188: Artificial Intelligence, Fall 2008 CS188: Artificial Intelligence, Fall 008 CS188 Spring 010Written SectionAssignment 1: Search 1 Due: September 11th at the beginning of lecture 1 Search algorithms in action ( ) 1 Graph Search Strategies

More information

Search in discrete and continuous spaces

Search in discrete and continuous spaces UNSW COMP3431: Robot Architectures S2 2006 1 Overview Assignment #1 Answer Sheet Search in discrete and continuous spaces Due: Start of Lab, Week 6 (1pm, 30 August 2006) The goal of this assignment is

More information

Goal-Based Agents Problem solving as search. Outline

Goal-Based Agents Problem solving as search. Outline Goal-Based Agents Problem solving as search Vasant Honavar Bioinformatics and Computational Biology Program Center for Computational Intelligence, Learning, & Discovery honavar@cs.iastate.edu www.cs.iastate.edu/~honavar/

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching CS486/686 University of Waterloo Sept 11, 2008 1 Outline Problem solving agents and search Examples Properties of search algorithms Uninformed search Breadth first Depth first

More information

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

CS486/686 Lecture Slides (c) 2015 P.Poupart 1 2 Solving Problems by Searching [RN2] Sec 3.1-3.5 [RN3] Sec 3.1-3.4 CS486/686 University of Waterloo Lecture 2: May 7, 2015 3 Outline Problem solving agents and search Examples Properties of search algorithms

More information

CPS 170: Artificial Intelligence Search

CPS 170: Artificial Intelligence   Search CPS 170: Artificial Intelligence http://www.cs.duke.edu/courses/spring09/cps170/ Search Instructor: Vincent Conitzer Search We have some actions that can change the state of the world Change resulting

More information

Efficient memory-bounded search methods

Efficient memory-bounded search methods Efficient memory-bounded search methods Mikhail Simin Arjang Fahim CSCE 580: Artificial Intelligence Fall 2011 Dr. Marco Voltorta Outline of The Presentation Motivations and Objectives Background - BFS

More information

mywbut.com Uninformed Search

mywbut.com Uninformed Search Uninformed Search 1 2.4 Search Searching through a state space involves the following: set of states Operators and their costs Start state test to check for goal state We will now outline the basic search

More information

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

Week 3: Path Search. COMP9414/ 9814/ 3411: Artificial Intelligence. Motivation. Example: Romania. Romania Street Map. Russell & Norvig, Chapter 3. COMP9414/9814/3411 17s1 Search 1 COMP9414/ 9814/ 3411: Artificial Intelligence Week 3: Path Search Russell & Norvig, Chapter 3. Motivation Reactive and Model-Based Agents choose their actions based only

More information

Problem solving and search

Problem solving and search Problem solving and search Chapter 3 Chapter 3 1 Outline Problem-solving agents Problem types Problem formulation Example problems Uninformed search algorithms Informed search algorithms Chapter 3 2 Restricted

More information

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

CS486/686 Lecture Slides (c) 2014 P.Poupart 1 2 1 Solving Problems by Searching [RN2] Sec 3.1-3.5 [RN3] Sec 3.1-3.4 CS486/686 University of Waterloo Lecture 2: January 9, 2014 3 Outline Problem solving agents and search Examples Properties of search

More information

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

Uninformed Search. Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday Uninformed Search Reading: Chapter 4 (Tuesday, 2/5) HW#1 due next Tuesday 1 Uninformed Search through the space of possible solutions Use no knowledge about which path is likely to be best Exception: uniform

More information

mywbut.com Informed Search Strategies-I

mywbut.com Informed Search Strategies-I Informed Search Strategies-I 1 3.1 Introduction We have outlined the different types of search strategies. In the earlier chapter we have looked at different blind search strategies. Uninformed search

More information

Today. Informed Search. Graph Search. Heuristics Greedy Search A* Search

Today. Informed Search. Graph Search. Heuristics Greedy Search A* Search Informed Search [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available at http://ai.berkeley.edu.] Today Informed Search Heuristics

More information

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

Chapter3. Problem-Solving Agents. Problem Solving Agents (cont.) Well-defined Problems and Solutions. Example Problems. Problem-Solving Agents Chapter3 Solving Problems by Searching Reflex agents cannot work well in those environments - state/action mapping too large - take too long to learn Problem-solving agent - is one

More information

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet.

ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet. CS Summer Introduction to Artificial Intelligence Midterm ˆ You have approximately minutes. ˆ The exam is closed book, closed calculator, and closed notes except your one-page crib sheet. ˆ Mark your answers

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Search Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Outline Problem formulation & examples Basic search algorithms 2/100 Example:

More information

Informed Search Algorithms

Informed Search Algorithms Informed Search Algorithms CITS3001 Algorithms, Agents and Artificial Intelligence Tim French School of Computer Science and Software Engineering The University of Western Australia 2017, Semester 2 Introduction

More information

Last time: Problem-Solving

Last time: Problem-Solving Last time: Problem-Solving Problem solving: Goal formulation Problem formulation (states, operators) Search for solution Problem formulation: Initial state??? 1 Last time: Problem-Solving Problem types:

More information

521495A: Artificial Intelligence

521495A: Artificial Intelligence 521495A: Artificial Intelligence Informed Search Lectured by Abdenour Hadid Adjunct Professor, CMVS, University of Oulu Slides adopted from http://ai.berkeley.edu Today Informed Search Heuristics Greedy

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Admissible Heuristics Graph Search Consistent Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing

More information

Mini-Project 1: The Library of Functions and Piecewise-Defined Functions

Mini-Project 1: The Library of Functions and Piecewise-Defined Functions Name Course Days/Start Time Mini-Project 1: The Library of Functions and Piecewise-Defined Functions Part A: The Library of Functions In your previous math class, you learned to graph equations containing

More information

B-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree

B-Trees. Disk Storage. What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree. Deletion in a B-tree B-Trees Disk Storage What is a multiway tree? What is a B-tree? Why B-trees? Insertion in a B-tree Deletion in a B-tree Disk Storage Data is stored on disk (i.e., secondary memory) in blocks. A block is

More information

CS 343: Artificial Intelligence

CS 343: Artificial Intelligence CS 343: Artificial Intelligence Informed Search Prof. Scott Niekum University of Texas at Austin [These slides based on ones created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley.

More information

Potential Midterm Exam Questions

Potential Midterm Exam Questions Potential Midterm Exam Questions 1. What are the four ways in which AI is usually viewed? Which of the four is the preferred view of the authors of our textbook? 2. What does each of the lettered items

More information

Uninformed Search. CPSC 322 Lecture 5. January 17, 2007 Textbook 2.4. Uninformed Search CPSC 322 Lecture 5, Slide 1

Uninformed Search. CPSC 322 Lecture 5. January 17, 2007 Textbook 2.4. Uninformed Search CPSC 322 Lecture 5, Slide 1 Uninformed Search CPSC 322 Lecture 5 January 17, 2007 Textbook 2.4 Uninformed Search CPSC 322 Lecture 5, Slide 1 Lecture Overview 1 Graph Search 2 Searching 3 Depth-First Search Uninformed Search CPSC

More information

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems

CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems CS 380/480 Foundations of Artificial Intelligence Winter 2007 Assignment 2 Solutions to Selected Problems 1. Search trees for the state-space graph given below: We only show the search trees corresponding

More information

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer)

COSC 2007 Data Structures II Final Exam. Part 1: multiple choice (1 mark each, total 30 marks, circle the correct answer) COSC 2007 Data Structures II Final Exam Thursday, April 13 th, 2006 This is a closed book and closed notes exam. There are total 3 parts. Please answer the questions in the provided space and use back

More information

Artificial Intelligence Informed Search

Artificial Intelligence Informed Search Artificial Intelligence Informed Search Instructors: David Suter and Qince Li Course Delivered @ Harbin Institute of Technology [Many slides adapted from those created by Dan Klein and Pieter Abbeel for

More information

Multi-way Search Trees! M-Way Search! M-Way Search Trees Representation!

Multi-way Search Trees! M-Way Search! M-Way Search Trees Representation! Lecture 10: Multi-way Search Trees: intro to B-trees 2-3 trees 2-3-4 trees Multi-way Search Trees A node on an M-way search tree with M 1 distinct and ordered keys: k 1 < k 2 < k 3

More information

Chapter 3 Solving problems by searching

Chapter 3 Solving problems by searching 1 Chapter 3 Solving problems by searching CS 461 Artificial Intelligence Pinar Duygulu Bilkent University, Slides are mostly adapted from AIMA and MIT Open Courseware 2 Introduction Simple-reflex agents

More information

CSCI 446: Artificial Intelligence

CSCI 446: Artificial Intelligence CSCI 446: Artificial Intelligence Informed Search Instructor: Michele Van Dyne [These slides were created by Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. All CS188 materials are available

More information

A* optimality proof, cycle checking

A* optimality proof, cycle checking A* optimality proof, cycle checking CPSC 322 Search 5 Textbook 3.6 and 3.7.1 January 21, 2011 Taught by Mike Chiang Lecture Overview Recap Admissibility of A* Cycle checking and multiple path pruning Slide

More information

Graph Search. Chris Amato Northeastern University. Some images and slides are used from: Rob Platt, CS188 UC Berkeley, AIMA

Graph Search. Chris Amato Northeastern University. Some images and slides are used from: Rob Platt, CS188 UC Berkeley, AIMA Graph Search Chris Amato Northeastern University Some images and slides are used from: Rob Platt, CS188 UC Berkeley, AIMA What is graph search? Start state Goal state Graph search: find a path from start

More information

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

CMU-Q Lecture 2: Search problems Uninformed search. Teacher: Gianni A. Di Caro CMU-Q 15-381 Lecture 2: Search problems Uninformed search Teacher: Gianni A. Di Caro RECAP: ACT RATIONALLY Think like people Think rationally Agent Sensors? Actuators Percepts Actions Environment Act like

More information

Lecture 14: March 9, 2015

Lecture 14: March 9, 2015 324: tate-space, F, F, Uninformed earch. pring 2015 Lecture 14: March 9, 2015 Lecturer: K.R. howdhary : Professor of (VF) isclaimer: These notes have not been subjected to the usual scrutiny reserved for

More information

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1

1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 Asymptotics, Recurrence and Basic Algorithms 1. [1 pt] What is the solution to the recurrence T(n) = 2T(n-1) + 1, T(1) = 1 2. O(n) 2. [1 pt] What is the solution to the recurrence T(n) = T(n/2) + n, T(1)

More information

: Principles of Automated Reasoning and Decision Making Midterm

: Principles of Automated Reasoning and Decision Making Midterm 16.410-13: Principles of Automated Reasoning and Decision Making Midterm October 20 th, 2003 Name E-mail Note: Budget your time wisely. Some parts of this quiz could take you much longer than others. Move

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Exercises & Solutions Chapters -4: Search methods. Search Tree. Draw the complete search tree (starting from S and ending at G) of the graph below. The numbers beside the nodes

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

Solving Problems by Searching

Solving Problems by Searching INF5390 Kunstig intelligens Sony Vaio VPC-Z12 Solving Problems by Searching Roar Fjellheim Outline Problem-solving agents Example problems Search programs Uninformed search Informed search Summary AIMA

More information

Announcements. Project 0: Python Tutorial Due last night

Announcements. Project 0: Python Tutorial Due last night Announcements Project 0: Python Tutorial Due last night HW1 officially released today, but a few people have already started on it Due Monday 2/6 at 11:59 pm P1: Search not officially out, but some have

More information

Uninformed Search Strategies

Uninformed Search Strategies Uninformed Search Strategies Alan Mackworth UBC CS 322 Search 2 January 11, 2013 Textbook 3.5 1 Today s Lecture Lecture 4 (2-Search1) Recap Uninformed search + criteria to compare search algorithms - Depth

More information

CSC 2114: Artificial Intelligence Search

CSC 2114: Artificial Intelligence Search CSC 2114: Artificial Intelligence Search Ernest Mwebaze emwebaze@cit.ac.ug Office: Block A : 3 rd Floor [Slide Credit Dan Klein and Pieter Abbeel for CS188 Intro to AI at UC Berkeley. Reference materials

More information

Search : Lecture 2. September 9, 2003

Search : Lecture 2. September 9, 2003 Search 6.825: Lecture 2 September 9, 2003 1 Problem-Solving Problems When your environment can be effectively modeled as having discrete states and actions deterministic, known world dynamics known initial

More information

Algorithms for Data Structures: Uninformed Search. Phillip Smith 19/11/2013

Algorithms for Data Structures: Uninformed Search. Phillip Smith 19/11/2013 lgorithms for Data Structures: Uninformed Search Phillip Smith 19/11/2013 Representations for Reasoning We know (at least) two models of a world: model of the static states of the world model of the effects

More information

CS 8520: Artificial Intelligence

CS 8520: Artificial Intelligence CS 8520: Artificial Intelligence Solving Problems by Searching Paula Matuszek Spring, 2013 Slides based on Hwee Tou Ng, aima.eecs.berkeley.edu/slides-ppt, which are in turn based on Russell, aima.eecs.berkeley.edu/slides-pdf.

More information

Search: Advanced Topics and Conclusion

Search: Advanced Topics and Conclusion Search: Advanced Topics and Conclusion CPSC 322 Lecture 8 January 20, 2006 Textbook 2.6 Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 1 Lecture Overview Recap Branch & Bound A Tricks

More information

Spring 2007 Midterm Exam

Spring 2007 Midterm Exam 15-381 Spring 2007 Midterm Exam Spring 2007 March 8 Name: Andrew ID: This is an open-book, open-notes examination. You have 80 minutes to complete this examination. Unless explicitly requested, we do not

More information

Ar#ficial)Intelligence!!

Ar#ficial)Intelligence!! Introduc*on! Ar#ficial)Intelligence!! Roman Barták Department of Theoretical Computer Science and Mathematical Logic Uninformed (blind) search algorithms can find an (optimal) solution to the problem,

More information

4. Solving Problems by Searching

4. Solving Problems by Searching COMP9414/9814/3411 15s1 Search 1 COMP9414/ 9814/ 3411: Artificial Intelligence 4. Solving Problems by Searching Russell & Norvig, Chapter 3. Motivation Reactive and Model-Based Agents choose their actions

More information

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1

Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 CME 305: Discrete Mathematics and Algorithms Instructor: Professor Aaron Sidford (sidford@stanford.edu) January 11, 2018 Lecture 2 - Graph Theory Fundamentals - Reachability and Exploration 1 In this lecture

More information

Assignment 1 is out! Due: 9 Sep 23:59! Can work in a group of 2-3 students.! NO cheating!!!! Submit in turnitin! Code + report!

Assignment 1 is out! Due: 9 Sep 23:59! Can work in a group of 2-3 students.! NO cheating!!!! Submit in turnitin! Code + report! Assignment 1 is out! Due: 9 Sep 23:59! Submit in turnitin! Code + report! Can work in a group of 2-3 students.! Please register your group in the website linked from the assignment description before tomorrow

More information

Informed Search Methods

Informed Search Methods Informed Search Methods How can we improve searching strategy by using intelligence? Map example: Heuristic: Expand those nodes closest in as the crow flies distance to goal 8-puzzle: Heuristic: Expand

More information

CS 520: Introduction to Artificial Intelligence. Lectures on Search

CS 520: Introduction to Artificial Intelligence. Lectures on Search CS 520: Introduction to Artificial Intelligence Prof. Louis Steinberg Lecture : uninformed search uninformed search Review Lectures on Search Formulation of search problems. State Spaces Uninformed (blind)

More information

Solving Problems by Searching

Solving Problems by Searching Solving Problems by Searching Berlin Chen 2004 Reference: 1. S. Russell and P. Norvig. Artificial Intelligence: A Modern Approach. Chapter 3 1 Introduction Problem-Solving Agents vs. Reflex Agents Problem-solving

More information

Artificial Intelligence (part 4a) Problem Solving Using Search: Structures and Strategies for State Space Search

Artificial Intelligence (part 4a) Problem Solving Using Search: Structures and Strategies for State Space Search Artificial Intelligence (part 4a) Problem Solving Using Search: Structures and Strategies for State Space Search Course Contents Again..Selected topics for our course. Covering all of AI is impossible!

More information

Motivation for B-Trees

Motivation for B-Trees 1 Motivation for Assume that we use an AVL tree to store about 20 million records We end up with a very deep binary tree with lots of different disk accesses; log2 20,000,000 is about 24, so this takes

More information

General Methods and Search Algorithms

General Methods and Search Algorithms DM811 HEURISTICS AND LOCAL SEARCH ALGORITHMS FOR COMBINATORIAL OPTIMZATION Lecture 3 General Methods and Search Algorithms Marco Chiarandini 2 Methods and Algorithms A Method is a general framework for

More information

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit

Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, Chapter 3 Informed Searching. Mustafa Jarrar. University of Birzeit Mustafa Jarrar: Lecture Notes on Artificial Intelligence Birzeit University, 2018 Chapter 3 Informed Searching Mustafa Jarrar University of Birzeit Jarrar 2018 1 Watch this lecture and download the slides

More information

CSCI-630 Foundations of Intelligent Systems Fall 2015, Prof. Zanibbi

CSCI-630 Foundations of Intelligent Systems Fall 2015, Prof. Zanibbi CSCI-630 Foundations of Intelligent Systems Fall 2015, Prof. Zanibbi Midterm Examination Name: October 16, 2015. Duration: 50 minutes, Out of 50 points Instructions If you have a question, please remain

More information

Some major graph problems

Some major graph problems CS : Graphs and Blobs! Prof. Graeme Bailey http://cs.cs.cornell.edu (notes modified from Noah Snavely, Spring 009) Some major graph problems! Graph colouring Ensuring that radio stations don t clash! Graph

More information

Chapter 4. Uninformed Search Strategies

Chapter 4. Uninformed Search Strategies Chapter 4. Uninformed Search Strategies An uninformed (a.k.a. blind, brute-force) search algorithm generates the search tree without using any domain specific knowledge. The two basic approaches differ

More information

Uninformed Search Methods

Uninformed Search Methods Uninformed Search Methods Search Algorithms Uninformed Blind search Breadth-first uniform first depth-first Iterative deepening depth-first Bidirectional Branch and Bound Informed Heuristic search Greedy

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

Searching with Partial Information

Searching with Partial Information Searching with Partial Information Above we (unrealistically) assumed that the environment is fully observable and deterministic Moreover, we assumed that the agent knows what the effects of each action

More information

Heuristic (Informed) Search

Heuristic (Informed) Search Heuristic (Informed) Search (Where we try to choose smartly) R&N: Chap., Sect..1 3 1 Search Algorithm #2 SEARCH#2 1. INSERT(initial-node,Open-List) 2. Repeat: a. If empty(open-list) then return failure

More information

3 No-Wait Job Shops with Variable Processing Times

3 No-Wait Job Shops with Variable Processing Times 3 No-Wait Job Shops with Variable Processing Times In this chapter we assume that, on top of the classical no-wait job shop setting, we are given a set of processing times for each operation. We may select

More information

AI: problem solving and search

AI: problem solving and search : problem solving and search Stefano De Luca Slides mainly by Tom Lenaerts Outline Problem-solving agents A kind of goal-based agent Problem types Single state (fully observable) Search with partial information

More information

CS510 \ Lecture Ariel Stolerman

CS510 \ Lecture Ariel Stolerman CS510 \ Lecture02 2012-10-03 1 Ariel Stolerman Midterm Evan will email about that after the lecture, at least 2 lectures from now. The exam will be given in a regular PDF (not an online form). We will

More information

PAC-MAN is one of the most popular game

PAC-MAN is one of the most popular game SCHOOL OF DATA SCIENCE 1 Assignment1. Search in Pacman Project Report Shihan Ran - 15307130424 Abstract This project is aimed at designing a intelligent Pacman agent that is able to find optimal paths

More information

Chapter S:II. II. Search Space Representation

Chapter S:II. II. Search Space Representation Chapter S:II II. Search Space Representation Systematic Search Encoding of Problems State-Space Representation Problem-Reduction Representation Choosing a Representation S:II-1 Search Space Representation

More information

Heuristic Search. Heuristic Search. Heuristic Search. CSE 3401: Intro to AI & LP Informed Search

Heuristic Search. Heuristic Search. Heuristic Search. CSE 3401: Intro to AI & LP Informed Search CSE 3401: Intro to AI & LP Informed Search Heuristic Search. Required Readings: Chapter 3, Sections 5 and 6, and Chapter 4, Section 1. In uninformed search, we don t try to evaluate which of the nodes

More information

Optimization I : Brute force and Greedy strategy

Optimization I : Brute force and Greedy strategy Chapter 3 Optimization I : Brute force and Greedy strategy A generic definition of an optimization problem involves a set of constraints that defines a subset in some underlying space (like the Euclidean

More information

Lecture 10 Graph algorithms: testing graph properties

Lecture 10 Graph algorithms: testing graph properties Lecture 10 Graph algorithms: testing graph properties COMP 523: Advanced Algorithmic Techniques Lecturer: Dariusz Kowalski Lecture 10: Testing Graph Properties 1 Overview Previous lectures: Representation

More information

Topic 1 Uninformed Search

Topic 1 Uninformed Search Topic 1 Uninformed Search [George F Luger. 2008. Artificial Intelligence Structures and Strategies for Complex Problem Solving. 6 th Ed. Pearson. ISBN: 0321545893.] 1 Contents 1. Depth-First Search (DFS)

More information

Solving Problems by Searching

Solving Problems by Searching INF5390 Kunstig intelligens Solving Problems by Searching Roar Fjellheim Outline Problem-solving agents Example problems Search programs Uninformed search Informed search Summary AIMA Chapter 3: Solving

More information

CSCI2100B Data Structures Trees

CSCI2100B Data Structures Trees CSCI2100B Data Structures Trees Irwin King king@cse.cuhk.edu.hk http://www.cse.cuhk.edu.hk/~king Department of Computer Science & Engineering The Chinese University of Hong Kong Introduction General Tree

More information