Ask Your Question
1

Induce a subgraph by indecies method?

asked 2018-12-27 15:37:37 +0100

RushBack gravatar image

Isn't there a method to induce a sub-graph by its indices?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-12-27 19:55:05 +0100

tmonteil gravatar image

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]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2018-12-27 15:37:37 +0100

Seen: 171 times

Last updated: Dec 27 '18