and 1 contributors

# NAME

Graph::Statistics - Perl extension for calculating network constraint and other network statistics.

# SYNOPSIS

``````  use Graph::Statistics ':all';

# create hash representing graph
my %g;
foreach \$f ( qw( a b c ) ) {
foreach \$t ( qw( a b c ) ) {
next if \$f eq \$t;
\$g{\$f}{\$t} = rand();
}
}

# every time the network changes and before calculations
# not needed if you are only creating the graph once
flushCache();

# print out Burt network constraint value for each node
foreach \$f ( keys %g ) {
print "\$f,", constraint(\%g,\$f), "\n";
}

# print out Coleman-Theil disorder index for each node
foreach \$f ( keys %g ) {
print "\$f,", CTdi(\%g,\$f), "\n";
}``````

# DESCRIPTION

Calculates Burt's network constraint value on nodes within a hash based network representation. An earlier version (not public) was based on Graph, but that was too slow for networks of size.

## Methods

• constraint(hashreference, nodeidentifier)

returns the network constraint

• c(hash reference, node identifier a, node identifier b)

the portion of the network constraint on a by b.

• p(hash reference, node identifier a, node identifier b)

the portion of the value ab of the total weights of edges from a.

• flushCache()

clears an internal cache used to speed everything up.

• CTdi(hash reference, node identifier)

Coleman-Theil disorder index. A measure of diversity of neighbor nodes.

# AUTHOR

Erich S. Morisse, <emorisse@cpan.org>