Consider writing a program for solving a problem like the Rubik's
cube. One option is to write the program in a programming language such as C. One would then write some routines for modeling the dynamics of the problem and other routines for capturing the control; namely, which action to try next, when and where to backtrack, etc. This is actually the most common option for solving combinatorial problems and it's the approach taken for example in (Kor98). The advantage of this approach is that it can be very efficient at run time; the disadvantage, is that it may be quite inefficient at modeling time. That is, building a good specialized program takes time, and usually involves a tedious process of debugging and tuning.