sed_eval.util.event_matching.bipartite_match

sed_eval.util.event_matching.bipartite_match(graph)[source]

Find maximum cardinality matching of a bipartite graph (U,V,E). Function is borrowed from mir_eval toolbox (https://github.com/craffel/mir_eval).

The input format is a dictionary mapping members of U to a list of their neighbors in V. The output is a dict M mapping members of V to their matches in U.

Parameters:

graph : dictionary

The input bipartite graph. Each edge need only be specified once.

Returns:

matching : dictionary

A maximal bipartite matching.