Перейти к содержимому
Hub Nexus

Автора пока нетВзять себе

Версия 3Обновлено 5 мин чтения

Поддержка

A puzzle can be handed to a quantum computer if it is written as a QUBO, a quadratic unconstrained binary optimization problem. Alejandro Mata Ali and Edgar Mencia show how to do that for LinkedIn's Queens and Tango games and many of their relatives. The target hardware is quantum annealers such as D-Wave's and digital machines running the Quantum Approximate Optimization Algorithm (QAOA). The authors say they try to optimise the number of variables and interactions, improving the possibility of applying the formulations on such hardware.

What a QUBO is

In a QUBO every unknown is a yes-or-no variable, and the problem is to find the combination with the lowest "energy". A rule is imposed by adding a penalty term that raises the energy whenever the rule is broken, so a valid solution is one with zero energy. Several penalties recur through the paper:

  • Exactly k active: the squared gap between the number of active variables and k.
  • At most one active: one product term for every pair of variables that may not both be on.
  • Two allowed counts (q or q+1): a squared gap measured from q plus one half, which has its lowest value at both counts but leaves a constant offset that can be subtracted.
  • Equal or different: a squared difference for two cells that must match, and a squared "sum minus one" for two that must differ.
  • No three equal in a row: a term that is positive only when three neighboring values are all 0 or all 1.

Queens

The classic N-queens problem, proposed in 1848 by the chess player Max Bezzel and attacked by many mathematicians including Gauss, asks for N queens on an N by N board with none attacking another. It can be solved efficiently, while counting its solutions is much harder. The paper says it has no applications but is a good test bed for methods that solve logically constrained problems.

LinkedIn's version relaxes the diagonal rule so that only queens on adjacent diagonal cells conflict, but adds colored regions that must each hold exactly one queen, plus some queens already placed. The paper gives each rule its own penalty term, using one variable per cell. Pre-placed queens fix some variables, which removes them and the cells they rule out from the problem, and the authors show that the reduced QUBO's lowest-energy states match the puzzle's solutions.

They then generalize step by step: a set number of queens in each row, column or region (regions may overlap); diagonal attacks of any chosen distance, so N-queens and LinkedIn Queens become special cases; regions that may hold either q or q+1 queens; irregular boards; and toroidal boards that wrap around at the edges. The authors stress that diagonal attacks are best written as pairs of cells that conflict, not as one big region over a union of diagonals.

Figure 3 of the paper: an irregular board, and a regular board with an initial condition beside its equivalent irregular board

Figure 3 of the paper. a) An irregular board. b) A regular board with an initial condition and its equivalent irregular board without one; grey squares are not on the board.

Figure 4 of the paper: a toroidal board with a queen, with the squares it could attack along one of its four diagonals in red

Figure 4 of the paper. A toroidal board with a queen; red marks the squares the queen could attack along one of its four diagonals.

Tents & Trees and chess pieces

In Tents & Trees each tree needs an adjacent tent, no two tents may touch, even diagonally, and rows and columns have tent counts. Treating each tree's neighborhood as a region gives only a relaxation, because overlapping neighborhoods do not pair trees with tents one to one. The exact version adds an assignment variable for each tree and each free cell next to it.

The same approach works for any chess piece. The paper defines two new problems: the Coloured Chess Piece Problem, one piece per colored region with no piece threatening another, and the Max Chess Pieces Problem, placing as many mutually safe pieces as possible. For the second, the authors show that a penalty weight larger than the largest reward for a piece guarantees that no best solution contains a threatening pair.

Takuzu and Tango

Takuzu (also called Binairo or 0h h1) fills a grid with 0s and 1s so that each row and column has as many of each, no three equal values sit in a row, and no two rows or columns are identical. LinkedIn's Tango is a 6 by 6 variant with suns and moons: the same balance and no-three rules, but "=" and "x" signs between cells in place of the uniqueness rule. The authors compare it to a single-player tic-tac-toe.

Figure 6 of the paper: a solved Takuzu (0h h1) 6 by 6 board and a solved Tango board

Figure 6 of the paper. a) A solved 6 by 6 Takuzu/0h h1 board. b) A solved Tango board.

Their "local" formulation covers clues, balance, the no-three rule and the signs. It is exact for Tango once the signs are checked for consistency, but only a relaxation for classical Takuzu. A sign system is consistent if the signs around every loop of linked cells agree, and cells joined by signs can be merged into groups with one free variable each, cutting the problem down.

To make Takuzu exact, the authors add "witness" variables: for each pair of rows, and each pair of columns, one variable points to a position where they differ. The penalty is zero only if every pair really differs somewhere. This takes 2N²(N-1) extra binary variables for an N by N board and needs no slack variables. They also propose variants: unequal counts of 0s and 1s, repetition rules along diagonals, colored regions with required counts, toroidal boards, signs between distant cells, and regions whose cells must all be equal or opposite.

What is left to do

The authors suggest running these formulations on real quantum hardware, benchmarking the puzzle families, reducing the extra variables that exact uniqueness needs, widening the allowed counts in region penalties, building a Grover oracle for the problems, and studying QUDO and HOBO formulations.

Sources

  • Alejandro Mata Ali and Edgar Mencia, "A QUBO Formulation for the Generalized LinkedIn Queens and Takuzu/Tango Game," arXiv:2410.06429 (https://arxiv.org/abs/2410.06429), licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Changed here: the paper is rewritten and condensed in hubnx's own words, and its Figures 3, 4 and 6 are shown as published; rewritten in hubnx's own words.

Комментарии

Spinner Logo

Ещё на тему «Наука»

Автор: Hub Nexus editors
Top 10 in AI, week of 12 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 2 November 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 26 October 2026
Автор: Hub Nexus editors
Top 10 in AI, week of 19 October 2026
CC0 1.0 (общественное достояние)
Flood streamflow is typically measured in person, infrequently and usually after the peak. TOADS, a USGS system on a vertical I-beam at the riverbank, profiles water velocity at five depths automatically.
CC0 1.0 (общественное достояние)
Duke University scientists constructed a microbial food web to investigate how climate change and excess nutrients could affect the organisms in it.