Add IDs to

19 views
Skip to first unread message

Thomas Balstrøm

unread,
Jan 19, 2023, 2:53:33 PM1/19/23
to networkx-discuss
Hi you clever people out there,

I use this Pyhon statement to identify edges in a directed graph, G, from a set of nodes and searching the graph in reversed order: 

EdgeList = list(nx.edge_dfs(G,nodes,orientation='reverse'))

When doing so, all edges belong to the same class. 

Meanwhile, what I need is to subdivide the result, so the edges are assigned various class values in accordance with the attached picture. Thus, all edges found by a reversed search from node 1 (blue edges) are assigned a class value of 1 matching the node number, and what is found by a reversed search from node 2 (green edges) but leaving out the blue edges already found in class 1 are assigned a value of 2.

Do you have a solution to this problem?

Best regards,
Thomas Balstroem,
Univ. of Copenhagen, Denmark


Image2.tif
Reply all
Reply to author
Forward
0 new messages