I nice algorithm for finding optimal cube solution: http://kociemba.org/cube.htm. In Download section you can find an implementation, along with source in C.
Well, it is Carnegie Mellon. CMU is a pretty great college. But, then again, it's not too hard of a program to code. Just takes a little bit of thinking and OpenCV experience.