We discuss a difficult optimization problem on a chess-board, requiring equal numbers of black and white queens to be placed on the board so that the white queens cannot attack the black queens. We show how the symmetry of the problem can be straightforwardly eliminated using SBDS, allowing a set of non-isomorphic optimal solutions to be found. We present three different ways of modelling the problem in constraint programming, starting from a basic model. An improvement on this model reduces the number of constraints in the problem by introducing ancillary variables representing the lines on the board. The third model is based on the insight that only the white queens need be placed, so long as there are sufficient unattacked squares to accommodate the black queens. We also discuss variable ordering heuristics: we present a heuristic which finds optimal solutions very quickly but is poor at proving optimality, and the opposite heuristic for which the reverse is true. We suggest that in designing heuristics for optimization problems, the different requirements of the two tasks (finding an optimal solution and proving optimality) should be taken into account.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Bosch, R.A.: Peaceably Coexisting Armies of Queens. Optima (Newsletter of the Mathematical Programming Society) 62, 6–9 (1999)Google Scholar
  2. 2.
    Cheng, B.M.W., Choi, K.M.F., Lee, J.H.M., Wu, J.C.K.: Increasing constraint propagation by redundant modeling: an experience report. Constraints 4, 167–192 (1999)MATHCrossRefGoogle Scholar
  3. 3.
    Gardner, M.: Chess Queens and Maximum Unattacked Cells. Math Horizon, pp. 12–16 (November 1999)Google Scholar
  4. 4.
    Gent, I.P., Smith, B.M.: Symmetry Breaking During Search in Constraint Programming. In: Horn, W. (ed.) Proceedings ECAI 2000, pp. 599–603 (2000)Google Scholar
  5. 5.
    Smith, B.M.: Dual Models of Permutation Problems. In: Walsh, T. (ed.) CP 2001. LNCS, vol. 2239, pp. 615–619. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  6. 6.
    Velucchi, M.: For me, this is the best chess-puzzle: Non-dominating queens problem, http://anduin.eldar.org/~problemi/papers.html (Accessed January 2004)

Copyright information

© Springer-Verlag Berlin Heidelberg 2004

Authors and Affiliations

  • Barbara M. Smith
    • 1
  • Karen E. Petrie
    • 1
  • Ian P. Gent
    • 2
  1. 1.School of Computing & EngineeringUniversity of HuddersfieldHuddersfield, West YorkshireUK
  2. 2.School of Computer ScienceUniversity of St. AndrewsSt AndrewsUK

Personalised recommendations