The sliding-tile puzzle consists of 3 black tiles, 3 white tiles, and 1 empty spaces in the configuration shown below:
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.
- a) Write a program in Prolog to solve the 8-puzzle problem:
assume that the initial state is:
and the goal stat is:
- b) Define the State, Operators, Goal, Heuristic and show the path to the goal in the tree of search after applying the Heuristic.
本网站支持淘宝 支付宝 微信支付 paypal等等交易。如果不放心可以用淘宝交易！
E-mail: [email protected] 微信:dmxyzl003