Skip to main content
Log in

Counting Star-Battle Configurations

  • Published:
Mathematics in Computer Science Aims and scope Submit manuscript

Abstract

Given an \(n\mathrm {\times }n\) grid of cells, a valid configuration for the Star-Battle problem is a subset of \(\textrm{2}n\) cells—those containing ‘stars’—such that each row and each column contains exactly two stars, and no two stars are orthogonally or diagonally adjacent. The standard Star-Battle game assumes a plane topology in which stars bordering opposite edges of the board are nonadjacent. We present an algorithm for counting the number of distinct valid configurations as a function of n, for plane, cylindrical, and toroidal board topologies. We have run our algorithm up to \(n=15\), for which the number of valid configurations is equal to 106,280,659,533,411,296 for the plane topology, and somewhat less for the cylindrical and toroidal topologies.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6

Similar content being viewed by others

Notes

  1. \(G_{d}\) partitions the set of all paths where \(2\le d\le \left\lfloor \frac{n}{2} \right\rfloor \). Given any path starting at row (ij), if \(2\le j\mathrm {-}i\le \left\lfloor \frac{n}{2} \right\rfloor \), the path belongs to \(G_{j-i}\). Alternatively, if \(j\mathrm {-}i>\left\lfloor \frac{n}{2} \right\rfloor \), then \(2\le n-\left( j-i \right) \le n-\left( \left\lfloor \frac{n}{2} \right\rfloor +1 \right) \le \left\lfloor \frac{n}{2} \right\rfloor \), and the path belongs to \(G_{n-(j-i)}\).

References

  1. https://krazydad.com/twonottouch/

  2. Bell, J., Stevens, B.: A survey of known results and research areas for n-queens. Discret. Math. 309(1), 1–31 (2009). https://doi.org/10.1016/j.disc.2007.12.043

    Article  MathSciNet  MATH  Google Scholar 

  3. Berend, D.: On the number of Sudoku squares. Discret. Math. 341(11), 3241–3248 (2018). https://doi.org/10.1016/j.disc.2018.08.005

    Article  MathSciNet  MATH  Google Scholar 

  4. Schaeffer, J., Burch, N., Bjornsson, Y., Kishimoto, A., Muller, M., Lake, R., Lu, P., Sutphen, S.: Checkers is solved. Science 317(5844), 1518–1522 (2007)

    Article  MathSciNet  MATH  Google Scholar 

  5. Steinerberger, S.: On the number of positions in chess without promotion. Int. J. Game Theory 44(3), 761–767 (2015). https://doi.org/10.1007/s00182-014-0453-7

    Article  MathSciNet  MATH  Google Scholar 

  6. Tromp, J.: The number of legal go positions. In: Plaat, A., Kosters, W., van den Herik, J. (eds.) Computers and Games. CG 2016. Lecture Notes in Computer Science, vol 10068. Springer (2016)

  7. Spahn, G.: Enumerating solutions to grid-based puzzles with a fixed number of rows. Math. Comput. Sci. (2022). https://doi.org/10.1007/s11786-022-00530-x

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Michael Laszlo.

Ethics declarations

Conflict of interest

None

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Laszlo, M., Mukherjee, S. Counting Star-Battle Configurations. Math.Comput.Sci. 17, 8 (2023). https://doi.org/10.1007/s11786-023-00558-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11786-023-00558-7

Keywords

Mathematics Subject Classification

Navigation