Graph::NewmanGirvan - Newman-Girvan Graph node clustering
use Graph::NewmanGirvan 'newman_girvan'; use Graph::Undirected; my $g = Graph::Undirected->new; $g->add_weighted_edge('a', 'b', 0.3); ... my %vertex_to_cluster = newman_girvan($g);
The newman_girvan sub takes a Graph object and computes clusters for each vertex in the graph. The implementation is a quick and dirty port of the code in Andreas Noack's linloglayout utility, tested only with graphs with edges with edge weights greater than zero. Should work with directed and undirected graphs. The function newman_girvan_r is a convenience wrapper for newman_girvan that returns a hash with the cluster identifiers as keys and array references of vertices as values.
newman_girvan
newman_girvan_r
The functions newman_girvan and newman_girvan_r on request, none by default.
http://code.google.com/p/linloglayout/
Copyright (c) 2011 Bjoern Hoehrmann <bjoern@hoehrmann.de>. This module is licensed under the same terms as linloglayout. Uses code from linloglayout Copyright (C) 2008 Andreas Noack.
To install Graph::NewmanGirvan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Graph::NewmanGirvan
CPAN shell
perl -MCPAN -e shell install Graph::NewmanGirvan
For more information on module installation, please visit the detailed CPAN module installation guide.