Skip to content

Node betweenness is negative for big graphs when normalized #2139

Closed
@wackyworm

Description

For big graphs, more than 50K nodes, the betweenness value is negative and incorrect when normalized because of integer overflow in this line:

nodeBetweenness[s_index] /= directed ? (n - 1) * (n - 2) : (n - 1) * (n - 2) / 2;

(n - 1) * (n - 2) is bigger than integer max value for n > 50K, producing negative numbers

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions