COMP9414: Artificial Intelligence Problem Solving and Search

Similar documents
COMP9414: Artificial Intelligence Adversarial Search

Lecture 2: Problem Formulation

Solving Problems by Searching

Problem Solving and Search

COMP5211 Lecture 3: Agents that Search

Unit 12: Artificial Intelligence CS 101, Fall 2018

Intelligent Agents & Search Problem Formulation. AIMA, Chapters 2,

Problem solving. Chapter 3, Sections 1 3

Conversion Masters in IT (MIT) AI as Representation and Search. (Representation and Search Strategies) Lecture 002. Sandro Spina

Foundations of AI. 3. Solving Problems by Searching. Problem-Solving Agents, Formulating Problems, Search Strategies

Problem. Operator or successor function - for any state x returns s(x), the set of states reachable from x with one action

Foundations of AI. 3. Solving Problems by Searching. Problem-Solving Agents, Formulating Problems, Search Strategies

Administrivia. CS 188: Artificial Intelligence Spring Agents and Environments. Today. Vacuum-Cleaner World. A Reflex Vacuum-Cleaner

Craiova. Dobreta. Eforie. 99 Fagaras. Giurgiu. Hirsova. Iasi. Lugoj. Mehadia. Neamt. Oradea. 97 Pitesti. Sibiu. Urziceni Vaslui.

Search then involves moving from state-to-state in the problem space to find a goal (or to terminate without finding a goal).

Informatics 2D: Tutorial 1 (Solutions)

ARTIFICIAL INTELLIGENCE (CS 370D)

Informed search algorithms

2 person perfect information

Artificial Intelligence Uninformed search

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 2 February, 2018

5.1 State-Space Search Problems

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

Outline for today s lecture Informed Search Optimal informed search: A* (AIMA 3.5.2) Creating good heuristic functions Hill Climbing

Introduction Solvability Rules Computer Solution Implementation. Connect Four. March 9, Connect Four 1

CS188: Section Handout 1, Uninformed Search SOLUTIONS

Heuristics & Pattern Databases for Search Dan Weld

Searching for Solu4ons. Searching for Solu4ons. Example: Traveling Romania. Example: Vacuum World 9/8/09

Section Marks Agents / 8. Search / 10. Games / 13. Logic / 15. Total / 46

Practice Session 2. HW 1 Review

Path Planning as Search

Constraint Satisfaction Problems: Formulation

Artificial Intelligence Search III

Programming Project 1: Pacman (Due )

Games (adversarial search problems)

mywbut.com Two agent games : alpha beta pruning

A Quoridor-playing Agent

Artificial Intelligence Lecture 3

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

Adversarial Search. Human-aware Robotics. 2018/01/25 Chapter 5 in R&N 3rd Ø Announcement: Slides for this lecture are here:

Heuristics, and what to do if you don t know what to do. Carl Hultquist

This game can be played in a 3x3 grid (shown in the figure 2.1).The game can be played by two players. There are two options for players:

5.4 Imperfect, Real-Time Decisions

Announcements. CS 188: Artificial Intelligence Fall Today. Tree-Structured CSPs. Nearly Tree-Structured CSPs. Tree Decompositions*

Chapter 4 Heuristics & Local Search

CS 771 Artificial Intelligence. Adversarial Search

A Historical Example One of the most famous problems in graph theory is the bridges of Konigsberg. The Real Koningsberg

CS-171, Intro to A.I. Mid-term Exam Winter Quarter, 2015

Ar#ficial)Intelligence!!

COMP9414/ 9814/ 3411: Artificial Intelligence. Week 2. Classifying AI Tasks

Heuristics & Pattern Databases for Search Dan Weld

Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

CPS331 Lecture: Search in Games last revised 2/16/10

5.4 Imperfect, Real-Time Decisions

Using Artificial intelligent to solve the game of 2048

Experimental Comparison of Uninformed and Heuristic AI Algorithms for N Puzzle Solution

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

Eight Queens Puzzle Solution Using MATLAB EE2013 Project

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

Tic-tac-toe. Lars-Henrik Eriksson. Functional Programming 1. Original presentation by Tjark Weber. Lars-Henrik Eriksson (UU) Tic-tac-toe 1 / 23

Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games?

Homework Assignment #1

Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

AIMA 3.5. Smarter Search. David Cline

How hard are computer games? Graham Cormode, DIMACS

Adversary Search. Ref: Chapter 5

Part I At the top level, you will work with partial solutions (referred to as states) and state sets (referred to as State-Sets), where a partial solu

CSE 573: Artificial Intelligence Autumn 2010

The game of Reversi was invented around 1880 by two. Englishmen, Lewis Waterman and John W. Mollett. It later became

Adversarial Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

Artificial Intelligence. Topic 5. Game playing

Tutorial 1. (ii) There are finite many possible positions. (iii) The players take turns to make moves.

Game-Playing & Adversarial Search

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

CSC384: Introduction to Artificial Intelligence. Game Tree Search

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

CS 188: Artificial Intelligence Spring 2007

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1

CS 4700: Artificial Intelligence

Google DeepMind s AlphaGo vs. world Go champion Lee Sedol

Artificial Intelligence 1: game playing

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

Informed search algorithms. Chapter 3 (Based on Slides by Stuart Russell, Richard Korf, Subbarao Kambhampati, and UW-AI faculty)

COMP219: Artificial Intelligence. Lecture 13: Game Playing

Midterm. CS440, Fall 2003

CPS331 Lecture: Intelligent Agents last revised July 25, 2018

Five-In-Row with Local Evaluation and Beam Search

CSE 40171: Artificial Intelligence. Adversarial Search: Game Trees, Alpha-Beta Pruning; Imperfect Decisions

Overview PROBLEM SOLVING AGENTS. Problem Solving Agents

CSC 110 Lab 4 Algorithms using Functions. Names:

CMPT 310 Assignment 1

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

Game Tree Search. Generalizing Search Problems. Two-person Zero-Sum Games. Generalizing Search Problems. CSC384: Intro to Artificial Intelligence

Monday, February 2, Is assigned today. Answers due by noon on Monday, February 9, 2015.

Artificial Intelligence. An Introductory Course

Scheduling. Radek Mařík. April 28, 2015 FEE CTU, K Radek Mařík Scheduling April 28, / 48

Adversarial Search 1

Artificial Intelligence Adversarial Search

Transcription:

CMP944, Monday March, 0 Problem Solving and Search CMP944: Artificial Intelligence Problem Solving and Search Motivating Example You are in Romania on holiday, in Arad, and need to get to Bucharest. What more information do you need to solve this problem? Wayne Wobcke Room J7-4 wobcke@cse.unsw.edu.au Based on slides by Maurice Pagnucco nce you have this information, how do you go about solving the problem? How do you know your solution is any good? What extra information would you need in order to evaluate the quality of your solution? CMP944 c UNSW, 0 CMP944, Monday March, 0 Problem Solving and Search CMP944, Monday March, 0 Problem Solving and Search Introduction to Problem Solving and Search Search as a weak method of problem solving with wide applicability Uninformed search methods (use no problem-specific information) Informed search methods (use heuristics to improve efficiency) (Not covered) Stochastic algorithms for problem solving Useful for understanding Prolog programs, logical inference, natural language parsing References: Ivan Bratko, Prolog Programming for Artificial Intelligence, Fourth Edition, Pearson Education, 0. (Chapter ) Stuart J. Russell and Peter Norvig, Artificial Intelligence: A Modern Approach, Third Edition, Pearson Education, 00. (Chapter ) State Space Search Problems State space set of all states reachable from initial state by any action sequence Initial state an element of the state space perators set of possible actions at agent s disposal; describe state reached after performing action in current state (alternatively) Successor function s(x)= set of states reachable from state x by performing a single action Goal state an element of the state space Path cost assigns cost to a path for comparing partial solutions (apply to optimization problems)

CMP944, Monday March, 0 Problem Solving and Search 4 Example Problem 8-Puzzle CMP944, Monday March, 0 Problem Solving and Search 6 Real World Problems 7 8 States: location of eight tiles plus location of blank perators: move blank left, right, up, down Goal state: state with tiles arranged in sequence Path cost: each step is of cost Route finding robot navigation, airline travel planning, computer/phone networks Travelling salesman problem planning movement of automatic circuit board drills VLSI layout design silicon chips Assembly sequencing scheduling assembly of complex objects, manufacturing process control Mixed/constrained problems courier delivery, product distribution, fault service and repair These are optimization problems but mathematical (operations research) techniques are not always effective. CMP944, Monday March, 0 Problem Solving and Search 5 Example Problem N-Queens CMP944, Monday March, 0 Problem Solving and Search 7 Problem Representation Tic-Tac-Toe States: 0 to N queens arranged on chess board perators: place queen on empty square Goal state: N queens on chess board, none attacked Path cost: zero States: arrangement of s and s on x grid perators: place () in empty square Goal state: three s (s) in a row Path cost: zero

CMP944, Monday March, 0 Problem Solving and Search 8 Tic-Tac-Toe First Attempt CMP944, Monday March, 0 Problem Solving and Search 0 Tic-Tac-Toe Third Attempt 8 4 5 9 7 8 9 6 7 Board: 0=blank; =; = Idea: Use move table with 9 = 968 elements Algorithm: Consider board to be a ternary number; convert to decimal; access move table; update board Fast; lots of memory; laborious; not extensible Board is a magic square! Algorithm: As in attempt but to check for win keep track of player s squares. If difference of 5 and sum of two squares is 0 or > 9 two squares are not collinear. therwise, if square equal to difference is blank, move there. What does this tell you about the way humans solve problems vs. computers? CMP944, Monday March, 0 Problem Solving and Search 9 Tic-Tac-Toe Second Attempt CMP944, Monday March, 0 Problem Solving and Search Tic-Tac-Toe Fourth Attempt? 7 8 9 Board: =blank; =; 5= Algorithm: Separate strategy for each move. Goal test (if row gives win on next move): calculate product of values : test product = 8 ( ); : test product = 50 (5 5 ) Not as fast as ; much less memory; easier to understand and comprehend; strategy determined in advance; not extensible Board: list of board positions arising from next move; estimate of likelihood of position leading to a win Algorithm: look at board arising from each possible move; choose best move Slower; can handle large variety of problems

CMP944, Monday March, 0 Problem Solving and Search Evaluating Search Algorithms Completeness: strategy guaranteed to find a solution when one exists? Time complexity: how long to find a solution? Space complexity: memory required during search? ptimality: when several solutions exist, does it find the best? Note: States are constructed during search, not computed in advance, so efficiently computing successor states is critical! CMP944, Monday March, 0 Problem Solving and Search 4 Explicit State Spaces View state space search in terms of finding a path through a graph Graph G=(V, E) V : vertices (nodes); E: edges Edges may have associated cost; path cost = sum edge costs in path Path from node s to g sequence of nodes s=n 0, n,...,n k = g such that n i is connected to n State space graph node represents state; arc represents change from one state to another due to action; costs may be associated with nodes and edges (hence paths) Forward (backward) branching factor # out-(in-)going arcs from (to) node CMP944, Monday March, 0 Problem Solving and Search Complications CMP944, Monday March, 0 Problem Solving and Search 5 Search Graph 8-Puzzle Single-state agent starts in known world state and knows which unique state it will be in after a given action 5 8 7 Multiple-state limited access to world state means agent is unsure exactly which world state it is in but may be able to narrow it down to a set of states Contingency problem if agent does not know full effects of actions (or there are other things going on) it may have to sense during execution (changing the search space dynamically) Exploration problem no knowledge of effects of actions (or state), so agent must experiment Left 5 8 7 Left Up 5 8 7 5 8 Up 5 8 7 Right 5 8 7... Search methods are capable of tackling single-state and multiple-state problems though multiple state at the cost of additional complexity. 6 7 4.........

CMP944, Monday March, 0 Problem Solving and Search 6 CMP944, Monday March, 0 Problem Solving and Search 8 A General Search Procedure Back to Motivating Example function GeneralSearch(problem, strategy) returns a solution or failure initialise search graph using the initial state of problem loop if there are no candidates for expansion then return failure choose a frontier node for expansion according to strategy if the node contains a goal state then return solution else expand the node and add the resulting nodes to the search graph end Note: nly test whether at goal state when expanding node, not when adding nodes to the search graph (except for breadth-first search!) Notice assumptions built in to problem formulation (level of abstraction) Note that while people can look at the map to see a solution, the computer must construct the map by exploration Where can I go from Arad? Sibiu, Timisoara, Zerind Where can I go from Sibiu? The order of questioning defines the search strategy Problem formulation assumptions critically affect the quality of the solution to the original problem CMP944, Monday March, 0 Problem Solving and Search 7 CMP944, Monday March, 0 Problem Solving and Search 9 A General Search Procedure Conclusion Start node Explored nodes Many real world problems can be viewed as search problems Problem representation is crucial in determining effectiveness of search as a problem-solving method Search algorithms can be classified into two groups: uninformed (blind) search and informed (heuristic) search Frontier Unexplored nodes Search strategy way in which frontier expands