Introduction to Artificial Intelligence Problem Solving Ruth Bergman Fall 2002.

Slides:



Advertisements
Similar presentations
Solving problems by searching Chapter 3. Outline Problem-solving agents Problem types Problem formulation Example problems Basic search algorithms.
Advertisements

Additional Topics ARTIFICIAL INTELLIGENCE
Solving problems by searching
Announcements Course TA: Danny Kumar
1 Search Problems (read Chapters 3 and 4 of Russell and Norvig) Many (perhaps most) AI problems can be considered search problems. This can be modeled.
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.
Artificial Intelligence Solving problems by searching
G5BAIM Artificial Intelligence Methods Graham Kendall Blind Searches.
May 12, 2013Problem Solving - Search Symbolic AI: Problem Solving E. Trentin, DIISM.
Solving Problem by Searching Chapter 3. Outline Problem-solving agents Problem formulation Example problems Basic search algorithms – blind search Heuristic.
Feng Zhiyong Tianjin University Fall  datatype PROBLEM ◦ components: INITIAL-STATE, OPERATORS, GOAL- TEST, PATH-COST-FUNCTION  Measuring problem-solving.
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.
Problem Solving and Search in AI Part I Search and Intelligence Search is one of the most powerful approaches to problem solving in AI Search is a universal.
CS 380: Artificial Intelligence Lecture #3 William Regli.
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2002.
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.
A* Search Introduction to AI. What is an A* Search? A greedy search method minimizes the cost to the goal by using an heuristic function, h(n). It works.
Introduction to Artificial Intelligence Heuristic Search Ruth Bergman Fall 2004.
Toy Problem: Missionaries and Cannibals
Search I Tuomas Sandholm Carnegie Mellon University Computer Science Department [Read Russell & Norvig Chapter 3]
Oregon State University – CS430 Intro to AI (c) 2003 Thomas G. Dietterich and Devika Subramanian1 Search-Based Agents  Appropriate in Static Environments.
Introduction to Artificial Intelligence A* Search Ruth Bergman Fall 2004.
Problem Solving and Search in AI Heuristic Search
Introduction to Artificial Intelligence Heuristic Search Ruth Bergman Fall 2002.
Solving problems by searching
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 This Lecture Read Chapters 3.1 to 3.4 Next Lecture Read Chapter 3.5 to 3.7 (Please read lecture topic material before and.
Solving Problems by Searching CPS Outline Problem-solving agents Example problems Basic search algorithms.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
1 Solving problems by searching This Lecture Chapters 3.1 to 3.4 Next Lecture Chapter 3.5 to 3.7 (Please read lecture topic material before and after each.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
1 CS 2710, ISSP 2610 Chapter 4, Part 1 Heuristic Search.
AI in game (II) 권태경 Fall, outline Problem-solving agent 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.
A General Introduction to Artificial Intelligence.
Problem solving by search Department of Computer Science & Engineering Indian Institute of Technology Kharagpur.
Informed Search I (Beginning of AIMA Chapter 4.1)
Problem Solving Agents
Artificial Intelligence Problem solving by searching.
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.
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.
Artificial Intelligence Lecture No. 6 Dr. Asad Ali Safi ​ Assistant Professor, Department of Computer Science, COMSATS Institute of Information Technology.
Introduction to Artificial Intelligence (G51IAI)
Introduction to State Space Search
G5AIAI Introduction to AI
Search Methodologies Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Lecture 2: Problem Solving using State Space Representation CS 271: Fall, 2008.
Uninformed Search ECE457 Applied Artificial Intelligence Spring 2008 Lecture #2.
Solving problems by searching Chapter 3. Types of agents Reflex agent Consider how the world IS Choose action based on current percept Do not consider.
Solving problems by searching
State Space Representations and Search Algorithms
Artificial Intelligence (CS 370D)
Heuristic Search Introduction to Artificial Intelligence
ECE 448 Lecture 4: Search Intro
Artificial Intelligence Lecture No. 6
Artificial Intelligence
Solving problems by searching
Artificial Intelligence
EA C461 – Artificial Intelligence Problem Solving Agents
Solving problems by searching
Solving problems by searching
ARTIFICIAL INTELLIGENCE
Solving problems by searching
David Kauchak CS51A – Spring 2019
Solving Problems by Searching
Solving problems by searching
Presentation transcript:

Introduction to Artificial Intelligence Problem Solving Ruth Bergman Fall 2002

Problem Solving Missionaries & Cannibals There are three missionaries and three cannibals on the left bank of a river. There is a boat on the left bank that can hold no more than two people. The missionaries wish to cross to the right bank. But they have a problem: If on either bank the cannibals ever outnumber the missionaries, the outnumbered missionaries will be eaten. Question: Is there a way for the missionaries to get their wish--to get to the right bank without losing anyone?

Problem-Solving Agents –one kind of goal-based agent –finding sequences of actions that lead to desirable states. Steps –Goal Formulation limiting the objectives –Problem Formulation deciding what actions and states to consider –Search looking for the possible action sequence –Execution

State Space Representation A node in the graph is a state An arc from A to B in the graph implies there is an operator that agent can perform that will transition from state A to state B. initial goal

Solving problems by searching in the state space Find the lowest cost path from the initial state to the goal state in the given state space using the available operators. Graph not accurate!

Problem Formulation Define the state space S initial state, S i S Define operators on states succ: S 2 S A goal set S f S A path cost, usually by assigning a cost to each action Missionaries & Canibals S = {S i } S k = M L = {0, 1, 2, 3} C L = {0, 1, 2, 3} B = {L, R} S i = S f = O = {o m,o c,o mc,o mm, o cc } O m : one missionary, o c : one cannibal o mc: : missionary and cannibal, etc.

Operator Definition

Lisp Solution for Missionaries & Cannibals (defun is-goal (s) (and (= (first s) 0) (= (second s) 0) (eq (third s) 'right))) ;; state (m c p par) (defun illegal-state (s) (let* ((m1 (first s)) (m2 (- 3 m1)) (c1 (second s)) (c2 (- 3 c1))) (or (and (> c1 m1) (> m1 0)) (and (> c2 m2) (> m2 0)) (< c1 0) (< m1 0) (< c2 0) … ))))

Lisp Solution cont. (defun next-states (s) (let* ((m (first s)) (c (second s)) (p (third s)) (possibilities (if (eq p 'left) (list (list m (- c 2) 'right s) (list (- m 1) (- c 1) 'right s) (list (- m 2) c 'right s) (list m (- c 1) 'right s) (list (- m 1) c 'right s)) (list … similar for right… )))) (remove-if #'illegal-state possibilities)))

Lisp Solution cont. (defun mc-search (start-state) (let ((queue (list start-state)) (*NODES* 0)) (loop while (not (null queue)) do (let ((s (pop queue))) (if (not (examinedp s)) (progn (incf *NODES*) (when (= *NODES* 1000) (return)) (push s *examined*) (if (is-goal s) (printout s)) (setf queue (append queue (next-states s))…)

Road map of Romania Oradea Zerind Arad Sibiu Fagaras Rimnicu Vilcea Pitesti Timisoara Lugoj Mehadia Dobreta Craiova Neamt Iasi Vaslui Urziceni Bucharest Giurgiu Hirsova Eforie

Road map of Romania Situation –On holiday in Romania: currently in Arad. –Flight leaves tomorrow from Bucharest. Formulate goal: –be in Bucharest Formulate problem: –initial state: be in Arad –state: various cities –operators: driving between cities Find solution: –sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest

The 8-puzzle problem formulation –State : the location of each of the eight tiles in one of the nine squares –Operators: blank moves left, right, up, or down –Goal test: state matches the right figure –Path cost: each step costs 1, that is the length of the path

The 8-queens problem problem formulation –State : any arrangement of 0 to 8 queens on board –Operators: add a queen to any square –Goal test: 8 queens on board, none attacked –Path cost: zero problem formulations are often not cut and dried –8 queens alternatives any arrangement of queens (64 8 states) legal arrangement of queens (2057 sequences) Any arrangement of 8 queens in separate column (8 8 states)

Cryptarithmetic problem formulation –State : a cryptarithmetic puzzle with some letters replaced by digits –Operators: replace all occurrences of a letter with a digit not already appearing in the puzzle –Goal test: puzzle contains only digits, and represents a correct sum –Path cost: zero MARS Each of the ten letters (m, a, r, s, v, e, + VENUS n, u, t, and p) represents a unique number + URANUS in the range SATURN NEPTUNE Solution: NEPTUNE = M=4, A=5, R=9, etc.

WEB Search Given the Technion home page, a predicate one WEB pages that returns TRUE only if the page is the home page for an Artificial Intelligence course. Find this course’s home page. problem formulation –State : WEB page –Operators: follow a link from the current page –Goal test: this course’s WEB page –Path cost: zero

State Space Search vs. Graph Search The state space + operators define a directed graph The solution to the problem is a path in the graph from the initial state to the goal state Can we use search algorithms from graph theory? The graph is implicit. The agent must use operators to explore the space. Graph theory algorithms assume an explicit representation. Graph theory algorithm often mark states, which may not be practical in large search spaces.

Searching for Solutions Partial search tree for route finding from Arad to Bucharest. Arad (a) The initial state (search node) (b) After expanding Arad (c) After expanding Sibiu Arad SibiuTimisoaraZerind Arad SibiuTimisoaraZerind SibiuTimisoaraOradea Rimnicu Vilcea goal test choosing one option Which node to expand? Which nodes to store in memory?

Measuring Problem- Solving Performance Effectiveness of a search –Does it find a solution at all? –Is it a good solution (one with low path cost)? –What is the search cost associated with the time and memory required to find a solution? –computation time –# nodes opened during search –# nodes discovered during search –# nodes in working memory (this is often the limiting factor in search) total cost = path cost + search cost