How this calculation works
Find a largest labeled column subset independent in two separate matrix representations. Both representations use the same ground-set labels and field convention. The page returns a common independent witness after complete bounded subset search, keeping this intersection problem distinct from intersecting vector spaces or finding a common matrix nullspace.
max |I| such that I independent in M1 and M2.A worked example
In the first representation every pair of three columns is independent. In the second, columns zero and one are parallel but either pairs independently with column two. Maximum common independent size is two.
Good to know
Same labeled column set≤10, same rational/prime field convention; complete bounded subset maximum and witness, no heuristic estimate.
Reference: Method reference: Matroid intersection calculator from two representations (opens in a new tab) ↗
Match elements by column position
Column zero in the first representation refers to the same selectable element as column zero in the second, even though its coordinate vector can differ. Both matrices must therefore have the same number of columns. Their row counts can differ because the two independence rules can live in different ambient spaces.
Reordering only one representation changes the pairing of elements and therefore the optimization problem. Use a shared external identifier when assembling matrices, then preserve that order in both inputs. The calculator cannot infer that a coordinate vector in one matrix corresponds to a differently positioned vector in the other.
The Linear matroid circuits and flats calculator from a matrix shows the circuits and flats of one representation. Intersecting two sets of bases is not enough when the largest common independent set is smaller than either individual rank.
Define the simultaneous independence objective
A candidate subset is feasible only if its selected columns are independent in the first representation and independently also independent in the second. The objective is maximum cardinality of that common subset. It does not ask for vectors that are numerically equal in the two coordinate spaces.
A subset reaching the smaller of the two whole-matroid ranks is a strong feasible result, but not every pair of representations allows it. Conflicting dependence patterns can force a smaller optimum. Comparing only the two total ranks is therefore insufficient to solve the intersection question.
Verify the default example
In the first matrix, columns (1,0),(0,1),(1,1) make every pair independent. In the second, columns zero and one are both (1,0), while column two is (0,1). The pair {zero,one} fails the second independence rule.
Either {zero,two} or {one,two} is independent in both, giving maximum size two. Neither representation has rank above two, so a larger feasible set is impossible. The two tied witnesses demonstrate why a different selected pair can be correct without implying a different optimum.
Use exact rank checks in the chosen field
The field selector is rational when zero and otherwise a supported prime. Every subset rank is calculated in that field, with invalid modular denominators rejected. A candidate with two columns can be feasible over one field and dependent over another, changing both witness and maximum size.
The same selector applies to both representations in this version. Mixed-field matroids could be compared as abstract independence systems in a more general interface, but that is not the input contract here. Do not enter a prime intending it to apply only to the second matrix.
Understand the bounded optimality proof
The implementation evaluates all subsets of at most ten labeled elements and retains a largest subset whose rank equals its cardinality in both matrices. Completing that finite enumeration proves maximum size. It does not rely on a greedy selection that could become trapped by an early incompatible column.
Matroid-intersection theory offers more scalable algorithms and min-max certificates, but this small educational solver uses exhaustive verification. Its exact claim is about a completed bounded instance, not an implementation of every advanced augmentation algorithm. The reported subset count describes that work rather than a statistical measure.
Distinguish intersection of matroids from spaces
The intersection of two vector subspaces contains vectors satisfying both membership conditions. Here the result is a set of selectable labels whose columns satisfy two independence systems. It need not form a vector space and is not calculated by stacking equations for a nullspace.
The family of common independent sets is not generally itself a matroid, which explains why a naive greedy strategy is not justified by one-matroid intuition. The page reports one maximum set, not a complete circuit or flat description of that family. Use the companion representation analysis only for each individual input matroid.
Model constraints without extending the guarantee
Represented matroid constraints can express certain redundancy or capacity structures, but arbitrary constraints are not automatically matroids or linear representations. If an application also forbids selected pairs or assigns unequal values, the unweighted maximum-size output does not solve that richer optimization.
Weighted matroid intersection requires a weighted objective and appropriate solver. The current result counts every chosen label equally. Report both representations, their common field and the selected indices so that the simultaneous independence checks can be reproduced rather than relying only on the returned size.
A few questions, answered
Do the two matrices need the same row count?
No. They need the same labeled column set; their ambient row dimensions can differ.
Is this vector-space intersection?
No. It selects labels whose corresponding columns are independent in both representations.
Does the smaller whole-matrix rank determine the answer?
It is an upper bound, but conflicting dependence patterns can make the maximum common size smaller.
Does this maximize a weighted benefit?
No. It maximizes the number of selected labels.