Skip to content

Fast Algorithm for Finding Community Structure (migrated from Trac #245) #245

Closed

Description

@networkx-trac

Original ticket https://networkx.lanl.gov/trac/ticket/245
Reported 2009-06-17 by trac user dcurtis, assigned to @chebee7i.

Here is a version of the algorithm from "Finding community structure in very large networks" by Aaron Clauset, M.E.J. Newman, and Cristopher Moore.

I think there are some things I could probably do better but the algorithm is pretty intensive. If there was a maxheapq structure in Python it might save some time. Any improvements I'd love to see. It's not simple, consult the paper if you're curious why I did what I did.

One thing that I do that's somewhat crazyish is that I am building a dendrogram of the process. Thus, each node is actually a tuple containing what are supposed to be communities. In the end you'd have a single root node that is all communities as one.

The authors do provide a version of this written in C but of course they have lots of fun stuff to do because they don't have the Python datastructures. However, theirs runs faster. With that said, I did test my algorithm and it gives identical results.

Activity

  1. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Attachment in Trac by trac user dcurtis, 2009-06-17: fastcommunity.py

  2. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Comment in Trac by trac user dcurtis, 2009-06-17

  3. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Comment in Trac by @chebee7i, 2009-06-18

    I'll try to take a look at this in the next day or so. You mentioned that you had performed tests to known values. Can you attach those tests?

  4. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Comment in Trac by @hagberg, 2010-09-06

  5. networkx-trac commented on Jul 20, 2012

    @networkx-trac
    Author

    Attachment in Trac by zhanghaisu, 2011-03-10: fastcommunity_modified.py

  6. jyswpp commented on Mar 31, 2014

    @jyswpp

    I have a question about an equation in fastcommunity.py. In line 55 is the equation

    dqr[(neighbor,)] = 2*(1.0/(2 * m) - (ki * kj)/((2.0*m)**2))
    

    but in the paper,

    Qij=1.0/(2 * m) - (ki * kj)/((2.0*m)**2)
    
  7. hagberg commented on Nov 24, 2017

    @hagberg
    Member

    Closed due to inactivity.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions