python - Set of all pairwise matchings in an undirected, unweighted graph -


so, relatively new python , programming in general. however, have undirected graph without weights. nodes connected, not. have 1 connection, have multiple. each node represents individual can matched individual if corresponding nodes connected edge. interested in finding maximum cardinality sets containing pairwise matchings.

i startet iterating on nodes , immeditaley removing matchings. code inflated pretty fast , got messy. wondering if there easy , clean way it. tried maximal_matching(g) package networkx delivers 1 matching.


Comments