Ask Your Question
0

Graph.subgraph_search() obtaining the indices?

asked 2018-12-27 09:09:10 -0500

RushBack gravatar image

It is nice that Graph.subgraph_search() returns a subgraph, but I need the indices of the larger graph to manipulate it, for example finding the subgraph neighbors. Is there a way to obtain the original indices?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-12-27 16:51:31 -0500

tmonteil gravatar image

This is actually the case: the vertices are labelled the same way as in the larger graph, see:

sage: G = graphs.PetersenGraph()
sage: H = graphs.CycleGraph(6)
sage: G.subgraph_search(H)
Subgraph of (Petersen graph): Graph on 6 vertices
sage: G.subgraph_search(H).vertices()
[0, 1, 2, 3, 5, 8]
sage: G.subgraph_search(H).plot()
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

1 follower

Stats

Asked: 2018-12-27 08:56:10 -0500

Seen: 30 times

Last updated: Dec 27 '18