So, I am relatively new to Python and programming in general. However, I have an undirected graph without weights. Some nodes are connected, some not. Some have just one connection, some will have multiple. Each node represents an individual that can be matched with another individual if their corresponding nodes are connected by an edge. I am interested in finding all maximum cardinality sets containing only pairwise matchings.
I startet by iterating over the nodes and immeditaley removing matchings. The code inflated pretty fast and got all messy. I was wondering if there is an easy and clean way to do it. I tried maximal_matching(G) from the package networkx but it always delivers just one matching.