Most 5s in a 5x5 Super Minesweeper grid

In a Super™ Minesweeper grid each cell is either a mine or a value. A value in row $$𝑟$$ and column $$𝑐$$ represents the total number of mines located in row $$𝑟$$ or column $$𝑐$$.

What is the most number of 5s that can occur in a 5x5 Super™ Minesweeper grid? Good luck!

• Would [optimization] be an appropriate tag? Commented Nov 9, 2020 at 0:59
• Yes I suppose it is an optimization. Commented Nov 9, 2020 at 1:02
• Shouldn't it be "the total number of mines located in row r AND column c."? Commented Nov 9, 2020 at 8:26
• it depends how you interpret it. We are counting mines that are either in the same row or same column, they can't be in both. Commented Nov 9, 2020 at 10:47

Number of fives:

Twelve

One such grid:

 X 5 X 5 X
5 X 5 X 5
X 5 X 5 X
5 X 5 X 5
X 5 X 5 X

• Via integer linear programming, this value is optimal. Commented Nov 9, 2020 at 1:32
• @RobPratt I expected it would be. Thanks for confirmation. Commented Nov 9, 2020 at 1:33
• Well done! Pretty solution. Commented Nov 9, 2020 at 2:29