Repository navigation
[Rule] GraphPartitioning to QUBO #119
Description
Source: GraphPartitioning
Target: QUBO
Motivation: Enables solving graph bisection on quantum annealers (D-Wave); natural quadratic formulation with balance penalty.
Reference: Lucas, 2014, Ising formulations of many NP problems, Section 2.2
Reduction Algorithm
Notation:
- Source: undirected graph
$G = (V, E)$ ,$n = |V|$ (even),$m = |E|$ - Target: QUBO with
$n$ binary variables
Variable mapping:
Step 1 — Cut-counting term. For each edge
Step 2 — Balance penalty. The quadratic penalty
Step 3 — Construct the QUBO Q matrix. Initialize an
-
$Q_{uu} \mathrel{+}= 1$ ,$Q_{vv} \mathrel{+}= 1$ (linear cut terms) -
$Q_{uv} \mathrel{+}= -2$ (quadratic cut term)
Then add the expanded penalty
- For each
$i$ :$Q_{ii} \mathrel{+}= P(1-n)$ - For each
$i < j$ :$Q_{ij} \mathrel{+}= 2P$
Resulting QUBO Q matrix entries:
The QUBO objective is
Solution extraction:
Size Overhead
| Target metric (code name) | Polynomial (using symbols above) |
|---|---|
num_vars |
Validation Method
Closed-loop testing: solve GraphPartitioning by brute-force, solve the reduced QUBO, and verify both give the same optimal cut. Verify penalty
Example
Source: 6 vertices, 9 edges:
QUBO: 6 variables, penalty
Degrees:
Off-diagonal (
Optimal:
Infeasible example:
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
zazabap commentedon Mar 8, 2026
Issue Quality Check — Rule
Overall: 1 passed, 1 failed, 2 warnings
Usefulness
GraphPartitioning does not exist in the codebase. Requires a
[Model]issue first.Non-trivial
Constructs a QUBO objective with cut-counting quadratic term and balance-enforcing penalty. Standard but non-trivial encoding.
Correctness — WARN
Lucas (2014) is a verified reference (already in bibliography as
lucas2014). However, the issue cites "Section 5.2" — the graph partitioning formulation is actually in Section 2.2 of the paper.The QUBO formulation H = Σ(xᵤ + x_v − 2xᵤx_v) + P(Σxᵢ − n/2)² is mathematically correct. Setting P > m ensures balance.
Well-written — FAIL
Example arithmetic errors:
The infeasible example x = (0,0,0,0,1,1) claims:
The optimal example (x = (0,0,0,1,1,1), cut = 3, H = 3) is correct.
Required fixes
[Model]issue for GraphPartitioningzazabap commentedon Mar 11, 2026
Issue Quality Check — Rule
GraphPartitioningdoes not yet exist in the reduction graph; novel reductionOverall: 2 passed, 1 failed, 1 warning
Usefulness
The source problem
GraphPartitioningdoes not exist in the codebase (pred show GraphPartitioningfails). Since neither the problem nor any reduction from it exists, this is a novel contribution. However, note that the source model must be implemented first before this rule can be added.Non-trivial
The reduction constructs a QUBO objective with two distinct components:
This involves genuine structural transformation — encoding graph structure and balance constraints into a single unconstrained quadratic objective with penalty terms. Pass.
Correctness
Reference verification:
The issue cites: Lucas, 2014, "Ising formulations of many NP problems" (DOI: 10.3389/fphy.2014.00005), Section 5.2.
references.bibentrylucas2014).Formulation verification:
Despite the wrong section citation, the QUBO formulation in the issue is mathematically correct. Lucas (2014) Section 2.2 uses Ising spins$s_v = \pm 1$ with:
The issue's formulation uses binary variables$x_i \in {0,1}$ (related by $x = (s+1)/2$ ), which is the standard QUBO conversion. The resulting Hamiltonian $H = \sum_{(u,v)}(x_u + x_v - 2x_u x_v) + P(\sum x_i - n/2)^2$ is equivalent after this change of variables.
The penalty condition$P > m$ is sufficient to enforce balance, consistent with the paper's analysis (Equation 10).
Well-written
Template completeness: All required sections are present (Source, Target, Motivation, Reference, Reduction Algorithm, Size Overhead, Validation Method, Example). ✅
Symbol consistency: Symbols$n$ , $m$ , $G$ , $V$ , $E$ , $P$ are all defined before use. ✅
Overhead table:$n$ binary variables (one per vertex). The target's
num_vars = nis correct — the QUBO has exactlysize_fieldsconfirmsnum_varsis the correct field name. ✅Algorithm completeness (⚠️ Warning):$Q_{ij}$ ) from the Hamiltonian. An implementer needs to:
The Hamiltonian is clearly specified, but the issue does not explicitly describe how to construct the QUBO Q matrix entries (
This step is non-trivial (the penalty expansion produces$O(n^2)$ off-diagonal terms) and should be spelled out for implementability.
Example quality: The 6-vertex example is well-chosen — small enough to verify by hand, includes both a feasible optimal solution and an infeasible configuration showing the penalty in action. ✅
Recommendations
GraphPartitioningmust be implemented first (no open issue found for it).isPANN commentedon Mar 20, 2026
Issue Quality Check — Rule
Overall: 2 passed, 1 failed, 1 warning
Usefulness
pred path GraphPartitioning QUBOreturns no path — this is a novel reduction. GraphPartitioning currently has no outgoing reductions at all, so this would be the first connection from the graph partitioning family to QUBO/quantum annealing problems. Pass.Non-trivial
The reduction constructs a QUBO objective with two distinct components:
This involves genuine structural transformation — encoding graph structure and a hard balance constraint into a single unconstrained quadratic objective with penalty terms. Pass.
Correctness
Reference verification:
lucas2014.Formulation verification:
Lucas (2014) Section 2.2 uses Ising spins$s_v = \pm 1$ with $H_A = A(\sum s_i)^2$ (balance) and $H_B = B \sum_{(uv)} (1 - s_u s_v)/2$ (cut). Under the standard substitution $s_i = 1 - 2x_i$ , this becomes exactly the issue's QUBO formula. ✅
Penalty condition:$P > m$ is sufficient to enforce balance. ✅
Overhead verification:$n$ binary variables (one per vertex). ✅
num_vars = nmaps tonum_vars = num_verticesin code. GraphPartitioning hasnum_vertices()getter; QUBO hasnum_varsas its size field. The QUBO has exactlyInfeasible example errors:
The infeasible example$x = (0,0,0,0,1,1)$ (partition B = {4,5}) claims "cut = 2, H = 12". Verified by enumeration:
The optimal example$x = (0,0,0,1,1,1)$ with $H = 3$ is correct (confirmed by brute-force enumeration of all 64 configurations; tied with complement $(1,1,1,0,0,0)$).
Well-written
Required sections: Source ✅, Target ✅, Motivation ✅, Reference ✅, Reduction Algorithm ✅, Size Overhead ✅, Validation Method ✅, Example ✅ — all present and substantive.
Symbol consistency: Symbols$n$ , $m$ , $G$ , $V$ , $E$ , $P$ are defined before use. Overhead metric
num_varsmatches QUBO's size field. ✅Algorithm completeness (⚠️ Warning): The Hamiltonian formula is clearly specified, but the issue does not show how to populate the QUBO Q matrix entries from the expanded Hamiltonian. An implementer needs to:
This is non-trivial (the penalty expansion produces$O(n^2)$ off-diagonal terms).
Example quality (⚠️ Warning): Search space = $2^6 = 64$ , below the recommended 128. There are 20 feasible balanced partitions and 18 suboptimal ones, which is sufficient for testing diversity. Recommend using 7–8 vertices for a stronger example.
Required fixes
Recommendations
isPANN commentedon Mar 20, 2026
Fix-issue changelog
Applied by
/fix-issue.Add plan for #119: [Rule] GraphPartitioning to QUBO
GiggleLiu commentedon Mar 21, 2026
Please kindly check the following items (PR #706):
cargo install --path problemreductions-cli):💬 Join the discussion on Zulip — feel free to ask questions or leave feedback there.
Fix #119: [Rule] GraphPartitioning to QUBO (#706)