Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Networkx Information Centrality

I have a network graph which I want to calculate information centrality for. I used the networkx python package but had a problem.

My code is:

G = nx.read_edgelist('GraphEdge_2011.txt', create_using=nx.DiGraph, delimiter=",", nodetype=int) info = nx.information_centrality(G, weight=None, dtype='float', solver='lu')

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I got an error message: NetworkXNotImplemented: not implemented for directed type.

My graph shouldn’t have any direction. Why do I get this error message and how should I solve it?

Thanks a lot!

>Solution :

You created a directed graph using nx.DiGraph. You can make it an undirected graph by changing that to nx.Graph.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading