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

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

CS188: Section Handout 1, Uninformed Search SOLUTIONS

ENGR170 Assignment Problem Solving with Recursion Dr Michael M. Marefat

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

Spring 06 Assignment 2: Constraint Satisfaction Problems

: Principles of Automated Reasoning and Decision Making Midterm

2 person perfect information

Chapter 4 Heuristics & Local Search

Homework Assignment #1

STAJSIC, DAVORIN, M.A. Combinatorial Game Theory (2010) Directed by Dr. Clifford Smyth. pp.40

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

Lecture 20: Combinatorial Search (1997) Steven Skiena. skiena

CMPUT 396 Tic-Tac-Toe Game

N-Queens Problem. Latin Squares Duncan Prince, Tamara Gomez February

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

UMBC 671 Midterm Exam 19 October 2009

10/5/2015. Constraint Satisfaction Problems. Example: Cryptarithmetic. Example: Map-coloring. Example: Map-coloring. Constraint Satisfaction Problems

Reflections on the N + k Queens Problem

MAS336 Computational Problem Solving. Problem 3: Eight Queens

UMBC CMSC 671 Midterm Exam 22 October 2012

Game Playing Beyond Minimax. Game Playing Summary So Far. Game Playing Improving Efficiency. Game Playing Minimax using DFS.

CS 188 Fall Introduction to Artificial Intelligence Midterm 1

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

5.4 Imperfect, Real-Time Decisions

Senior Math Circles February 10, 2010 Game Theory II

Solving Problems by Searching

Adversary Search. Ref: Chapter 5

5.4 Imperfect, Real-Time Decisions

DVA325 Formal Languages, Automata and Models of Computation (FABER)

Lesson 16: The Computation of the Slope of a Non Vertical Line

RAINBOW COLORINGS OF SOME GEOMETRICALLY DEFINED UNIFORM HYPERGRAPHS IN THE PLANE

Artificial Intelligence Lecture 3

COMP5211 Lecture 3: Agents that Search

Complete and Incomplete Algorithms for the Queen Graph Coloring Problem

Notes for Recitation 3

CSC 396 : Introduction to Artificial Intelligence

and 6.855J. Network Simplex Animations

Heuristics & Pattern Databases for Search Dan Weld

Tiling Problems. This document supersedes the earlier notes posted about the tiling problem. 1 An Undecidable Problem about Tilings of the Plane

Introduction to Spring 2009 Artificial Intelligence Final Exam

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

Games and Adversarial Search II

Some results on Su Doku

Which Rectangular Chessboards Have a Bishop s Tour?

Spring 06 Assignment 2: Constraint Satisfaction Problems

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

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

Informatics 2D: Tutorial 1 (Solutions)

AIMA 3.5. Smarter Search. David Cline

Graphs of Tilings. Patrick Callahan, University of California Office of the President, Oakland, CA

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

Modeling, Analysis and Optimization of Networks. Alberto Ceselli

UNIT 13A AI: Games & Search Strategies. Announcements

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

Tile Number and Space-Efficient Knot Mosaics

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

CS 188: Artificial Intelligence Spring 2007

ADVERSARIAL SEARCH. Chapter 5

Problem Set 7: Network Flows Fall 2018

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

Solutions to Part I of Game Theory

Wednesday, February 1, 2017

Edge-disjoint tree representation of three tree degree sequences

I.M.O. Winter Training Camp 2008: Invariants and Monovariants

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

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

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors.

Second Annual University of Oregon Programming Contest, 1998

6.034 Quiz 1 25 September 2013

mywbut.com Two agent games : alpha beta pruning

Heuristic Search with Pre-Computed Databases

CS 771 Artificial Intelligence. Adversarial Search

arxiv: v1 [math.co] 24 Oct 2018

Algorithms and Data Structures: Network Flows. 24th & 28th Oct, 2014

arxiv: v2 [math.gt] 21 Mar 2018

Artificial Intelligence Ph.D. Qualifier Study Guide [Rev. 6/18/2014]

Your Name and ID. (a) ( 3 points) Breadth First Search is complete even if zero step-costs are allowed.

CMPT 310 Assignment 1


Odd king tours on even chessboards

SCRABBLE ARTIFICIAL INTELLIGENCE GAME. CS 297 Report. Presented to. Dr. Chris Pollett. Department of Computer Science. San Jose State University

CS 171, Intro to A.I. Midterm Exam Fall Quarter, 2016

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

SOLITAIRE CLOBBER AS AN OPTIMIZATION PROBLEM ON WORDS

Algorithmique appliquée Projet UNO

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

Solving Triangular Peg Solitaire

Game Theory and Economics of Contracts Lecture 4 Basics in Game Theory (2)

Ar#ficial)Intelligence!!

Cardinality revisited

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

Techniques for Generating Sudoku Instances

CS510 \ Lecture Ariel Stolerman

Twenty-fourth Annual UNC Math Contest Final Round Solutions Jan 2016 [(3!)!] 4

This article appeared in a journal published by Elsevier. The attached copy is furnished to the author for internal non-commercial research and

Conway s Soldiers. Jasper Taylor

EXPLAINING THE SHAPE OF RSK

Downloaded from

Compressing Pattern Databases

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

Transcription:

CSE 573 Problem Set. Answers on 0/7/08 Please work on this problem set individually. (Subsequent problem sets may allow group discussion. If any problem doesn t contain enough information for you to answer i feel free to make any assumptions necessary to find the answer, but state the assumptions clearly. You will be graded on your choice of assumptions as well as the clarity of you written answers.. Let T be an acyclic, connected, undirected graph (i.e, a tree whose edges are uniformly of unit length. The diameter of T is the maximum distance between any two nodes in T. a How might you use breadth-first search (BFS to find the diameter of T? Do you need to run BFS from different initial, starting nodes? Perform BFS from each state, and pick the greatest depth. b What is the time complexity of your algorithm (in n, the number of nodes in T and d, the diameter and any other variables you deem relevan. O(n c Can you devise an algorithm which is linear in n (or prove that such an algorithm is impossible? We denote the shortest path length between two states s and s as l(s,s. Algorithm: Pick any node and perform a BFS from s. Then pick the last state ( visited, and do a BFS from t. t is the last state visited. Then l(t is the diameter. It s linear since it takes only two BFS. Proof that the algorithm finds the diameter: Suppose otherwise, so there is another path u to v that has a longer shortest path (or l(>l(t. Case : either u or v coincides with s. Suppose u= then l( t' Case : shortest path of ( contains s. So both u and v cannot be ancestors of t in the BFS rooted at s. Suppose u is not. Then: l( s s u t' Case 3: shortest path of ( does not contain s. Then pick the deepest common predecessor p of u and v in the BFS rooted at s. Follow the same steps of case, we have: l( p p, s s u t'

. The figure below shows a problem-space graph, where A is the initial state and G denotes the goal. Edges are labeled with their true cost. We have a heuristic function, f(, written in the standard form: f(n=g(n+h(n where g(n is the cost to get from A to n and h(n is an estimate of the remaining distance to G. a In the graph below, is f( admissible? Why or why not? Yes. Verify that for every state h(s<c(s b Is f( monotonic? Why or why not? Yes. Verify that for every state each of its successor s, h ( s g( s' s' B C h= A G h=0 D h= E c Suppose we use IDA* to search the graph and that states having the same f values are visited in alphabetical order. In what order does the algorithm consider f-limits and visit states? Fill out the table below: f-limit States visited (in order A 3 A D B 4 A D B C E G 3. Prove that if a heuristic is monotonic, then it must be admissible (or provide a counter example. True. This can be proved by induction on the distance to the goal. A heuristic is monotonic if for every state h ( s g( s' s' Base case: h(g=0 (g is any goal state Inductive step: Suppose the h values of all states that are less than k steps away from g are admissible. Consider state s the first state that is no less than k steps away from g. Since s is the

first of such state, all its successors must all be less than k steps away from g, so they are all admissible. h( s = minc( a, s' s' minc( a, s' + f ( s' = f ( s a a 4. Prove that if a heuristic is admissible, then it must be monotonic (or provide a counter example. False. In the following example, h ( A > c( A, B B, but the heuristic is admissible h=4 h=0 A B 3 G 5. Recall that with the n-queens problem, we seek to put n queens on an n x n chess board. a Let n=4 can consider the state space of possible board positions. Suppose that the initial state has no queens on it and a goal state has 4 peaceful queens (i.e. none are attacking each other. Operators add one queen to the board. The rules say that one can never put more than four queens on the board. What is the total size of the complete state space (i.e., including states where some queens are attacking each other? First consider the number of queens k that are already on the board. k can be 0,,,3,4. The board has 6 cells. Each state corresponds to a way of putting k queens on the 6 6 6 6 6 board. So the total number of states is + + + +. 0 3 4 b By observing the fact that one can never put two queens on the same column (without violating peacefulness one can come up with a simpler representation of state (e.g. encoding one which takes less memory if encoded as a data structure. Describe such a representation. How many 4-queens states are possible in this representation (again, some states may not be peaceful? One data structure could be to use a size 4 integer array to store the row number of the queen that occupies the corresponding column. For example, A(=, A(=3, A(3=4, A(4= correspond to the following situation. State size = 4 4.

c Can you shrink the state space even more by eliminating symmetry? Explain? Various ways. You can use the symmetry by row, column, diagonal, rotation etc. Suppose that we want to use symmetry by column. Consider one simple case where there is only one queen on the board. The symmetry means that the state where the queen is at cell (i,j is symmetric to state that the queen is at cell (i,n-j. By using this symmetry and extend to states where there can be multiple queen we can merge any two states whose column numbers of all the queens that are on the same row add up to n into one state. Doing thi we can halve the state space. 6. Do problem 4.4 from R&N. And be sure that your answer for part (a describes the offline problem they are presenting formally as a search problem. (What is a belief state in this case? a This online search problem can be viewed as an offline search in belief state space. Where a belief state is a set of all possible wall configurations given our known information so far. There are possible locations for internal walls (6 vertical and 6 horizontal, so there are = 4096 configurations of the world. Because the agent knows which actions are legal, she always knows where she i hence the environment is the only uncertainty. But since she can be in one of 9 different square that expands the space as well. A belief state denotes a subset of the possible world configurations. So there are 4096 belief states. (though some of these are unreachable, so the agent could never distinguish between the following mazes because she can t get to -, -3, -, or -3 the only places where one could sense the missing wall. After each action and percep the agent learns about new wall locations. Since these walls are independen and the walls don t change their position after we sense them, there is some regularity over the state space which reduces its size quite a bit. We can represent the (huge space in a compact form the state of each wall (ye no, don t-yet-know for a space of 3 configurations. Factoring in location there are 9*3 belief states. b In the initial state, we know both LEFT and DOWN are illegal. However, UP could be legal or not and RIGHT could be legal or not for a cross product of 4. c The first few branches of a contingency plan are shown in the graph below. We assume that when an agent enters a room, it perceives all the adjacent walls. As we have

discussed, the agent initially doesn t know which of 4 possible worlds it will start in, but upon being deposited in the maze it receives percepts and knows the state of the upper and right-hand walls. Thus our diagram starts with four possible states. (As an encoding trick, this is sometimes encoded by having the agent execute a dummy NoOp action which places it in the maze and gives it the percept but I haven t drawn such a thing. The size of a plan is bounded by both the branching factor of the plan and the depth of the plan. Since the agent knows if an action is legal, there is only one outcome, but then there are up to 3 binary percepts so there are 8 possible states she could be in if she just moved to cell (, with fewer possible wall-states if she moves along a wall and even less when moving into a corner. The longest plan where the goal state can be reached is 3, as shown in the following graph (suppose that the agent foolishly moves right until it gets caught in a deadend and has to backtrack. But to explore the entire maze, we need at most 8 steps. So the size of the plan is bounded by 8 3 (or 8 8 if there can be no solutions.