In combinatorial optimization, the matroid intersection problem is to find a largest common independent set in two matroids over the same ground set. If the elements of the matroid are assigned real weights, the weighted matroid intersection problem is to find a common independent set with the maximum possible weight. These problems generalize many problems in combinatorial optimization including finding maximum matchings and maximum weight matchings in bipartite graphs and finding arborescences in directed graphs. The matroid intersection theorem, due to Jack Edmonds, says that there is always a simple upper bound certificate, consisting of a partitioning of the ground set amongst the two matroids, whose value equals the size of a maximum common independent set. Based on this theorem, the matroid intersection problem for two matroids can be solved in polynomial time using matroid partitioning algorithms.
Example
Let G = be a bipartite graph. One may define a partition matroidMUon the ground set E, in which a set of edges is independent if no two of the edges have the same endpoint in U. Similarly one may define a matroid MV in which a set of edges is independent if no two of the edges have the same endpoint in V. Any set of edges that is independent in both MU and MV has the property that no two of its edges share an endpoint; that is, it is a matching. Thus, the largest common independent set of MU and MV is a maximum matching in G.
Extension
The matroid intersection problem becomes NP-hard when three matroids are involved, instead of only two. One proof of this hardness result uses a reduction from the Hamiltonian path problem in directed graphs. Given a directed graphG with nvertices, and specified nodes s and t, the Hamiltonian path problem is the problem of determining whether there exists a simple path of length n − 1 that starts at s and ends at t. It may be assumed without loss of generality that s has no incoming edges and t has no outgoing edges. Then, a Hamiltonian path exists if and only if there is a set of n − 1 elements in the intersection of three matroids on the edge set of the graph: two partition matroids ensuring that the in-degree and out-degree of the selected edge set are both at most one, and the graphic matroid of the undirected graph formed by forgetting the edge orientations in G, ensuring that the selected edge set has no cycles. Another computational problem on matroids, the matroid parity problem, was formulated by as a common generalization of matroid intersection and non-bipartite graph matching. However, although it can be solved in polynomial time for linear matroids, it is NP-hard for other matroids, and requires exponential time in the matroid oracle model.