NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A note on Cunningham's algorithm for matroid intersection

Huy L. NguyenarXiv 2019

Abstract

In the matroid intersection problem, we are given two matroids of rank $r$ on a common ground set $E$ of $n$ elements and the goal is to find the maximum set that is independent in both matroids. In this note, we show that Cunningham's algorithm for matroid intersection can be implemented to use $O(nr\log^2(r))$ independent oracle calls.

Introduction

Matroids are fundamental mathematical structures that generalize the concept of independence found in linear algebra (vector spaces) and graph theory (forests). The matroid intersection problem asks: given two different matroids on the same ground set, what is the largest subset that is independent in both? This problem is central to combinatorial optimization, with applications in network flow, scheduling, and bipartite matching.

The primary efficiency bottleneck in solving this problem is the number of independent oracle calls—queries to a "black box" that determines whether a specific set is independent. Historically, Cunningham’s algorithm was the standard approach, but it was often believed that achieving high efficiency required highly sophisticated variants. This research note demonstrates that a basic version of Cunningham’s algorithm, when implemented with modern search strategies, can achieve a complexity of $O(nr \log^2 r)$, significantly improving upon the widely cited $\tilde{O}(nr^{3/2})$ bound.

The Exchange Graph and Shortest Augmenting Paths

Cunningham’s algorithm relies on the construction of an Exchange Graph, a directed bipartite graph where nodes represent elements of the current solution ($S$) and elements outside it ($E \setminus S$). Edges in this graph represent valid "swaps" that maintain independence in one of the two matroids. The algorithm proceeds by repeatedly finding the shortest augmenting path in this graph to increase the size of the common independent set.

Traditionally, constructing this graph is computationally expensive because it potentially contains $O(nr)$ edges, each requiring oracle queries to verify. The author proposes a more efficient way to navigate this graph without fully materializing it.

Methodological Innovations

The improved complexity bound is achieved through two key implementation strategies:

1. Adaptive BFS

Instead of pre-calculating the entire exchange graph at each step, the algorithm constructs the graph "on-the-fly" using an Adaptive Breadth-First Search (BFS). The algorithm only queries the independence oracle for neighbors when the BFS actually reaches a specific node. This "lazy" evaluation avoids thousands of unnecessary oracle queries for edges that are never part of the shortest augmenting path.

2. Binary Search for Neighbors

To find which elements can be added or swapped without violating independence, the author employs a binary search strategy over the ground set. In matroid theory, if adding an element $v$ to an independent set $S$ creates a dependency, it creates a unique minimal dependent set called a "circuit."

Rather than checking every element in $S$ to find the members of this circuit, the algorithm orders the elements and uses binary search to pinpoint exactly which element causes the set to become dependent. This reduces the cost of finding neighbors from linear to logarithmic relative to the rank $r$.

Complexity Analysis and Results

The paper leverages a lemma by Cunningham stating that the total length of all shortest augmenting paths found throughout the algorithm is bounded by $O(r \log r)$. By combining the adaptive BFS with the binary search technique, the author proves that the total number of oracle calls is $O(nr \log^2 r)$.

This is a significant theoretical refinement. In the context of big-O notation for these problems, moving from a power of $3/2$ to a near-linear relationship with $n$ and $r$ (ignoring logarithmic factors) represents a major improvement in algorithmic efficiency.

Limitations and Future Work

As a theoretical contribution, this note focuses on complexity analysis rather than empirical performance. While the theoretical bound is superior, real-world performance can be influenced by constant factors hidden in the $O$ notation. Additionally, the analysis assumes the independent oracle is the primary cost; in systems where the ground set is massive but the oracle is extremely fast, other BFS overheads might become relevant.

Future research could explore applying these binary search and adaptive construction techniques to other matroid problems, such as matroid parity or the intersection of three or more matroids (which is NP-hard, but subject to approximation).

Summary updated

BibTeX
@misc{nguyen2019note,
  author = {Huy L. Nguyen},
  title = {{A note on Cunningham's algorithm for matroid intersection}},
  year = {2019},
  eprint = {1904.04129},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1904.04129},
}
Figure