Hostname: page-component-76d6cb85b7-92wsb Total loading time: 0 Render date: 2026-07-13T11:31:20.003Z Has data issue: false hasContentIssue false

Battleship, tomography and quantum annealing

Published online by Cambridge University Press:  16 January 2023

W. Riley Casper*
Affiliation:
Department of Mathematics, California State University, Fullerton, CA 92831, USA
Taylor Grimes
Affiliation:
Department of Mathematics, California State University, Fullerton, CA 92831, USA
*
*Correspondence author. Email: wcasper@fullerton.edu
Rights & Permissions [Opens in a new window]

Abstract

The classic game of Battleship involves two players taking turns attempting to guess the positions of a fleet of vertically or horizontally positioned enemy ships hidden on a $10\times 10$ grid. One variant of this game, also referred to as Battleship Solitaire, Bimaru or Yubotu, considers the game with the inclusion of X-ray data, represented by knowledge of how many spots are occupied in each row and column in the enemy board. This paper considers the Battleship puzzle problem: the problem of reconstructing an enemy fleet from its X-ray data. We generate non-unique solutions to Battleship puzzles via certain reflection transformations akin to Ryser interchanges. Furthermore, we demonstrate that solutions of Battleship puzzles may be reliably obtained by searching for solutions of the associated classical binary discrete tomography problem which minimise the discrete Laplacian. We reformulate this optimisation problem as a quadratic unconstrained binary optimisation problem and approximate solutions via a simulated annealer, emphasising the future practical applicability of quantum annealers to solving discrete tomography problems with predefined structure.

Information

Type
Papers
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction, provided the original article is properly cited.
Copyright
© The Author(s), 2023. Published by Cambridge University Press
Figure 0

Figure 1. Row and column sums for a Battleship fleet. In Battleship with X-rays, X-ray telemetry reveals the density of the opponents fleet in horizontal and vertical directions, represented by the sum of the occupied spaces in each row and column in the board.

Figure 1

Figure 2. Two different Battleship fleets with the same row and column sums. The fleet on the right is obtained by the one on the left by reflecting the indicated submatrix horizontally across the dashed vertical line.

Figure 2

Figure 3. The $2\times 5$ binary matrices whose column sums are all 1 and whose row sums are 2 and 3, respectively. The sum of the squares of the Laplacian of the matrix is indicated above each arrangement. The potential Battleship fleet positions correspond with the smallest sum values.

Figure 3

Figure 4. Fleets for a particular row and column sum which are obtained via a sequence of Ryser interchanges from the starting fleet. The starting fleet is featured in the upper left corner.

Figure 4

Figure 5. Histogram of the sums of squares of Laplacians for all binary matrices within 4 Ryser interchanges from the starting fleet of the previous figure along with a curve fit to a normalised Gaussian distribution. The binary matrices with fleet realisations are indicated by the dashed vertical lines and lie to the extreme left of the distribution around $3\sigma$ from $\mu$.

Figure 5

Figure 6. A Battleship fleet whose binary matrix is uniquely determined by its tomographic data.

Figure 6

Figure 7. A histogram of the logarithm $\log |\mathfrak U(\vec r,\vec s)|$ of the number of binary matrices with the same row and column sums as a Battleship fleet, generated using a population of 10,000 randomly generated fleets. The minimum, mean and maximum number of matrices were 1, $5431.66$ and 23,950,440, respectively.

Figure 7

Figure 8. Performance of tabu search versus number of iterations on reconstructing randomly generated fleets from their row and column sums, based on an average of 1000 randomly chosen Battleship fleets. For $\geq 200$ iterations, upwards of 92% of randomly generated fleets are able to be reconstructed via this search method. The axis on the left represents the number of reads taken for the simulated annealing algorithm. The right axis shows the number of restarts taken for tabu search algorithm.

Figure 8

Figure 9. A $20\times 20$ binary matrix consisting of two convex bodies. The Laplacian norm squared-minimising QUBO problem formulated here successfully recovers this image exactly from its binary tomographic data.

Figure 9

Figure 10. Several $9\times 9$ matrices with the same tomographic data. The value of the norm squared of the Laplacian is listed below each figure. The original image of the heart has a larger Laplacian value than the others.