Advanced maths

Matroid partition calculator with independent set allocation certificates

Partition a common labeled ground set into independent parts of supplied prime-field matroids.

Your numbers

Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Matroid partition assigns every ground element to exactly one of several classes, with class i required to be independent in matroid i. The matroids share labeled ground elements but can have different dependence relations. A successful allocation covers all labels without duplication.

THE FORMULAAccept2–4matricesoverGF(p), common labeled columns. Precompute subset ranks or test appendindependence with exact modular elimination. Backtrack assign each ground element to exactlyonecolor; classi must be independent inmatroidi. Prune by availablerankand remaininggroundelements; memoize assignment state. Optionally supply Edmonds obstruction subset X with |X|>sum_i rank_i(X) whennoallocationexists; brute enumerate≤4096subsets for12elements. This universalrankcondition is necessaryandsufficient.

A worked example

With the prefilled inputs, feasible = Yes.

Good to know

Every labeled column assigned exactly once; each part independent in its OWN represented matroid. Zero columns can make cover impossible.

Partition one ground set among independent classes

Matroid partition assigns every ground element to exactly one of several classes, with class i required to be independent in matroid i. The matroids share labeled ground elements but can have different dependence relations. A successful allocation covers all labels without duplication.

For linear matroids, a submitted matrix represents each element by a column. Independence is column linear independence over the selected finite field. This is different from ordinary integer or real matrix rank, which can disagree with rank modulo a prime.

An independent-set allocation for two binary matroidsPartition three binary columns into independent sets101011012Class 1: {0, 1}rank = size = 2Class 2: {2}rank = size = 1The same GF(2) matrix represents both matroids.
Scroll across to see the full diagram.
Columns (1,0), (0,1), (1,1) cannot all share one independent class, but the partition {0,1} and {2} is valid for the two represented matroids.

Compare with the Linear matroid circuits and flats calculator from a matrix. Partition a common groundset among several entered representedmatroids subject to eachpart beingindependent; circuits/flats of one matroid do not solveallocation.

Align columns across all submitted matrices

Use the prefilled input structure and preserve the declared column or index order. Every matrix must have the same number of columns in the same label order. Their row counts may differ, because each represents its own vector space. Enter canonical field representatives from zero through p−1. Negative or out-of-range entries are rejected rather than silently reduced, and composite moduli are not accepted as fields.

A zero column is a loop in that matroid and cannot be assigned to its independent class. An element may still be assignable to another matroid where its column is nonzero. If an element is a loop everywhere, no complete allocation can exist.

Add an element only when rank increases

The exact search assigns labels successively and checks whether appending an element to a proposed class increases its rank by one. Dependent partial classes can be rejected immediately. Rank capacities and memoized states can prune repeated subproblems without changing the accepted allocations.

A subset X with cardinality exceeding the sum of its ranks in the available matroids is a mathematical obstruction to allocation. This is useful independent theory, but the current engine does not search for or return that obstruction subset. Its negative result comes from complete bounded backtracking over assignments, with cap exhaustion reported separately as an error.

Split three binary columns between two classes

Use columns (1,0), (0,1) and (1,1) over the binary field in both matroids. All three together are dependent, while every pair is independent. Assign the first two labels to the first class and the third label to the second.

The two assigned columns in class one have rank two. The single nonzero column in class two has rank one, and every label appears exactly once. This certificate can be checked by two tiny elimination calculations rather than rerunning the allocation search.

Show allocation and rank certificates together

The SVG should display one column label per ground element and connect it to its assigned class. Each class should state its size and computed rank, which must agree. Distinct patterns or labels should supplement color so the independence certificate is readable in monochrome.

A successful result returns the assigned label sets, and their independence can be checked by recomputing each selected-column rank. The current result does not include per-class rank tables or a negative rank-obstruction subset. Any diagram explaining the three-column example is a fixed worked illustration, not a claim that those extra certificates are produced for arbitrary input.

Identical matroids are a mode of the same task

When all input matrices represent the same matroid, the calculation partitions the ground set into several independent sets of that matroid. Graphic-matroid forest allocation is one example, not a separate calculator differing only by an input preset.

A greedy choice can use a column needed by a later element and falsely get stuck. Exact backtracking or a correct augmenting algorithm must be allowed to revise earlier assignments. A partial allocation's failure to extend does not establish global impossibility unless all alternatives are exhausted.

Separate complete impossibility from a state limit

The proposed small common ground set allows exact finite-field arithmetic, but the allocation search still needs a work limit. A cap means unresolved feasibility. It must not be displayed with the same no-allocation wording used after a completed search or a verified rank obstruction.

Test a loop present in every matroid, duplicate parallel columns, matrices whose real and binary ranks differ, and permutations of the shared column labels. These checks exercise field semantics, common labeling and complete coverage rather than only the successful example. The public prefill is smaller than the three-column illustration: each of the two binary matrices is the one-row matrix (1,1). Its two parallel elements cannot share one independent class, so one label goes to each class. The output lists that allocation without reporting a maximum-weight objective, class rank certificate or a minimum number of matroids. Every labeled column assigned exactly once; each part independent in its OWN represented matroid. Zero columns can make cover impossible.

A few questions, answered

Must all matrices have the same row count?

No. Their ambient spaces may differ. They must share the same labeled columns in the same order.

Can an element be assigned to two classes?

No. This is a partition: every ground label must appear exactly once.

Why can real-valued matrix rank give the wrong allocation?

Independence is defined over the selected finite field, where modular cancellations can change rank.

What certifies a negative answer?

An exhausted exact search or a subset whose cardinality exceeds the sum of its ranks in the available matroids certifies impossibility.

Find your calculator

Start typing to explore the library.