Skip to content

Ten community algorithms error on networks holding signs as negative weights #32

Description

@jhollway

A sweep of every exported function over fict_marvel found that ten community
detection algorithms abort when called directly on a signed network:

node_in_betweenness   Weights must be strictly positive
node_in_eigen         Negative weight in weight vector
node_in_fluid         Negative weight in weight vector
node_in_greedy        Weights must not be negative
node_in_infomap       Edge weights must not be negative
node_in_labels        Weights must not be negative
node_in_louvain       Weight vector must not be negative
node_in_optimal       Negative weights are not allowed in weight vector
node_in_walktrap      Weight vector must be non-negative
node_in_automorphic   Negative cycle detected while calculating shortest paths

node_in_community() no longer fails on these, because it now considers only
node_in_spinglass() where the network is signed (#25). Called directly,
however, each still aborts.

Why this is not settled by the treatment in #25

Neither branch of the signed treatment obviously applies:

  • .to_positive() is for measures of cohesion or distance. A community is not
    a distance, and dropping the negative ties discards exactly the hostility
    that should push two nodes into different communities.
  • .to_unsigned() reads each tie by its magnitude, which is right for a census
    but here would silently treat hostility as affinity.

node_in_spinglass() is the one algorithm that reads a sign as a sign, through
igraph's implementation = "neg" (Traag and Bruggeman 2009). That may be the
answer for the family: either route every signed call there, or say plainly in
each function that the algorithm cannot read signs and name the alternative.

Related to #25.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions