This is the eight puzzle problem solved by BFS