This paper http://www.mountainvistasoft.com/docs/BattleshipsAsDecidabilityProblem.pdf says that the decision problem, "Given a particular puzzle, is there a solution?" is NP-Complete. I don't understand why this can't be done in polynomial time. Given constraints that no two ships can be orthogonally or diagonally adjacent, why not just create a grid where there are 2 times as many columns as "bins" with enough rows to put a "separator" run in between every ship. I've seen the reduction demonstrated this way and it seems like it could be done in polynomial time.
-
Please explain what the "battleship puzzle" is and what it's relation to "bins" and "separators" is. People shouldn't have to follow a link to find out what you're even asking about. Also, please clarify how this question is different from all the other battleships questions that have been posted in the past couple of days. – David Richerby May 02 '16 at 21:18
-
Also, it seems that you're misunderstanding NP-completeness. You seem to be arguing that the reduction can be performed in polynomial time: if so, that's a requirement, not a problem. If that is what you're asking about, I suggest you check out our reference question on NP-completeness and related topics. – David Richerby May 02 '16 at 21:21
-
2It seems to me that the grid size is a part of the input. You cannot choose any grid you want. – Andreas T May 02 '16 at 21:21
2 Answers
As Andreas T mentions, what you're missing is that the grid is part of the instance.
The instance specifies both the grid and the ships.
Why can't the Battleship puzzle be solved in polynomial time? This is the one million dollar question (literally). But since the paper you mention proves that Battleship is NP-complete, the widely believed conjecture P≠NP implies that Battleship cannot be solved in polynomial time.
The paper goes on to prove that Battleship cannot be solved in polynomial time even when the solution is unique, unless NP=RP, which is also considered unlikely. This is a more realistic version of the problem, since in practice Battleship problems have a unique solution.

- 81,689
- 26
- 141
- 235

- 276,994
- 27
- 311
- 503
What it means is: They have found an NP-complete problem that could be solved by creating a very cleverly designed "Battleship" instance of at most polynomial larger size, solving the "Battleship" instance and creating a solution for the original instance from that.
It's really a guess, but I suppose they figured out a way to simulate logical circuits by setting up a "Battleship" problem. With "Game of Life", I think you can create "gliders" that effectively simulate a very primitive computer.

- 29,996
- 34
- 54