Positive-Cycle Matching Repair
Implementation & benchmark of arXiv:2607.10070 — Characterization and equilibrium of bichromatic max-sum matchings
Source paper: Characterization and equilibrium of bichromatic max-sum matchings arXiv:2607.10070 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Use the paper's cycle-gain criterion to repair an approximate bipartite matching produced by greedy matching, truncated Sinkhorn, or a neural router. A directed edge from matched red item i to red item j represents replacing i's current blue partner with j's partner; any positive-gain directed cycle is a guaranteed improving, feasibility-preserving reassignment.
Formulas
Mathematical statement
For red items and blue items indexed by i and j, let M contain pairs (a_i,b_i), and define cost(M)=sum over matched pairs of d(a,b). For a directed cycle C=(a_{i_1},...,a_{i_m}), the paper replaces (a_{i_j},b_{i_j}) by (a_{i_j},b_{i_{j+1}}), with i_{m+1}=i_1, and defines gain(C)=sum_j d(a_{i_j},b_{i_{j+1}})-sum_j d(a_{i_j},b_{i_j}). Its theorem states that M is maximum-sum if and only if gain(C) is at most zero for every directed red cycle. In a neural model, replace distance d(a_i,b_j) by a learned compatibility score S_ij, where larger is better. For current permutation pi, define w_ij=S_{i,pi(j)}-S_{i,pi(i)}. Then G(C)=sum_r w_{i_r i_{r+1}} is the score improvement from rotating the blue partners along C. A positive-gain cycle strictly improves total score while preserving the one-to-one matching; absence of positive cycles certifies global optimality because every competing permutation decomposes into disjoint cycles.
Implementation notes
(1) Integrate this after the network computes a compatibility matrix S in R^(n x n) between n query or red embeddings and n candidate or blue embeddings, and before the downstream loss or routing operation. Obtain an initial bijection pi using greedy row-wise assignment, truncated Sinkhorn rounding, or the router's current top-1 decisions. (2) Construct a directed graph on red indices. For every ordered pair (i,j), compute w_ij=S[i,pi[j]]-S[i,pi[i]], with w_ii=0. Repeatedly search for a positive directed cycle. If C=(i_1,...,i_m) has G(C)=sum_r w_{i_r,i_{r+1}}>epsilon, replace pi[i_r] by pi[i_{r+1}] for every r. For an MVP, enumerate all 2-cycles and 3-cycles, costing O(n^3) per repair pass. For arbitrary cycles, run Bellman-Ford on edge weights -w; a negative cycle in -w is a positive-gain cycle in w. Stop after a fixed number of augmentations or when the largest detected gain is at most epsilon. (3) The exact mathematical quantities are each cycle gain and the guaranteed score increase after an accepted rotation. The initial matching, cycle-length limit, epsilon, and number of passes are empirical choices. During training, sample 16-64 cycles of lengths 2-6 and add lambda times L_cycle to the task loss; detach the discrete pi or use soft Sinkhorn probabilities for a differentiable approximation. (4) First test on a small two-tower retrieval model or a 4-layer Transformer with batches of 32-128 paired items. Compare greedy matching, 20-step Sinkhorn, Hungarian matching, and greedy-plus-cycle-repair on total assignment score, downstream accuracy, latency, and collision count. The expected signal is a consistent score increase over greedy or truncated Sinkhorn at equal inference cost, convergence toward Hungarian-quality assignments, and lower residual positive-cycle mass on validation batches.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.