How to use this calculator
Match as many allowed left/right pairs as possible without assigning any node twice.
- Enter Left-side nodes, Right-side nodes, Allowed pairs as left right, comma separated. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Maximum bipartite cardinality matching explained
Inputs, symbols, and units
l— Left-side nodes- Left-side nodes. Enter a whole number.
r— Right-side nodes- Right-side nodes. Enter a whole number.
e— Allowed pairs as left right, comma separated- Allowed pairs as left right, comma separated.
Formula and method
Augmenting-path matching with one partner per node
Try to connect each left node to an unused right node, allowing an augmenting path to move an earlier match when that frees a partner. The final matching has maximum cardinality, while ties depend on the order of allowed pairs.
A worked scenario
Left-side nodes = 3; Right-side nodes = 3; Allowed pairs as left right, comma separated = 1 1, 1 2, 2 1, 3 2, 3 3.
- Maximum matched pairs: 3
- Selected pairs: 2 ↔ 1; 1 ↔ 2; 3 ↔ 3
The selected edges pair all three left-side nodes with distinct right-side nodes; the displayed assignment is one maximum-cardinality solution.
Assumptions and edge cases
Unweighted compatibility edges only; preference scores and costs require the assignment-cost tool.
Frequently asked questions
Can a person receive two assignments?
No, each node participates in at most one selected pair.
Must the two sides have equal sizes?
No.
Does it minimize cost?
No, it maximizes pair count.
How do I use the Maximum bipartite cardinality matching calculator?
Enter Left-side nodes, Right-side nodes, Allowed pairs as left right, comma separated. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Maximum bipartite cardinality matching?
Left-side nodes = 3; Right-side nodes = 3; Allowed pairs as left right, comma separated = 1 1, 1 2, 2 1, 3 2, 3 3. Maximum matched pairs: 3 Selected pairs: 2 ↔ 1; 1 ↔ 2; 3 ↔ 3 The selected edges pair all three left-side nodes with distinct right-side nodes; the displayed assignment is one maximum-cardinality solution.
Method reference: NetworkX graph algorithm definitions.
Read our calculation methodology.