Note that that code only works for graphs whose vertices are labeled [0...n].
On Wed, Mar 20, 2013 at 1:03 PM, Tom Boothby <tomas.boot...@gmail.com> wrote: > I use the following to iterate over all matchings and perfect matchings. > > def matchings(G): > edges = G.edges(labels = False) > verts = [[v] for v in G] > m = len(edges) > for match in DLXCPP(edges+verts): > yield [edges[t] for t in match if t < m] > > def perfect_matchings(G): > edges = G.edges(labels = False) > for match in DLXCPP(edges): > yield [edges[t] for t in match] -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To post to this group, send email to sage-support@googlegroups.com. Visit this group at http://groups.google.com/group/sage-support?hl=en. For more options, visit https://groups.google.com/groups/opt_out.