Skip to content

[BUG]: normalization issue in betweenness_centrality #4941

Open
@zmahoor

Description

@zmahoor

Version

24.10

Which installation method(s) does this occur on?

Conda

Describe the bug.

the normalized values in betweenness_centrality seem to be incorrect when k=cudf.Series. the normalized values are not between [0, 1] and also are different from the values we get from networkx.

Minimum reproducible example

import cugraph
import cudf
df = cudf.DataFrame(
      columns=["dst", "src"],
      data=[('A','i'),('B','A'),('C','B'),('E','C'),('D','E'),('D','A'),('i','D'),('C','D')]
      )

G = cugraph.Graph(directed=True)
G.from_cudf_edgelist(df, source='src', destination='dst')
bc = cugraph.betweenness_centrality(G, normalized=True, k=cudf.Series(["i"], dtype=object))
print(bc)

Relevant log output

betweenness_centrality vertex
0                     1.2      A
1                     0.3      D
2                     0.0      E
3                     0.3      B
4                     0.3      C
5                     0.0      i


the values we get from networkx are {'A': 1.0, 'B': 0.25, 'C': 0.25, 'E': 0, 'D': 0.25, 'i': 0}

Environment details

Other/Misc.

No response

Code of Conduct

  • I agree to follow cuGraph's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

? - Needs TriageNeed team to review and classifybugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions