You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to networkx...@googlegroups.com
Hi everybody,
I've just started to use networkx and when checked the documentation I could not find whether there is an algorithm to count the number bidirectional edges between nodes. For example:
>>> import networkx as nx >>> G = nx.DiGraph() >>> G.add_edges_from([(0,1),(1,0),(1,2)]) >>> G.size() # returns 3
it would expect to have 1 bidirectional node (0,1), (1,0).
Thanks in advance.
Jose
Dan Schult
unread,
Mar 7, 2014, 3:46:25 PM3/7/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to networkx...@googlegroups.com
There is no built-in method to count bidirectional edges in a DiGraph.
But you could build one quickly with something like:
0.5 * len( [ 1 for (u,v) in G.edges() if u in G[v] ] )