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.
Similar content being viewed by others
Notes
\(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 (i, j), 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
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
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
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)
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
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)
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
Author information
Authors and Affiliations
Corresponding author
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.
About this article
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
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11786-023-00558-7