Skip to content

@graphty/algorithms / index / greedyBipartiteMatching

Function: greedyBipartiteMatching() ​

greedyBipartiteMatching(graph, options): BipartiteMatchingResult

Defined in: algorithms/matching/bipartite.ts:118

Simple greedy bipartite matching algorithm Useful for comparison or when Hopcroft-Karp is overkill

Parameters ​

graph ​

Graph

The bipartite graph to find matching for

options ​

BipartiteMatchingOptions = {}

Optional configuration including left and right node partitions

Returns ​

BipartiteMatchingResult

The matching as a map from left nodes to right nodes and the matching size

Throws ​

Error if the graph is not bipartite