---
title: Minimum-Weight Parity Factor (MWPF)
url: https://www.emergentmind.com/topics/minimum-weight-parity-factor-mwpf
type: topic
---

# Minimum-Weight Parity Factor (MWPF)

Searching arXiv for recent and foundational papers on Minimum-Weight Parity Factor and related matroid-parity formulations.
Minimum-Weight Parity Factor (MWPF) is an optimization problem that asks for a minimum-weight subset of edges or hyperedges whose incidence parity realizes a prescribed defect set. In graph-theoretic form, it subsumes parity-constrained subgraph selection such as \(T\)-joins; in hypergraph form, it provides a decoding objective for quantum error correction; and in matroidal form, it can be expressed as a weighted linear matroid-parity problem on an appropriate representation matrix. The modern literature presents MWPF along two closely connected lines: a reduction of graph parity factors to weighted linear matroid parity via Pfaffian formulations and primal-dual augmentation [1905.13371], and a hypergraph generalization in which MWPF is cast as a primal-dual covering problem over invalid subgraphs, leading to the HyperBlossom framework for decoding quantum LDPC codes [2508.04969].

## 1. Definition and core formulations

In the hypergraph formulation, \(G=(V,E)\) is a (hyper)graph, \(D\subseteq V\) is the syndrome or defect set, and \(w:E\to\mathbb{R}_+\) assigns non-negative weights to hyperedges. A subset \(\mathcal{E}\subseteq E\) is a parity factor for syndrome \(D\) if the induced defect set
\[
\mathcal D(\mathcal E)=\{\,v\in V\mid |\{e\in\mathcal E:e\ni v\}|\equiv 1 \pmod 2\}
\]
satisfies \(\mathcal D(\mathcal E)=D\). The MWPF problem is then
\[
\min_{\mathcal E\subseteq E,\;\mathcal D(\mathcal E)=D} W(\mathcal E)=\sum_{e\in \mathcal E} w_e.
\]
Equivalently, with binary variables \(x_e\in\{0,1\}\), one minimizes \(\sum_{e\in E} w_e x_e\) subject to parity constraints at every vertex: odd parity on \(D\), even parity on \(V\setminus D\) [2508.04969].

In graphs, MWPF coincides with finding a minimum-weight subgraph whose vertex degrees have prescribed parities. The exposition based on weighted linear matroid parity states that graph-parity factors (\(T\)-joins) are a special case on the cographic matroid of an undirected graph \(G=(V_G,E)\). After fixing an orientation, duplicating each undirected edge into two oriented columns, and pairing those columns into lines \(\ell_e=\{e^+,e^-\}\), a parity base in the associated linear matroid corresponds exactly to a set \(J\) of edges so that each vertex has the prescribed parity of incident edges [1905.13371].

The weighted linear matroid-parity problem itself is defined on a full-row-rank matrix \(A\in K^{m\times n}\), with the ground set given by the columns of \(A\), partitioned into disjoint lines \(\mathcal L=\{\ell_1,\dots,\ell_{n/2}\}\), each line \(\ell=\{v,\bar v\}\) carrying a real weight \(w_\ell\). A base \(B\subseteq V\) in the linear matroid \(M(A)\) is called a parity base if it is a union of lines. The optimization problem is
\[
\text{Minimize } \sum_{\ell\subseteq B} w_\ell
\quad
\text{subject to } B\in \mathrm{Bases}(M(A)) \text{ and } B \text{ is a union of lines,}
\]
with optimal value denoted \(\zeta(A,\mathcal L,w)\) [1905.13371]. In this sense, graph MWPF is embedded into a more general algebraic parity-selection problem.

## 2. Reduction from graph parity factors to weighted linear matroid parity

The reduction described for graphs begins with the oriented incidence matrix of an undirected graph \(G=(V_G,E)\), with one row deleted so that the matrix has full rank. Each undirected edge \(e\) is duplicated into two columns corresponding to the two orientations, producing a matrix \(A\) of dimension \((|V_G|-1)\times 2|E|\). The line system is then \(\ell_e=\{e^+,e^-\}\), and the line weight is \(w(e)\) [1905.13371].

Under this construction, a parity base in \(M(A)\) corresponds exactly to choosing a set of edges whose incidence parity matches the prescribed vertex parity pattern. The exposition states this equivalence directly: a parity base in \(M(A)\) corresponds exactly to choosing a set \(J\) of edges so that each vertex has the prescribed parity of incident edges, i.e. \(J\) is a \(T\)-join or parity factor [1905.13371]. Consequently, MWPF in graphs reduces in one shot to a weighted linear-matroid-parity instance \((A,\mathcal L,w)\).

This reduction is important because it places parity-factor optimization inside the well-developed theory of linear matroid parity. The underlying weighted linear matroid-parity algorithm of Iwata and Kobayashi is described as a combinatorial, deterministic, polynomial-time algorithm that builds on a polynomial matrix formulation using Pfaffians and adopts a primal-dual approach based on the augmenting path algorithm of Gabow and Stallmann for the unweighted problem [1905.13371]. This establishes a direct methodological bridge from blossom-style graph algorithms to algebraic matroid optimization.

A plausible implication is that MWPF inherits both combinatorial and algebraic viewpoints: combinatorially through parity-constrained subgraph selection, and algebraically through bases, lines, and exchange structures in represented matroids.

## 3. Pfaffian polynomial formulation and min-max structure

A central algebraic formulation introduces an indeterminate \(\theta\) and indeterminates \(\tau_\ell\) for each line \(\ell\). One forms the skew-symmetric polynomial matrix
\[
\Phi_A(\theta)=
\begin{pmatrix}
0 & A \\
-A^\top & D(\theta)
\end{pmatrix},
\]
where
\[
D(\theta)=\bigoplus_{\ell\in\mathcal L}
\begin{pmatrix}
0 & -\tau_\ell \theta^{w_\ell}\\
\tau_\ell \theta^{w_\ell} & 0
\end{pmatrix}.
\]
Its Pfaffian expands over perfect matchings in the support graph, and Murata’s combinatorial relaxation lemma yields the degree identity
\[
\deg_\theta \Pf\,\Phi_A(\theta)
=
\sum_{\ell\in\mathcal L} w_\ell - \zeta(A,\mathcal L,w).
\]
Equivalently, the highest exponent of \(\theta\) in the Pfaffian recovers the optimum weight of the weighted linear matroid-parity problem [1905.13371].

The exposition makes the combinatorial meaning explicit: \(\prod_\ell \theta^{w_\ell}\) carries the weight of the complement of a parity base, so reading off the highest exponent recovers \(\zeta\) [1905.13371]. For graph MWPF, this Pfaffian representation provides an indirect encoding of parity-feasible edge sets through a perfect-matching expansion in an auxiliary skew-symmetric matrix.

The same source also presents a min-max characterization. Although no explicit LP of polynomial size is written in the paper, the Pfaffian-matching can be viewed as a max-weight perfect matching in an auxiliary graph \(\Gamma^*\), whose edge weights are the \(\theta\)-degrees of corresponding entries after row and column operations. The standard matching-LP dual induces dual variables \(p:V^*\to\mathbb{R}\) and \(q:\Lambda\to\mathbb{R}_+\), with constraints of the form \(p(v)+p(\bar v)=w_\ell\) on each line and slack inequalities on non-base exchange pairs [1905.13371].

The key inequality for an exchange pair \((u\in B^*, v\notin B^*)\) with \(C^*_{uv}\neq 0\) is
\[
p(v)-p(u)\ge \sum_{H_i\ni \text{ exactly one of } \{u,v\}} q(H_i).
\]
Edges satisfying equality are called tight, and a matching is tight if all its edges are tight and no positive-\(q\) blossom is crossed more than once [1905.13371]. Standard LP duality then yields the min-max relation between minimum parity-base weight and the maximum feasible dual objective, with complementary slackness characterizing optimal primal-dual pairs.

This structure places MWPF, at least in its graphic and represented-matroid incarnations, within the general primal-dual tradition of matching theory. The formulation is not merely existential: it supports an augmenting-path algorithm with blossom management, tight-edge search, and certified optimality.

## 4. Primal-dual augmenting-path algorithm in the linear matroid setting

The weighted linear matroid-parity algorithm maintains a current base \(B^*\subseteq V^*\), dual variables \(p:V^*\to\mathbb{R}\) and \(q:\Lambda\to\mathbb{R}_+\), and a laminar family of blossoms \(\Lambda\), each with a Boolean variable indicating whether it is positive, i.e. whether \(q(H)>0\) [1905.13371]. Initialization arbitrarily splits each line weight \(w_\ell\) into \(p(v)+p(\bar v)=w_\ell\), then runs a greedy matroid-base algorithm on \(p(\cdot)\) to find a minimum-\(p\) base \(B\), sets \(B^*=B\), and starts with \(\Lambda=\varnothing\).

The main loop proceeds until \(B\) is a parity base. First, one builds the equality graph
\[
F^\circ=\{(u,v): u\in B^*,\, v\notin B^*,\, C^*_{uv}\neq 0,\,
p(v)-p(u)=\sum_{H \text{ crosses }\{u,v\}} q(H)\},
\]
and writes \(G^\circ=(V^*,F^\circ)\) [1905.13371]. Second, one performs a blossom-style alternating BFS in \(G^\circ\), labeling singletons in source lines as roots, growing alternating search trees, and creating new blossoms whenever an outer-outer collision occurs. If a path \(P\) is found from a source vertex in one source line to a source vertex in a different source line, augmentation is triggered.

If no augmenting path is found, the algorithm performs a dual update. The update computes
\[
\epsilon=\min\Bigl\{
\tfrac12\min_{u,v\in R^+,\,K(u)\neq K(v)}[p(v)-p(u)-Q_{uv}],
\min_{u\in R^+,\,v\in Y}[p(v)-p(u)-Q_{uv}],
\min_{u\in Y,\,v\in R^+}[p(v)-p(u)-Q_{uv}],
\min_{H\text{ labeled }-} q(H)
\Bigr\},
\]
then shifts \(p\) on \(R^+\) and \(R^-\) according to base membership and adjusts \(q(H)\) by \(+\epsilon\) or \(-\epsilon\) on designated blossoms. Any blossom with \(q(H)=0\) is immediately expanded [1905.13371].

When an augmenting path exists, the algorithm writes the path as a tight perfect-matching-alternating sequence and augments via a symmetric-difference pivot. For each positive blossom crossed by the path, new bud and tip vertices are introduced to maintain the blossom-tree invariants, \(C^*\) is updated by a 4-way pivot, and \(p\) is adjusted accordingly. Then \(C^*\) is pivoted around all vertices of the path at once, giving the new base \(B^*:=B^*\oplus P\). Blossoms that become trivial are collapsed, and routing in each remaining blossom is recomputed recursively [1905.13371].

The exposition emphasizes that throughout the procedure one maintains structural conditions \((BT1),(BT2)\) on \(C^*\) and dual-feasibility conditions \((DF1)-(DF3)\), and that optimality of the final parity base follows from the Pfaffian min-max argument, specifically Theorem 4.1 in the paper [1905.13371]. In the specialized graph setting, these operations correspond to the familiar grow, shrink, dual-update, and alternating-tree manipulations of blossom-based parity algorithms.

## 5. Hypergraph MWPF and the HyperBlossom framework

The 2025 formulation generalizes MWPF from graphs to hypergraphs and is motivated by quantum error correction decoding [2508.04969]. The central obstacle is that, for general hypergraphs, the natural LP relaxation need not be tight: the source states explicitly that for general hypergraphs \(\min \mathrm{LP}\le \min \mathrm{ILP}=\min \mathrm{MWPF}\), so solving the LP to optimality and rounding \(x\) may not give an exact MWPF [2508.04969].

To address this, the problem is reformulated as a covering-type ILP over invalid subgraphs. A subgraph \(S=(V_S,E_S)\), with \(V_S\subseteq V\) and \(E_S\subseteq E[V_S]\), is invalid if no choice \(\mathcal E\subseteq E_S\) realizes the local syndrome \(D\cap V_S\). Denoting by \(\mathcal O\) the collection of all invalid subgraphs, one writes the cover-based ILP
\[
\min \sum_{e\in E} w_e x_e
\quad\text{subject to}\quad
\sum_{e\in \delta(S)} x_e\ge 1 \;\; \forall S\in \mathcal O,
\]
with \(x_e\in\{0,1\}\), where \(\delta(S)\) is the “hair” of \(S\), namely the edges incident to \(V_S\) but not in \(E_S\) [2508.04969]. Relaxing integrality to \(x_e\ge 0\) gives an LP with dual
\[
\max \sum_{S\in \mathcal O} y_S
\quad\text{subject to}\quad
\sum_{S: e\in \delta(S)} y_S\le w_e\;\; \forall e\in E,\qquad y_S\ge 0.
\]

Complementary slackness takes the form
\[
\sum_{S:e\in\delta(S)} y_S^* < w_e \implies x_e^*=0,
\qquad
x_e^*>0 \implies \sum_{S:e\in\delta(S)} y_S^* = w_e.
\]
HyperBlossom is presented as a primal-dual method that drives the gap to zero or certifies proximity [2508.04969]. This is the hypergraph analogue of blossom-style exactness certificates in graph matching, but with dual variables defined on invalid subgraphs rather than only on odd-cardinality vertex sets.

The algorithm alternates two phases. The dual phase maintains a feasible dual vector \(y[\cdot]\) and identifies tight edges
\[
T=\{e:\sum_{S:e\in\delta(S)} y_S = w_e\}.
\]
The primal phase operates cluster-by-cluster, where clusters are connected components of \((T\cup \mathcal B)\) acting on \(V\), with \(\mathcal B=\{S\in \mathcal O: y_S>0\}\) the set of hyperblossoms [2508.04969]. For a cluster \(C\), the primal phase first tests local optimality by solving MWPF on \((V_C,E_C)\); if the local optimum \(W_{\mathrm{loc}}\) equals \(\sum_{S\in \mathcal B_C} y_S\), the cluster is locally optimal. Otherwise it calls \(\mathrm{BatchedRelaxing}(C,T_C,\mathcal B_C)\) to extract relaxers \(R_i\), removes the relaxed edges, and if the residual subgraph is still invalid, chooses a trivial dual direction \(\Delta y\) supported on an invalid subgraph [2508.04969].

A relaxer is defined as a dual direction that remains feasible and strictly decreases the tightness of at least one tight edge. The paper describes a general framework for batch relaxing by composing multiple relaxers into one \(\Delta' y\) (Theorem 2) [2508.04969]. For general hypergraphs, the SingleHair subroutine constructs a hair matrix \(H_S\) for each current hyperblossom \(S\), looks for an odd row, and from that row derives an invalid super-subgraph \(S^+\) with a valid relaxer \(\Delta y_S=-1\), \(\Delta y_{S^+}=+1\). If no odd row exists for any \(S\), the dual is in a “single-hair” state and no further relaxer is found [2508.04969].

The dual phase then adds any new blossom with \(\Delta y_S>0\) to the cluster’s dual history, re-solves the partial LP on variables in that history to optimality, recomputes \(T\) and \(\mathcal B\), and re-merges clusters [2508.04969]. The top-level pseudocode repeatedly alternates these steps until all clusters are locally optimal, at which point it returns the global parity factor \(\mathcal E=\cup_C \mathrm{MWPF}(C)\) together with the dual vector \(y\).

## 6. Complexity, specialization, and decoding applications

For weighted linear matroid parity, the running-time analysis in the exposition yields the following bounds. Let \(n=|V|\) and \(m=\mathrm{rank}(A)\). Each blossom-oriented search, including creation of new blossoms and maintenance of \(C^*\), takes \(O(n^2)\) field operations; each dual update also takes \(O(n^2)\); there are at most \(O(n)\) dual updates between successive augmentations by Lemma 7.2; each augmentation takes \(O(n^3)\); and there are at most \(m/2\) augmentations. The resulting total is \(O(n^3 m)\). Over a fixed finite field, this gives a strongly-polynomial \(O(n^3 m)\)-time algorithm [1905.13371].

In the graphic specialization, \(m=|V_G|-1\) and \(n=2|E|\). The exposition states that one need not explicitly build an \(n\times n\) skew-symmetric matrix: cavity-pivot operations on \(C^*\) correspond exactly to the usual grow, shrink, and dual-update steps of \(T\)-join via cographic blossoms, while blossom creation and expansion correspond to shrinking odd cuts in the cographic matroid [1905.13371]. The resulting bound is \(O(|E|^3 |V|)\) time for obtaining a minimum-weight subgraph with the prescribed vertex-degree parities [1905.13371].

For HyperBlossom on general hypergraphs, worst-case complexity is described in terms of the number \(|\mathcal O|\) of invalid subgraphs and the cost \(F(|V|,|E|)\) of one relaxer-finder call. One relaxation round calls at most \(|T|\) relaxers, giving \(O(|E|\cdot F)\); there are at most \(|\mathcal O|\) rounds until no more new blossoms; each dual phase solves an LP in \(|\mathcal B_C^U|\) variables; and summing over all rounds gives a worst-case \(O(|\mathcal O|^{2.5}|V|^2)\) by an interior-point bound. The total is therefore bounded by
\[
O\!\left(|\mathcal O|^{2.5}|V|^2 + |\mathcal O|\cdot |E|\cdot F\right)
\]
[2508.04969].

The same work emphasizes a certified proximity property: at any time, primal and dual feasible solutions satisfy
\[
\sum w_e x_e - \sum y_S \ge 0,
\]
and the true optimum lies in this gap; when the gap is zero, exact optimality is certified [2508.04969]. This certificate is especially important in decoding settings, where heuristic decoders often lack verifiable suboptimality bounds.

HyperBlossom is positioned as a unified framework for quantum error correction decoding. The paper states that it formulates Most-Likely-Error decoding as an MWPF problem and generalizes the blossom algorithm to hypergraphs via a similar primal-dual linear programming model with certifiable proximity bounds [2508.04969]. It further states that HyperBlossom unifies existing graph-based decoders such as (Hypergraph) Union-Find decoders and the Minimum-Weight Perfect Matching decoder [2508.04969]. The implementation, Hyperion, is described as Rust software with both floating and rational LP and Python bindings, and the reported empirical results include a 4.8x lower logical error rate than MWPM on the distance-11 surface code, a 1.6x lower logical error rate than a fine-tuned BPOSD decoder on the \([[90,8,10]]\) bivariate bicycle code under code-capacity noise, and almost-linear average runtime scaling on the surface code and color code up to code distances 99 and 31 for code-capacity and circuit-level noise, respectively [2508.04969].

A common misconception is that MWPF is merely a renaming of MWPM. The hypergraph formulation makes clear that classical MWPM on simple graphs is only the special case of “degree-2 only hyperedges” [2508.04969]. Another common misconception is that blossom methods intrinsically require graph matching structure. The recent literature suggests instead that blossom-like primal-dual logic can be lifted to broader parity-constrained settings, although exactness in the hypergraph case depends on additional structure or on gap certification rather than blanket LP integrality [2508.04969].

## 7. Conceptual significance and relation between the two lines of work

The two arXiv sources describe MWPF from different but compatible perspectives. The 2019 weighted linear matroid-parity work provides the algebraic and combinatorial machinery for exact minimum-weight parity selection in represented matroids, together with a Pfaffian min-max theory and an augmenting-path algorithm [1905.13371]. The 2025 HyperBlossom work extends the parity-factor viewpoint to hypergraphs and uses a covering-dual formulation over invalid subgraphs to obtain a certifying primal-dual algorithm for decoding [2508.04969].

Their common structure is the use of tight objects, dual feasibility, and blossom-like contractions or generalized relaxations. In the matroid setting, tightness is defined by equality in exchange inequalities involving \(p\) and \(q\), and blossoms are laminar structures governing augmenting-path search [1905.13371]. In the hypergraph setting, tightness is defined by saturated dual constraints \(\sum_{S:e\in\delta(S)} y_S=w_e\), hyperblossoms are invalid subgraphs with positive dual weight, and relaxers play the role of generalized dual directions that expose new structure [2508.04969].

This suggests a broad interpretation of MWPF as a parity-constrained optimization paradigm rather than a single narrow graph problem. In graphs, it recovers \(T\)-joins through cographic matroids; in represented matroids, it becomes weighted linear matroid parity; in hypergraphs, it supports a certifying decoder architecture for qLDPC codes [1905.13371] [2508.04969]. The continuity across these settings lies in a recurring min-max pattern: a primal object encoding parity feasibility, a dual object measuring obstruction or invalidity, and an algorithmic mechanism that alternates structural search with dual adjustment until optimality or certified proximity is established.

Source: https://www.emergentmind.com/topics/minimum-weight-parity-factor-mwpf