networkit
networkit copied to clipboard
Inconsistency between edge ID ordering and iterEdges()
Hi, I was comparing the output of NetworkX and Networkit for EBC and I wasn't able to find anywhere in the docs the order in which edgeScores is written. After looking into the sources I found out that I should use the function edgeId to go from (origin, destination) to the edgeId. A much better solution would be to follow the same order produced by iterEdges() that sorts by origin node instead of destination node as followed by edgeId. A nice addition would be a ranking method for the EBC and not only for the BC, that way there would be no mistakes...
Maybe this issue is already clarified in the docs, but I really tried without success!
Thanks! marco
This issue has been reported before.
One possibility is guaranteeing that the edge ID ordering matches the iterEdges() ordering, but that is not done by the current implementation.
For a start, I'd mention the necessity to call edgeID in the documentation...
Hi @avdgrinten, maybe making the edgeScores()
method returns a dictionary where the key is a tuple (origin node, destination node) and the value the EBC could be a solution, what about it?
Also adding a method to the nxadapter
class to get the mapping between networkx and networkit nodes would be cool!