Problem-Solving: A* and Beyond. CSCI 3202, Fall 2010

Similar documents
CENG 466 Artificial Intelligence. Lecture 4 Solving Problems by Searching (II)

Problem Solving Agents

Search I. Tuomas Sandholm Carnegie Mellon University Computer Science Department. [Read Russell & Norvig Chapter 3]

CS472 Foundations of Artificial Intelligence. Final Exam December 19, :30pm

SEARCH TREE. Generating the children of a node

SEARCH SEARCH TREE. Node: State in state tree. Root node: Top of state tree

Transposition Table, History Heuristic, and other Search Enhancements

Representation. Representation. Representation. Representation. 8 puzzle.

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

Problem Solving as Search - I

The Game of Yinsh (Phase II)

Solving Problems by Searching chap3 1. Problem-Solving Agents

Uninformed Search (Ch )

/435 Artificial Intelligence Fall 2015

Uninformed Search (Ch )

Aryeh Rappaport Avinoam Meir. Schedule automation

CSE 3401: Intro to AI & LP Uninformed Search II

Introduction to Waves

Uninformed search strategies

CSC384: Introduction to Artificial Intelligence. Search

Estimating the Probability of Winning an NFL Game Using Random Forests

21-110: Problem Solving in Recreational Mathematics

CMPUT680 - Winter 2001

Better Search Improved Uninformed Search CIS 32

COMP219: Artificial Intelligence. Lecture 8: Combining Search Strategies and Speeding Up

Newton s Triple Play Explore

CSE 3402: Intro to Artificial Intelligence Uninformed Search II

Lesson 46: Properties of Waves

Percymon: A Pokemon Showdown Artifical Intelligence

TASK 4.2.1: "HAMILTON'S ROBOT" ==============================

TIMETABLING IN SPORTS AND ENTERTAINMENT

Chapters 25: Waves. f = 1 T. v =!f. Text: Chapter 25 Think and Explain: 1-10 Think and Solve: 1-4

Uninformed search methods

CS 4649/7649 Robot Intelligence: Planning

6.034 Artificial Intelligence

G53CLP Constraint Logic Programming

A new Decomposition Algorithm for Multistage Stochastic Programs with Endogenous Uncertainties

Planning. CS 510: Intro to AI October 19 th 2017

Depth-bounded Discrepancy Search

NTHL RULES. Red writing means these are modified rules for this season.

Decision Trees. Nicholas Ruozzi University of Texas at Dallas. Based on the slides of Vibhav Gogate and David Sontag

Overview. Depth Limited Search. Depth Limited Search. COMP219: Artificial Intelligence. Lecture 8: Combining Search Strategies and Speeding Up

Uninformed search methods

Algorithms and Data Structures

2D Collisions Lab. Read through the procedures and familiarize yourself with the equipment. Do not turn on the

CHAPTER 8: MECHANICAL WAVES TRANSMIT ENERGY IN A VARIETY OF WAYS

INSTRUMENT INSTRUMENTAL ERROR (of full scale) INSTRUMENTAL RESOLUTION. Tutorial simulation. Tutorial simulation

WELCOME! TOWN CENTRE PARK INFORMATION SESSION WHAT IS HAPPENING? GOALS FOR TODAY. TOWN STAY CONNECTED WITH US! #1 INFORM WE ARE HERE

ENHANCED PARKWAY STUDY: PHASE 2 CONTINUOUS FLOW INTERSECTIONS. Final Report

Using CBR to Select Solution Strategies in Constraint Programming

Planning and Acting in Partially Observable Stochastic Domains

Internet Technology Fundamentals. To use a passing score at the percentiles listed below:

Cheetah Math Superstars

Pokémon Organized Play Tournament Operation Procedures

11 TH ANNUAL MATHLETES IN ACTION

Spider Search: An Efficient and Non-Frontier-Based Real-Time Search Algorithm

Table of Contents. Career Overview... 4

Teambuilding Activities

Amazing Race Program June 6, 2011, 2-3:30 p.m.

Real World Search Problems. CS 331: Artificial Intelligence Uninformed Search. Simpler Search Problems. Example: Oregon. Search Problem Formulation

AGA Swiss McMahon Pairing Protocol Standards

Chapter 4 (sort of): How Universal Are Turing Machines? CS105: Great Insights in Computer Science

SIDDHARTH INSTITUTE OF ENGINEERING & TECHNOLOGY :: PUTTUR (AUTONOMOUS) Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

Summer Math. Math Activities (complete 2 or more):

2018 TALES RULES FORMULATED BY THE GREATER DETROIT SOARING AND HIKING SOCIETY

Introduction. AI and Searching. Simple Example. Simple Example. Now a Bit Harder. From Hammersmith to King s Cross

Bulgarian Olympiad in Informatics: Excellence over a Long Period of Time

Official Skirmish Tournament Rules

How networks are shaping Tshwane Tools for urban network analysis Part II

yarn (1-2 meters) tape sticky notes slinky short piece of yarn or ribbon calculator stopwatch

Tournament Operation Procedures

OKLAHOMA MATH DAY. Instructions for the SOONER MATH BOWL

Solution Manual Computer Math Problem Solving for Information Technology 2nd Edition Charles Marchant Reeder

Year 1 and 2 Learning Intentions Summer Term Medium/ Long Term Planning Week Y1 Intentions: Y1 Outcomes: Y2 Intention: Y2 Outcomes:

Monday Tuesday Wednesday Thursday Friday

Students will use two different methods to determine the densities of a variety of materials and objects.

Tri-Star Sports Skills Contests

Waves. harmonic wave wave equation one dimensional wave equation principle of wave fronts plane waves law of reflection

D u. n k MATH ACTIVITIES FOR STUDENTS

Building an NFL performance metric

Analysis of Professional Cycling Results as a Predictor for Future Success

Improving WCET Analysis for Synthesized Code from Matlab/Simulink/Stateflow. Lili Tan Compiler Design Lab Saarland University

Similarly to elastic waves, sound and other propagated waves are graphically shown by the graph:

Topic A: Understand Concepts About the Ruler... 4 Lesson Happy Counting Two More Lesson

DESIGN AND ANALYSIS OF ALGORITHMS (DAA 2017)

CHANGES IN FORCE AND MOTION

Lab 5: Ocean Waves and Tides

Dive Planet. Manual. Rev Basic User Interface. 2 How to organize your dives. 3 Statistics. 4 Location Service and Map View.

2014 Ballperson Manual

Introducing the erdp

ECE 160. Product Design Specification (PDS) Fall

Fun Soccer Drills that Teach Soccer Skills to 5, 6, and 7 year olds

The Regional Power Grid Team

Lecture 19 Fluids: density, pressure, Pascal s principle and Buoyancy.

COMP9414: Artificial Intelligence Uninformed Search

Student Handout: Summative Activity. Professional Sports

LAND SHARK. Items needed: Gummi Shark candy

Exam Question 9: Hydrostatics. March 6, Applied Mathematics: Lecture 8. Brendan Williamson. Introduction. Density, Weight and Volume

GOZO COLLEGE. Half Yearly Examinations for Secondary Schools FORM 4 PHYSICS TIME: 1h 30min

Descriptive Statistics

Transcription:

Problem-Solving: A* and Beyond CSCI 3202, Fall 2010

Administrivia Reading for this week: 4.1.1-4.1.3 (up to p. 126) in R+N; 5.1-5.4 (pp. 161-176) Problem Set 1 will be posted by tomorrow morning; due September 23 in class. HARD COPY ONLY, please.

The Basic Idea Behind A* Search 1) Devise an "estimation" function, h, that gives you a plausible underestimate of the distance from a given state to the goal. 2) Call the cost of getting from the initial state to the current state g. 3) To measure the quality of a given state s, sum the cost (g) of arriving at this state and the estimate (h) of the cost required to get from s to the goal. 4) Use best-first search, where g+h is the overall quality function.

How do you estimate distance to the goal? (Or: What s that h function?) Try to find a metric that will be a close (informative) one,but that won t overestimate (it should be optimistic). Example: 8-9 puzzle Number of misplaced tiles Sum of Manhattan distance of misplaced tiles (better) Best solution length for (say) tiles 1-4 Example: Choosing a path on a map from city A to B Euclidean distance to B.

AStar-Best-First-Search [Nodes] IF there are no more nodes THEN FAIL ThisNode <-- First(Nodes) IF ThisNode is the goal THEN return ThisNode ELSE ChildNodes <-- Children(ThisNode) Astar-Best-First-Search (Sort-by-Lowest-Cost-plus-Estimate ChildNodes Remove-Node(ThisNode Nodes))

A few handy heuristics Redefine the edges (moves) of the problem graph, as by chunking (e.g., Rubik s cube) Eliminate chunks of the problem graph, as by constraints (e.g., SEND+MORE = MONEY problem) Decompose the problem into subproblems (Rubik s cube again; or Rush Hour)

Means-Ends Analysis A technique for finding the next step to take in a search process. Here, we find the most important difference between our current state and the goal state and use that difference (recursively) to dictate our next move.

To SOLVE a problem: If the current state is the goal state, then we re done. If not, first REDUCE the difference between the current state and goal state to produce a new current state. Then SOLVE the problem from the (presumably better) current state and the original goal. To REDUCE the difference between the current state and the goal state, find the most important difference between the current state and the goal state. Find an operator that tends to reduce that difference, and APPLY that operator to the current state. To APPLY an operator to the current state, see if there are any differences between the current state and any preconditions for the operator. If there are, REDUCE the difference between the current state and the preconditions for the operator. If not return the result of APPLYing the operator directly to the current state.

Local search Up until now, we ve imagined a two-phase method: find a solution path (search the problem space graph), and then return that path so that it can be executed. In local search, we simply search the graph directly, hoping to land on a goal state. Two simple methods: hill-climbing and beam search.

Hill-Climb [Current-Node] IF Current-Node is the goal THEN return Current-Node ELSE ChildNodes Children (Current-Node) BestChild LooksBest (ChildNodes) Hill-Climb [BestChild] Beam-Search [Set-of-Nodes] If Set-of-Nodes contains a goal state THEN return that state ELSE AllChildNodes Find-All-Children (Set-of-Nodes) BestNChildren N-Best-Looking (AllChildNodes) Beam-Search (BestNChildren)

An Example of Hill-Climbing: the Word Arithmetic Problem Let each node of the problem space graph be a candidate solution: SD*ENM*OYR 0123456789 Each edge from this node leads to a node in which two assignments have been switched: SY*ENM*ODR 0123456789

Hill-Climbing Example, Continued Now we hill-climb by starting at some candidate solution and moving to the adjacent solution that causes the fewest arithmetic errors.

Problem-Solving: The Cognitive Side Do we actually use (say) depth-first search? Or breadth-first search? Or A*? Is the problem-space formalism useful,or natural? How do we solve problems, anyhow?

"A man gets an unsigned letter telling him to go to the local graveyard at midnight. He does not generally pay attention to such things, but complies out of curiosity. It is a deathly still night, lighted by a thin crescent moon. The man stations himself in front of his family's ancestral crypt. The man is about to leave when he hears scraping footsteps. He yells out, but no one answers. The next morning, the caretaker finds the man dead in front of the crypt, a hideous grin on his face. Did the man vote for Teddy Roosevelt in the 1904 U.S. presidential election?" -- Poundstone

Hanging from the ceiling are two lengths of string, each six feet long. The strings are ten feet apart. As the room is ten feet high, the lower ends of the strings hang four feet above the floor. On the floor is a Swiss Army knife, a firecracker, a small glass of water, a twenty-five pound block of ice in an aluminum pan, and a friendly Labrador retriever. Your job is to tie the two ends of the two strings together. -- based on Poundstone, "Labyrinths of Reason"

All astronomers are stamp collectors. No baseball players are astronomers.???

Other ways of looking at the "search" issue; "insight" problems Retrieving schemas/searching for patterns Restructuring the problem space itself Functional fixedness and the "Einstellung" effect

Two Physics Problems Rolling a quarter around another quarter... Elastic collision (ping-pong vs. bowling ball)

Mr. Smith and his wife invited four other couples for a party. When everyone arrived, some of the people in the room shook hands with some of the others. Of course, nobody shook hands with their spouse and nobody shook hands with the same person twice. After that, Mr. Smith asked everyone how many times they shook someone s hand. He received different answers from everybody. How many times did Mrs. Smith shake someone s hand? From Michalewicz and Fogel, How to Solve It: Modern Heuristics

Game-Playing: the Essential Arsenal The idea of a minimax search Avoiding useless search: the alpha-beta algorithm Other ways of pruning the search tree Other central issues in game-playing

The Game of Sim

In Scheme: (define (minimax gamestate myfunction otherfunction level) (cond ((= level 0) (getvalue gamestate)) (else (let* ((successors (getnextmoves gamestate)) (othervals (map (lambda (successor) (minimax successor otherfunction myfunction (- level 1))) successors))) (apply myfunction othervals)))))

(define (alpha-beta alpha beta level node max?) (cond ((= level 0) (static-value node)) (max? (let ((children (find-next-moves node #t))) (max-look-at-each-child-node children alpha beta level))) (else (let ((children (find-next-moves node #f))) (min-look-at-each-child-node children alpha beta level))))) (define (max-look-at-each-child-node children alpha beta level) (cond ((null? children) alpha) ((>= alpha beta) alpha) (else (let ((next-value (alpha-beta alpha beta (- level 1) (first children) #f))) (max-look-at-each-child-node (rest children) (max next-value alpha) beta level))))) (define (min-look-at-each-child-node children alpha beta level) (cond ((null? children) beta) ((>= alpha beta) beta) (else (let ((next-value (alpha-beta alpha beta (- level 1) (first children) #t))) (min-look-at-each-child-node (rest children) alpha (min next-value beta) level)))))

Calling alpha-beta with starting values of a (very low) alpha value, a (very high) beta value, a depth of 5, the starting game state, and from the point of view of the maximizer. (alpha-beta -1000 1000 5 initial-game-state #t)