Ask Your Question

Revision history [back]

G.matching() returns a list of edges, so you can do:

sage: G = graphs.PetersenGraph()
sage: G.order(), G.size()
(10, 15)
sage: M = G.matching()
sage: G.delete_edges(M)
sage: G.order(), G.size()
(10, 10)