Replace the previous heuristic with the manhattan distance

Assignment Help Python Programming
Reference no: EM132263058

Assignment -

Question - A* - Sliding Tile Puzzle

The sliding tile puzzle is a simple toy that consists of a number of tiles, and an empty space that can be used to move tiles around. The sliding tile puzzle defines a graph, where each state of the puzzle is a vertex, and there are edges between states if they can be reached by a single move:

2108_figure.png

We can define the planning problem as a search problem by giving:

  • An initial state.
  • A goal state
  • A set of operators that define how to create states from other states.

A deterministic plan is a sequence of actions to achieve a goal from a given starting state. A deterministic planner is a problem solver that can produce a plan. The Input is an initial state and description, a specification of the actions available to the system, and a goal description. The specification of the actions includes their preconditions and their effects.

A*

In this assignment , you will implement a program that uses A* search to solve the Eight Puzzle game. Your program will take an initial board position, and then try to find a sequence of moves from the initial position to the goal position. Moves are represented by moving the black space left, right, up, or down.

Manhattan distance: this heuristic is used for its simplicity and also because it underestimate (i.e., lower bound) on the number of moves required to bring a given board to the solution board. We simply compute the sum of distances of each tile from where it belongs, completely ignoring all other tiles.

Important: to implement your search algorithm, you will need to:

  • Implement an open list, that allows you to add a state /priority pair and remove the pair with the smallest priority.
  • Implement a closed list, that allows you to add a state, and check if a state is in the closed list.
  • Implement a search state, that allows you to compare two states, find the estimated cost from one state to another, and generate all children of a given search state.

Exercise:

  • Implement the A* algorithm using the number of misplaced tiles as a heuristic function.
  • Replace the previous heuristic with the manhattan distance.

Question - Blackbox planner

Hansel and Gretel are lost in a rectangular forest. Even worse, they are separated from each other. Fortunately, there is the friendly neighborhood witch who is willing to help them reunite. As an appropriate place for the meeting she proposes her gingerbread house in the middle of the forest.

Hansel and Gretel can both move in four directions, namely north, east, south and west. Call the actions northH , southH, eastH, westH, northG, southG, eastG, and westG, respectively, with the obvious semantics of moving either Hansel or Gretel by one grid cell in the indicated direction. Some cells with extremely thick vegetation are inaccessible (shown in grey in the figure below) and cannot be moved to. The goal is to move both Hansel and Gretel to the goal position in the center of the grid, marked by X. Their current positions are indicated by H and G, respectively.

1001_figure1.png

Exercise:

Solve the problem (and help Hansel and Gretel) using PDDL and the blackbox solver.

  • You need to create two separate files (domain file and problem file).

The deliverable of this project will consists of a python code and PDDL files.

Attachment:- Assignment File.rar

Reference no: EM132263058

Questions Cloud

Evaluate the relative value of each organization services : Identify four organizations in a community that deliver primary health care. These must be 4 different organizations and not one agency offering 4 different.
What is the firm probable perfect-order performance : What is the firm’s probable perfect-order performance?
What are the main policy tools the federal reserve : 1. What are the main policy tools the Federal Reserve of the United States can use to control the money supply. Briefly describe each tool.
What is an organic organization : What is an organic organization? A mechanistic organization? How does the environment influence organic and mechanistic structures?
Replace the previous heuristic with the manhattan distance : Implement the A* algorithm using the number of misplaced tiles as a heuristic function. Replace the previous heuristic with the manhattan distance
Which one would you recommend to sally : Find out the approximate historical average, lowest, and highest volatility from the Telstar's volatility graph.
High-technology manufacturing activity : Why do you think China is now a favored location for so much high-technology manufacturing activity?
Argument that free trade is beneficial : What are the implications of this observation for the argument that free trade is beneficial?
What impact does have on firm perfect-order performance : Suppose the firm’s performance on two of the 95-percent factors falls to 90 percent. What impact does this have on the firm’s perfect-order performance?

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd