How It Works
A* (A-Star) is an informed search algorithm that finds the shortest path from a start state to a goal state:
- It uses a heuristic function to estimate the cost from the current state to the goal
- For each state, it calculates f(n) = g(n) + h(n), where g(n) is the cost so far and h(n) is the heuristic estimate
- States are explored in order of their f-value (lowest first)
- The algorithm is guaranteed to find the optimal solution when using an admissible heuristic
Interactive Features
- Move tiles manually by clicking adjacent to the empty space
- Generate random puzzles to test different scenarios
- Toggle between Manhattan distance and Misplaced tiles heuristics
- Watch the algorithm find the optimal solution step by step
- Use setup mode to create custom puzzles by swapping tiles