Professional Documents
Culture Documents
Y.Abhigna Reddy et al, Int. J. Comp. Tech. Appl., Vol 2 (6), 1737-1741
ABSTRACT
Graphical simulation is an attempt of predicting The n-queens problem, originally introduced in 1850 by
the aspects of behavior of some system by developing an Carl Gauss, can be stated as follows: find the placement of n
approximate model of it. Simulations have great impact on queens on an n×n chessboard, such that no one queen can be
education and in training. Simulation based learning is a taken by any other. N solutions were proposed but later
practical way of learning of practices that involves building numerous solutions were published relying on specific
connections: connections among what is being learned and formula for placing queens.
what is important to the actor and the situations in which it The eight queens puzzle is an example of the more
is applied. general n-queens problem of placing n queens on an n×n
N-Queens problem refers to the problem in which one chessboard, where solutions exist only for n = 1 or n ≥ 4.The
has to place N-Queens on an n*n chess board such that no eight queens puzzle is the problem of placing eight chess
queen is attacking the other, i.e. no two queens occupy the queens on 8x8 chessboard so that none of them can capture
same row, column or diagonal. Here we use graphical any other using the standard chess queen's moves. The
simulation to view various solutions to N-Queens problem. queens must be placed in such a way that no two queens
The n-queens problem is implemented by using core java. attack each other. Thus, a solution requires that no two
The packages used in these implementations are java.awt, queens share the same row, column, or diagonal.
java.lang, java.applet. 1.3 Motivation
The graphical simulation is used because n-queens This paper is to simulate the N-Queens problem
problem is more complicated. It is easy for any system user that is used in the context of placing n- queens on an n*n
or normal user to understand this problem by observing chess board. It is good to animate the n-queens problem
simulations. With the help of simulation the problem is because this topic will illustrate how we can get the more
explained very clearly and effectively. This will help in graphically simulated placement of queens on a chess board
generating interest among perceivers because it has real such that no two queens lie along the same row, column or
time applications and will make learning better. diagonal.
Key words: graphical simulation, n-queens problem, The graphical simulation is used to demonstrate
more practical problems whose solutions are permutations,
1. INTRODUCTION of which there are many. One such problem is the travelling
1.1 Graphical Simulation salesperson problem: Find the shortest route on a map that
Simulation-based learning is budding demand for visits each city exactly once and returns to the starting city.
learning dynamic aspects. Learning about dynamic Here the permutation is the list of cities that are visited,
phenomena is except for the first.
essential in many domains. That approach allows the learner It can be done by making the animation in step by
to imitate real processes using models and to acquire step which can be easily understood by any system user or
knowledge and experience during the process of learning. normal user. With the help of visualization the problem is
The proposed graphical modelling method is based on explained very clearly.
systematic point of view, experiential learning and expert- 1.4 Objectives
based modeling requirements. The contextual graph of Backtracking is a prime algorithmic technique that
action specification is used as a basis to set the requirements uses depth first search to explore the solution space which is
for service software specification and attributes of learning most naturally formulated in terms of recursive programs.
objects (LO). Suppose that we are given an n × n chessboard,
1.2 Description of the Problem where n is a positive integer. A queen can attack in
5.REFERENCES
[1].Bitner, J.R. and E.M. Reingold (1975), "Backtracking
programming techniques," Communications of the ACM,
Vol. 18, No. 11, pp. 651-56.
[2].Gauss and the Eight Queens Problem: A Study in
Miniature of the Propagation of Historical Error, Campbell,
Nov. 1977, Historia Mathematica, Vol. 4 No. 4.
[3].Purdom, P.W. and C.A. Brown (1983), "An analysis of
backtracking with search rearrangement," SIAM Journal of
Computing, Vol. 12, No. 4, pp. 717-33.
[4].Bernhardsson, B. (1991), "Explicit solutions to the n-
queens problems for all n," ACM SIGART Bulletin, Vol. 2,
No. 7.
[5]. Ellis Horowitz, Sartaj Sahni, Sanguthevar Rajasekaran
“Fundamentals of Computer Algorithms,2nd edition”,
Universities Press, 2008.
[6]. An Introduction To Programming And OO Design Using
Java , J.Nino And F.A.Hosch, John Wiley & Sons
[7]. Herbert Schildt “The Complete Reference Java, J2SE 5 th
edition”, Tata McGraw Hill Edition,2007.
[8]. Barry J.Holmes, Daniel T.Joyce “Object Oriented
Programming with Java,2nd edition”, Jones and Bartlett
Publishers,2001.
[9].Y.Daniel Liang “Introduction to Java Programming, 7th
edition”,Prentice Hall,2008.
[10]. Big Java ,2nd edition, Cay Horstman, Wiley Student
Edition , Wiely India Private Limited.
[11].www.math.utah.edu/~alfeld/queens/queens.html
[12].www.roard.com/docs/cookbook/cbsu6.html
[13]. www.durangobill.com/N_Queens.html