Ask Your Question

Revision history [back]

sage: G = Graph([(1,2),(2,3),(3,4),(4,5)])
sage: H = Graph([(1,2),(4,5)])
sage: G_minus_H = G.copy()
sage: G_minus_H.delete_edges(H.edges())
sage: G_minus_H.vertices()
[1, 2, 3, 4, 5]
sage: G_minus_H.edges(labels=False)
[(2, 3), (3, 4)]