This project implements an AI agent that can play the Box Worlds game using the Best First Algorithm.
This project implements an AI agent that can play the Box Worlds game using the Best First Algorithm.
Blocks World is one of the most famous planning games in AI. The game typically consists of a 1-dimensional surface, e.g. table, and n 2-dimensional blocks that can be moved vertically and horizontally. The game has an initial configuration of blocks, i.e. where blocks are stacked, and a final configuration.
The aim is to move the blocks in such a way that the final configuration is recreated with the minimum number of block movements. A block can only be moved if it does not have another block on top of it. With a small n value, e.g. 3 blocks, the problem is easy to solve. However, with a large n value, the problem becomes NP-hard.
@1536615786725/A-Blocks-World-Problem.png" alt="Image showing Blocks World setup">
This project solves the Blocks World problem using the Best First Algorithm and n = 3. With larger n values, another algorithm, e.g. Heuristic state-space algorithm, should be used.
javac -d ./../bin -sourcepath . Main.java
. Then the application can be run from the bin directory with the following command: java Main
>> java Main
>> CAB
>> AB C
And here is the expected output:
[C, A, B]
[C, A]
[B]
[C]
[B]
[A]
[C]
[A, B]
3