BitGraph.Algorithms.Matching.Kuhn (bitgraph v0.1.7)

Maximum Matching for bipartite graph (Kuhn algorithm). Implementation mostly follows https://cp-algorithms.com/graph/kuhn_maximum_bipartite_matching.html

Summary

Functions

graph - bipartite graph. left_partition list or set of vertices that represent either part of graph.

Functions

get_matching_count(state)

run(graph, left_partition, opts \\ [])

@spec run(BitGraph.t(), MapSet | list(), Keyword.t()) :: map() | nil

graph - bipartite graph. left_partition list or set of vertices that represent either part of graph.

Options:

  • :fixed_matching (optional) - The edges that have to be in matching. This is a left_vertex => right vertex , where left_vertex is a vertex from left_partition
  • :required_size (optional) - The required size of maximum matching. If not reached, algorithm returns nil