Professional Documents
Culture Documents
EXPERIMENT NO: 09
AIM:
To implement 15-puzzle problem using Branch and Bound technique.
THEORY:
The 15-puzzle is a sliding puzzle that consists of a 4x4 grid with 15 numbered
tiles and one empty space.The objective is to arrange the tiles in ascending order
from left to right, top to bottom, with the empty space in the bottom-right
corner.
ALGORITHM:
OBSERVATION:
- State Representation: Each arrangement of the tiles on the board represents
astate. We can represent a state as a configuration of the 15 tiles.
- Goal State: The goal state is when the tiles are arranged in ascending order
withthe blank space in the bottom-right corner.
- Branching Factor: At each state, there are typically four possible moves (up,
down, left, right), but not all moves are valid depending on the position of
theblank space.
- Heuristic Function: A heuristic function can be defined to estimate the cost
fromthe current state to the goal state. For example, the Manhattan distance
can be used as a heuristic to estimate the number of moves required to reach
the goal state.
CONCLUSION:
The Branch and Bound technique can be applied to the 15-puzzle problem to
e ciently explore the state space and find the optimal solution. By using heuristics
to guide the search and pruning branches of the search tree, it can significantly
reduce the time and space complexity compared to a brute-force search.
However, the effectiveness of the technique depends on the quality of the
heuristicfunction used and the branching factor of the problem.
ffi