networkit icon indicating copy to clipboard operation
networkit copied to clipboard

Inconsistency between edge ID ordering and iterEdges()

Open mcogoni opened this issue 3 years ago • 3 comments

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

mcogoni avatar Nov 10 '21 08:11 mcogoni

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.

avdgrinten avatar Nov 11 '21 08:11 avdgrinten

For a start, I'd mention the necessity to call edgeID in the documentation...

mcogoni avatar Nov 11 '21 09:11 mcogoni

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!

Strato75 avatar Nov 11 '21 11:11 Strato75