Compute a maximum-weighted matching of G.
A matching is a subset of edges in which no node occurs more than once. The cardinality of a matching is the number of matched edges. The weight of a matching is the sum of the weights of its edges.
Parameters : | G : NetworkX graph
maxcardinality: bool, optional :
|
---|---|
Returns : | mate : dictionary
|
Notes
If G has edges with ‘weight’ attribute the edge data are used as weight values else the weights are assumed to be 1.
This function takes time O(number_of_nodes ** 3).
If all edge weights are integers, the algorithm uses only integer computations. If floating point weights are used, the algorithm could return a slightly suboptimal matching due to numeric precision errors.
References
[R182] | “Efficient Algorithms for Finding Maximum Matching in Graphs” by Zvi Galil, ACM Computing Surveys, 1986. |