This application solves the n-queen problem with an implementation of a Hopfield-Tank neural network. The user simply selects the size of the board and asks the application to find a solution; the application steps through an iterative process, showing the results at each stage. The chess pieces fade in and out of the board as the computer tries different possibilities, and it often (but not always) reaches a valid solution.
Installation Instructions: Nothing unusual - simply run the enclosed executable.
Operation Instructions:
Setup: The application displays a list of numbers representing the internal state of the neural network, and a chessboard that is initially empty, but will fill up with circles representing queens as a solution. The Size control at the bottom controls the width and height of the chessboard, as well as the number of queens to place on it - thus, increasing the size of the board makes the problem parabolically more difficult.
Solution: The problem is solved by creating an instance of a Hopfield-Tank neural network customized for this problem, and then repeatedly asking it to take steps toward a solution. The two "Solve" buttons ("Solve (Step)" and "Solve (Full)") command the network either to move one step toward the solution and display the results, or to run the analysis continuously until it reaches a solution or deadlocks.
When you begin solving the problem, you'll see the queen circles start appearing and disappearing as the network moves toward a solution. These are color-coded as follows: green queens are appearing, red queens are disappearing, blue squares are fixed, and grey squares are deadlocked pieces (where the network can't decide whether or not a queen should be there.) Depending on the complexity of the problem, the network may yield a full solution, or it may yield only a partial solution. However, it's a fact that several solutions exist for every problem (every board size), so retrying the network (perhaps repeatedly) by clicking "Clear" and then clicking "Solve (Full)" again will eventually produce a full solution. Finally, if you'd like to see a particular solution replayed, click the "Reset" button and then solve it again.
Comments: The application is structured as a front-end module (N-Queen Problem.cs) and a back-end module (Hopfield-Tank Network.cs). It may therefore be useful as a demonstration of object-oriented programming, to a limited extent.
Application History: This application was written during an artificial intelligence class taught by Dr. Toshinori Munakata at Cleveland State University in Fall, 2004. This was not written for or submitted as a class assignment, but rather was written as a study guide for understanding a class topic.
Questions/Comments: Please contact David J. Stein, Esq. via email at djs10@po.cwru.edu.
Terms and Conditions of Use: Please see the enclosed "License.html" file for terms and conditions of use of this software package.