Skip to content

Reproducing Set Packing Problem #22

Answered by BusyBeaver-42
seanlaw asked this question in Q&A
Discussion options

You must be logged in to vote

The constraints can be written as QUBO penalties so:

$$\max x_1+x_2+x_3+x_4−Px_1x_3−Px_1x_4−Px_3x_4−Px_1x_2$$

where the scalar penalty $P$ is arbitrarily chosen to be 3. Thus, our $Q$ matrix is:

Q = torch.tensor([[1, -3, -3, -3],
                  [-3, 1,  0,  0],
                  [-3, 0,  1, -3],
                  [-3, 0, -3,  1]
                 ])

Actually your matrix uses a penalty $P = 6$. Indeed, for some $i \neq j$ the coefficient in front of $x_i x_j$ is $Q_{i, j} + Q_{j, i}$. However, this is not where the problem comes from.

I get x1, x2, x3, x4 = (1, 0, 0, 0) and the objective function evaluates to 1, which is smaller than the expected 2 above. Therefore, this SB solution i…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@bqth29
Comment options

@seanlaw
Comment options

@BusyBeaver-42
Comment options

@seanlaw
Comment options

Answer selected by bqth29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants