hw2-1 - CSCI-561 Fall 2010 Homework 2 Student name...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI-561 Fall 2010 Macskassy Homework 2 Due Sep. 29, 2010 Student name: _____________________________ Student ID: _________________ Question 1. A* Search (Coding assignment relevant to the Project 1) [20 points] In a 5*5 grid, Start cell = Agent (A). Goal cell = Target (T). The black grids are obstacles, the agent can only move in the white grids, and can only move horizontally or vertically one grid per time, and the cost of each movement is 1. But the agent could only sense the four grids that adjacent to its location, i.e., left, right, upper, lower. The following pictures show a sample of such 5*5 grids and the shortest path from A to T. Your task is to implement A* search with your own designed heuristic function that receives the situation of the grids and outputs the shortest path of A to reach T. The input will be given in a file named “input.txt”, please make sure your program can take the parameter when executing. Please describe your heuristic function in this question in the submitted homework and prove your function is admissible. Sample Input : (where 1 refers to the white box, -1 refers the black box, A refers to the location of agent, T refers to the location of the goal) 1 1 1 1 1 1 1 1 1 1 1 1 -1 1 1 1 1 -1 1 1 1 1 A -1 T Sample Output: (0,2), (0,1), (1,1), (1,2),(1,3), (2,3),(3,3),(4,3),(4,2),(4,1),(4,0) The output indicates the shortest path from A to T. The coordinates of left bottom is (0,0). Note
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/01/2010 for the course CSCI 561 at USC.

Page1 / 3

hw2-1 - CSCI-561 Fall 2010 Homework 2 Student name...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online