Assignment 1: Solving Bloxorz Using Search: Due Sunday, 1 November, 11pm
Assignment 1: Solving Bloxorz Using Search: Due Sunday, 1 November, 11pm
Assignment 1:
Solving Bloxorz using Search
Due Sunday, 1 November, 11pm
Bloxorz is a game where the goal is to drop a 1 × 2 × 1 block through a hole in the
middle of a board without falling off its edges. This game is available at
http://www.coolmath-games.com/0-bloxorz/index.html.
• an A* search algorithm
Input of the problem The input game board of size m×n is represented by a matrix
of size m × n where
• X denotes empty tiles: the block may never touch an empty tile, even if half of
the block is on a safe tile;
• S denotes the tile(s) occupied by the block: if the block is in the vertical orien-
tation then there is one tile labeled S, otherwise (if the block is in the horizontal
orientation) there are two adjacent tiles labeled S;
• G denotes the goal tile: the block needs to be on it (vertically) in order to fall
into the goal.
For instance, the matrix below represents the game board depicted in Figure 1.
O O O X X X X X X X
O O O O O O X X X X
O O O S O O O O O X
X O O S O O O O O O
X X X X X O O G O O
X X X X X X O O O X
1
CS 404, Fall 2020 Artificial Intelligence
Output of the problem A shortest sequence of legal states that navigate the block
from its given initial location into the goal.
1. (10 points) Model the puzzle as a search problem: specify the states, successor
state function, initial state, goal test, and step cost.
2. (30 points, provided that the first part is completed) Implement in Python a UCS
algorithm to solve the puzzle.
3. (10 points, provided that the first part is completed) Extend your search model
for A* search: Find a heuristic function and prove that it is admissible.
4. (30 points, provided that the third part is completed) Implement in Python an
A* search algorithm to solve the puzzle.
5. (20 points) Compare your UCS and A* codes on some sample puzzle instances.
Construct a table that shows, for each instance, time and memory consump-
tion. Discuss the results of these experiments: Are the results surprising or as
expected? Please explain.
Submit
• A pdf copy of a description of your solutions (search model and heuristic func-
tion), and experimental evaluation (table and discussion).
• Your Python code for each algorithm, with comments describing your solution.
• Several test boards you created for the fifth part of the assignment.
In each one of the deliverables above, please include your name and student id.
Demos You are expected to make a demo of your solution so that we can grade parts
2, 4, and 5. The demos are planned for November 2, Monday 17:40–18:30, and/or,
November 3, Tuesday 16:40–18:30. The demos will be scheduled later on.