networkx/networkx — pull request #1051 by FedericoV (2014-01-28 11:23:25+00:00)
Title: Linear Algebra Directed Clustering

This PR adds a clustering coefficient measure for directed graph. Currently, this PR uses the adjacency matrix representation to calculate clustering coefficient, and as such, it leverages numpy to do all the calculations and sits in the linear algebra module. Using numpy, it's possible to write the formula in a manner very similar to that used in the original reference.

I also added two tests to show that in the undirected case, the module gives the same answer as the clustering coefficient function already present in networkx.

Possible improvements to this PR include the use of sparse matrix throughout, which however would preclude the use of syntax mirroring that of the paper.