First time here? Check out the FAQ!
answered 6 years ago
You can use the subgraph method, the indices are kept untouched:
sage: G = graphs.PetersenGraph() sage: G.subgraph([1,2,4,5]) Subgraph of (Petersen graph): Graph on 4 vertices sage: H = G.subgraph([1,2,4,5]) sage: H.vertices() [1, 2, 4, 5]