python - Is there any function that returns the out edges of a node? -
I am using Python with Network X package. I have to find the nodes associated with the edges of the given node. I know that there is a function network. DIGROUGH_A_AUGES but it returns the edges to the entire graph.
I'm not a network x expert, but have you tried, have specified the source node ?
DiGraph.out_edges (nbunch = None, data = false)
Return a list of edges.
The edges are returned in the form of tuples with alternate data (node, neighboring, data) in sequence.
If you want external edges for just one node, pass that node inside the node:
graph.out_edges ([my_node] )
Comments
Post a Comment