Lecture 2: Problem Formulation

Similar documents
COMP9414: Artificial Intelligence Problem Solving and Search

Problem solving. Chapter 3, Sections 1 3

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

Solving Problems by Searching

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

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

Artificial Intelligence Uninformed search

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

Problem Solving and Search

COMP5211 Lecture 3: Agents that Search

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

Overview PROBLEM SOLVING AGENTS. Problem Solving Agents

Informed Search. Read AIMA Some materials will not be covered in lecture, but will be on the midterm.

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

Chapter 4 Heuristics & Local Search

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

Informed search algorithms

CS188: Section Handout 1, Uninformed Search SOLUTIONS

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

2 person perfect information

CSE548, AMS542: Analysis of Algorithms, Fall 2016 Date: Sep 25. Homework #1. ( Due: Oct 10 ) Figure 1: The laser game.

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

Spring 06 Assignment 2: Constraint Satisfaction Problems

Once you get a solution draw it below, showing which three pennies you moved and where you moved them to. My Solution:

Homework Assignment #1

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

Part III F F J M. Name

Artificial Intelligence Search III

Eight Queens Puzzle Solution Using MATLAB EE2013 Project

UKPA Presents. March 12 13, 2011 INSTRUCTION BOOKLET.

Solution Algorithm to the Sam Loyd (n 2 1) Puzzle

Adversary Search. Ref: Chapter 5

Informatics 2D: Tutorial 1 (Solutions)

Square Roots and the Pythagorean Theorem

Problem of the Month. Miles of Tiles. 5 in. Problem of the Month Miles of Tiles Page 1

Backtracking. Chapter Introduction

Unit 12: Artificial Intelligence CS 101, Fall 2018

22c:145 Artificial Intelligence

Perimeters of Composite Figures

CS188 Spring 2010 Section 3: Game Trees

Spring 06 Assignment 2: Constraint Satisfaction Problems

Intriguing Problems for Students in a Proofs Class

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

Chess Puzzle Mate in N-Moves Solver with Branch and Bound Algorithm

GET OVERLAPPED! Author: Huang Yi. Forum thread:

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

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

mywbut.com Two agent games : alpha beta pruning

The patterns considered here are black and white and represented by a rectangular grid of cells. Here is a typical pattern: [Redundant]

Year 7A Mathematics Homework Autumn Term

LESSON 2: THE INCLUSION-EXCLUSION PRINCIPLE

G53CLP Constraint Logic Programming

Chapter 5 Backtracking. The Backtracking Technique The n-queens Problem The Sum-of-Subsets Problem Graph Coloring The 0-1 Knapsack Problem

IN THIS ISSUE. Cave vs. Pentagroups

: Principles of Automated Reasoning and Decision Making Midterm

Problem 2A Consider 101 natural numbers not exceeding 200. Prove that at least one of them is divisible by another one.

CPS331 Lecture: Heuristic Search last revised 6/18/09


CMPUT 396 Tic-Tac-Toe Game

COCI 2008/2009 Contest #3, 13 th December 2008 TASK PET KEMIJA CROSS MATRICA BST NAJKRACI

Introduction to Genetic Algorithms

Constraint Satisfaction Problems: Formulation

Project Connect Four (Version 1.1)

Problem 1. (15 points) Consider the so-called Cryptarithmetic problem shown below.

CS 188 Fall Introduction to Artificial Intelligence Midterm 1

Grade 3 Area and Perimeter Unit Overview

More on games (Ch )

Page 1 part 1 PART 2

Quintessence A Packet of Puzzles by John Bulten

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

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

Games of Skill ANSWERS Lesson 1 of 9, work in pairs

Chapter 4: Patterns and Relationships

A natural number is called a perfect cube if it is the cube of some. some natural number.

CSE 573 Problem Set 1. Answers on 10/17/08

CS 4700: Artificial Intelligence

CS61B Lecture #22. Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55: CS61B: Lecture #22 1

Final Practice Problems: Dynamic Programming and Max Flow Problems (I) Dynamic Programming Practice Problems

More on games (Ch )

Mathematics Enhancement Programme TEACHING SUPPORT: Year 3

2009 ACM ICPC Southeast USA Regional Programming Contest. 7 November, 2009 PROBLEMS

In the game of Chess a queen can move any number of spaces in any linear direction: horizontally, vertically, or along a diagonal.

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

Conway s Soldiers. Jasper Taylor

Determining the Cost Function In Tic-Tac-Toe puzzle game by Using Branch and Bound Algorithm

CMPT 310 Assignment 1

PART 2 VARIA 1 TEAM FRANCE WSC minutes 750 points

Unit. The double attack. Types of double attack. With which pieces? Notes and observations

SUDOKU1 Challenge 2013 TWINS MADNESS

CS188 Spring 2010 Section 3: Game Trees

UMBC 671 Midterm Exam 19 October 2009

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

ECS 20 (Spring 2013) Phillip Rogaway Lecture 1

If a word starts with a vowel, add yay on to the end of the word, e.g. engineering becomes engineeringyay

Games (adversarial search problems)

Title: Oct 9 8:27 AM (1 of 30)

CS188 Spring 2014 Section 3: Games

Introduction to Spring 2009 Artificial Intelligence Final Exam

UNIVERSITY OF NORTHERN COLORADO MATHEMATICS CONTEST

Transcription:

1. Problem Solving What is a problem? Lecture 2: Problem Formulation A goal and a means for achieving the goal The goal specifies the state of affairs we want to bring about The means specifies the operations we can perform in an attempt to bring about the goal The difficulty is deciding what order to carry out the operations Solution will be a sequence of operations leading from initial state to goal state (plan) 2. Problem Formulation Problem Formulation: The sequence of required actions to move from current state to a goal state Once the goal is determined, formulate the problem to be solved First determine set of possible states S of the problem Then the problem has a: set of states S initial state - the starting point, s0 - a member of S set of operations - the actions that can be performed, {o1,..., on} goal - what you are aiming at - subset of S Operations cause changes in state. Performing an operation in a given state reaches some specified next state. Operations are functions s1 s2 A solution is a sequence of actions such that when applied to initial state s0, we reach the goal state Example 1: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: be in Bucharest Formulate problem: states: various cities actions: drive between cities Find solution: Sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest 1

Single-state problem formulation A problem is defined by four items: 1. initial state e.g., "at Arad" 2. actions or successor function S(x) = set of action state pairs e.g., S(Arad) = {<Arad Zerind, Zerind>, <Arad Timisoara, Timisoara>, } 3. goal test, can be explicit, e.g., x = "at Bucharest" implicit, e.g., Checkmate(x) 4. path cost (additive) e.g., sum of distances, number of actions executed, etc. c(x,a,y) is the step cost, assumed to be 0 Example 2: Toy Problems: The 8 Puzzle States: 3 3 grid filled with numbers 1 8 and a blank Initial state: as shown on the left Goal state: as shown on the right Operations: o1: move any tile to left of empty square to right States? Locations of tiles Actions? Move blank left, right, up, down Goal test? Given Path cost? 1 per move Example 3: Toy Problems: The n Queens Problem This is a problem from chess Place 8 queens on chess board so that no queen can be taken by another (A queen attacks any piece in the same row, column or diagonal) Initial state: empty chess boar Goal state: n queens on chess board so that none can take any other Operations: place queen in empty square Place queens anywhere For the 8-queens problem 648 possibilities Place queens only where they are not attacked already Around 2,000 possible sequences to check 2

Example 4: robotic assembly States? real-valued coordinates of robot joint angles parts of the object to be assembled Actions? continuous motions of robot joints Goal test? complete assembly Path cost? time to execute More Examples of Real World Problems Game playing Route finding - routing in computer networks, rail travel, air travel Touring and travelling - find a route between Aberdeen and Glasgow; travelling salesperson problem Assembly sequencing VLSI layout Robot navigation.... 3. Search Space An imaginary tree showing all possible states reachable from the initial state 724 5_6 831 A tree showing nodes explored by a search algorithm Root is the initial state: successor nodes found by applying operators (expanding nodes) Stops when goal is reached 3.1 Search Strategy Performance Completeness: does it always find a solution if one exists? Time complexity: number of nodes generated/expanded Space complexity: maximum number of nodes in memory Optimality: does it always find a least-cost solution? Time and space complexity: are measured in terms of b: maximum branching factor of the search tree d: depth of the least-cost solution m: maximum depth of the state space (may be infinite) 3.2 Selecting a state space Real world is absurdly complex state space must be abstracted for problem solving (Abstract) state = set of real states (Abstract) action = complex combination of real actions 3

e.g., "Arad Zerind" represents a complex set of possible routes, detours, rest stops, etc. For guaranteed realizability, any real state "in Arad must get to some real state "in Zerind" (Abstract) solution = set of real paths that are solutions in the real world Each abstract action should be "easier" than the original problem 3.3 Solution Cost For most problems, some solutions are better than others: 8 puzzle: number of moves to get to solution chess: number of moves to checkmate route planning: length of distance (or time) to travel Mechanism for determining cost of solution is the path cost function This is the length (cost) of the path through the state-space from the initial state to the goal state 4. Numerical Problem solving: example of optimization EXAMPLE 1: A farmer has 2400 ft of fencing and wants to fence off a rectangular field that borders a straight river. He needs no fence along the river. What are the dimensions of the field that has the largest area? Solution: Note that the area of the field depends on its dimensions: To solve the problem, we first draw a picture that illustrates the general case: The next step is to create a corresponding mathematical model: Maximize: A = xy Constraint: 2x + y = 2400 We now solve the second equation for y and substitute the result into the first equation to express A as a function of one variable: 2x + y = 2400 y = 2400 2x A = xy = x(2400 2x) = 2400x 2x 2 To find the absolute maximum value of A = 2400x 2x 2, The derivative of A(x) is A (x) = (2400x 2x 2 ) = 2400x 2(x 2 ) = 2400 1 2 2x = 2400 4x So to find the critical numbers we solve the equation, 2400 4x = 0 2400 = 4x x = 2400 4= 600 To find the maximum value of A(x) we evaluate it at the end points and critical number: A(0) = 0, A(600) = 2400 600 2 600 2 = 720, 000, A(1200) = 0 4

Homework: EXAMPLE 2: We need to enclose a field with a rectangular fence. We have 500 ft of fencing material and a building is on one side of the field and so won t need any fencing. Determine the dimensions of the field that will enclose the largest area. Solution: We first draw a picture that illustrates the general case: EXAMPLE 3: We want to construct a box whose base length is 3 times the base width. The material used to build the top and bottom cost $10/ft2 and the material used to build the sides cost $6/ft2. If the box must have a volume of 50 ft3 determine the dimensions that will minimize the cost to build the box. EXAMPLE 4: We want to construct a box with a square base and we only have 10 m2 of material to use in construction of the box. Assuming that all the material is used in the construction process determine the maximum volume that the box can have. 5