Prolog代写 | Two Questions

Question 1

 

The sliding-tile puzzle consists of 3 black tiles, 3 white tiles, and 1 empty spaces in the configuration shown below:

 

BB B WWW

A tile may move into an adjacent empty location. This has a cost of 1.

A tile can hop over one or two other tiles into the empty position. This has a cost equal to the number of tiles jumped over.

The goal is to have all the white tiles to the left of all the black tiles. The position of the blank should be in the middle.

Propose a heuristic for solving this problem. Show part of the search space to the goal and the cost to the goal.

Solve the problem using PROLOG.

 

 

 

 

 

Question 2

 

  1. a) Write a program in Prolog to solve the 8-puzzle problem:

 

283
164
7 5

 

 

assume that the initial state is:

 

 

 

 

 

and the goal stat is:

123
8 4
765

 

 

 

 

 

 

 

  1. b) Define the State, Operators, Goal, Heuristic and show the path to the goal in the tree of search after applying the Heuristic.

 

 

 


程序代写代做C/C++/JAVA/安卓/PYTHON/留学生/PHP/APP开发/MATLAB


本网站支持淘宝 支付宝 微信支付  paypal等等交易。如果不放心可以用淘宝交易!

E-mail: [email protected]  微信:dmxyzl003


如果您使用手机请先保存二维码,微信识别。如果用电脑,直接掏出手机果断扫描。

发表评论