PuzzleSolver

Those of you that know me, also know that I keep this program called PuzzleSolver up to date on the latest technology. This forces me to learn the new technology and gives me a benchmark application to test the raw performance of the latest platform. You may recall that the last version of PuzzleSolver contained a Java client, a WinForm/CAB client, an ASMX endpoint, a WCF (Indigo at the time) endpoint, a WSE 3.0 endpoint, a Remoting endpoint, and a J2EE endpoint.

I was able to prove I could use the same service and expose it through any type of endpoint on the Microsoft stack without changing any code. Moreover, I proved I could invoke a Java endpoint with the same code that invoked my Microsoft endpoint. I also had a Java client that demonstrated the reverse scenario.
After that I started my WPF version of PuzzleSolver back in the first half of 2005 when it was still called Avalon.

It was very rough, but it worked. I’ve finally completed the pure WPF version. It doesn’t consume services and doesn’t use Acropolis. While previous versions were developed and executed on a dual processor workstation and the solving engine ran on a separate thread from the UI it was still a single threaded engine. With the emergence of dual cores and quad cores, I decided to make this version completely multi-threaded.

By taking advantage of generics and few algorithmic modifications I got the solution time down to ~2.25 seconds on dual core 2.1 Ghz HP laptop. By refactoring to take advantage of the ThreadPool the solution time has come down to ~1.8 seconds on the same machine. That is a pretty significant increase in performance. I can’t wait until I get back home to run it on my overclocked quad core and see what the numbers look like. I still have the dual processor workstation, so I’d like to see how much time comes off the 23 seconds solution time the CAB version posted.

You may notice that I’ve added tabs. They are still a work in progress and are currently disabled. The Pegs tab will solve the game at Crackerbarrel where there pegs are on a triangle board and one peg is missing and you objective is to remove pegs by jumping over them and have the last peg end up in the hole that was originally empty. I’m considering doing this one in 3D. The ThoughtWorks tab is for my personal enjoyment. I submitted a resume to ThoughtWorks back in 2003 and they sent me a logic puzzle and I was supposed to write a program to solve it. I turned the program around in two days and they never called me back. I guess they thought I cheated or something.