This program guarantees the minimal solution of solving a 4x4 grid of numbers 1 through 16 into the correct order.
Example jumbled grid
4 6 2 14
15 8 13 1
10 5 9 12
7 11 16 3
Solved
1 2 3 4
5 6 7 8
9 10 11 12
13 14 15 16
This Java program uses A* Search with Manhattan distance as it's heuristic.