0

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.

  • 1
    Welcome to stackoverflow! Unfortunately your question isn't really suited for SO. If you are looking for an algorithm that implements what you are looking for you may have some more luck on mathexchange or something more algorithmic centric. If you have a specific question to your code you should add the code that is relevant to your question. If you are looking for a library that solves your problem SO is also not the right place to ask, because it will probably not be helpful for further readers. It looks like networkx has no algorithm to give you **all** matchings. – syntonym Jul 21 '16 at 16:20
  • That sounds reasonable, thank you for your response. – Woodelson Jul 22 '16 at 17:11

0 Answers0