How to extract mutually disjoint perfect matchings?

24 views
Skip to first unread message

Phoenix

unread,
Jun 9, 2015, 12:45:17 PM6/9/15
to sage-s...@googlegroups.com

Say I have a K_{n,n} and from it I want to extract d mutually disjoint perfect matchings.

How can this be done?

Hopefully the result can be obtained as a list of list of edges where each edge is given an integer 2-tuple corresponding to the vertices that this edge connects.

Nathann Cohen

unread,
Jun 9, 2015, 1:47:51 PM6/9/15
to sage-s...@googlegroups.com
Say I have a K_{n,n} and from it I want to extract d mutually disjoint perfect matchings.

How can this be done?

Phoenix

unread,
Jun 9, 2015, 1:51:12 PM6/9/15
to sage-s...@googlegroups.com


Didn't get you. Can you explain a bit more?

Vincent Delecroix

unread,
Jun 9, 2015, 2:15:01 PM6/9/15
to sage-s...@googlegroups.com
If you follow the link then you can read

If vizing=True and value_only=False, return a partition of the edge set
into Δ+1 matchings.

Isn't that clear enough?

Nathann Cohen

unread,
Jun 9, 2015, 2:50:51 PM6/9/15
to Sage Support
> Didn't get you. Can you explain a bit more?

A partition of the edges of a graph into disjoint matchings is called
an edge-coloring. With the function I gave you, you can compute an
edge-coloring of your graph which, because that graph is a K_{n,n},
will be a collection of disjoint perfect matchings.

Note that it may be a bit slow. You have a faster way to obtain what
you desire with:

sage: n=5;designs.transversal_design(2,n,resolvable=True)._classes
[[[0, 5], [1, 6], [2, 7], [3, 8], [4, 9]],
[[0, 6], [1, 7], [2, 8], [3, 9], [4, 5]],
[[0, 7], [1, 8], [2, 9], [3, 5], [4, 6]],
[[0, 8], [1, 9], [2, 5], [3, 6], [4, 7]],
[[0, 9], [1, 5], [2, 6], [3, 7], [4, 8]]]

What you see is a list of [list of pairs], and each [list of pairs] is
a perfect matching in graphs.CompleteBipartiteGraph(n,n). They are all
disjoint.

Nathann

Phoenix

unread,
Jun 11, 2015, 11:25:19 AM6/11/15
to sage-s...@googlegroups.com

Thanks.
Reply all
Reply to author
Forward
0 new messages