What's new
Carbonite

South Africa's Top Online Tech Classifieds!
Register a free account today to become a member! (No Under 18's)
Home of C.U.D.

Klotski Solver

Zaggermeister

Well Known Member
Rating - 100%
13   0   0
Joined
Sep 3, 2015
Messages
497
Reaction score
53
Points
2,035
Age
26
Location
Potchefstroom
Hey guys, hope all is well.

Got an assignment which I have no idea how to solve, so I thought I'd poke around the fireplace of some experienced people. So about the assignment, we need to automate the solving of a Klotski puzzle. Ironically its the same layout as the one on the right hand side of the wiki page (first picture). So I've gotten as far as figuring out that I should use trees to approach this (lecturer also confirmed this :p), so we need to pick the shortest possible solution (or rather the computer) to solve that specific puzzle. Thing is, I have no idea how to actually begin programming at this.

If anyone can offer any help at all, it'd be much appreciated.
 
Yeah I'd just create a tree with nodes for each movable piece and then branches for each of their possible moves. I see they mention the shortest solution is 81 moves if you count moving two spaces in one direction as a single move so you could look for that specific solution and make it your shortest tree and then expand from there.
 

Users who are viewing this thread

Back
Top Bottom