First time here? Check out the FAQ!

Ask Your Question
-1

NetworkX - create a Graph

asked 11 years ago

mresimulator gravatar image

updated 8 years ago

FrédéricC gravatar image

Hi experts!

I wanna use

networkx.has_path(G)

where G is the graph associated to de adjacency matrix M (a N x N numpy array) of a undirected graph.

How can I create a networkx graph (necesary for use networkx.has_path()) from M?

Thanks a lot!

Preview: (hide)

Comments

1

You should probably use Sage objects directly (i.e. a `matrix` instead of a numpy array, and a `Graph` instead of a NetworkX object), since there are better interfaced to eachother, and you will not have to rewrite everything.

tmonteil gravatar imagetmonteil ( 11 years ago )

For the record, a Sage graph has a method that returns the corresponding NetworkX graph.

Hugh Thomas gravatar imageHugh Thomas ( 7 years ago )

1 Answer

Sort by » oldest newest most voted
-2

answered 11 years ago

mresimulator gravatar image

A networkx graph is necesary for use networkx.has_path().

So, how can I generate this networkx graph from a python matrix or numpy matrix?

Thanks

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

Seen: 562 times

Last updated: Sep 06 '13