Ask Your Question
1

convert from networkx to sage

asked 8 years ago

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

plz hep i am new user in sage,,, how to i use one networkx function in sage

from networkx import algebraic_connectivity as AlgebraicConnectivity........? AlgebraicConnectivity(sage.Graph)

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 8 years ago

tmonteil gravatar image

If G is your Sage graph, you can turn it into a networkx graph with the networkx_graph as in the following example:

sage: from networkx import algebraic_connectivity as AlgebraicConnectivity

sage: G = graphs.PetersenGraph()
sage: H = G.networkx_graph()
sage: AlgebraicConnectivity(H)
1.9999999999999993

sage: G = graphs.CompleteGraph(12)
sage: H = G.networkx_graph()
sage: AlgebraicConnectivity(H)
11.999999999999998
Preview: (hide)
link

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: 8 years ago

Seen: 557 times

Last updated: Jul 21 '16