Skip to content

0.5.17

Compare
Choose a tag to compare
@scottpdo scottpdo released this 06 Feb 14:38
· 42 commits to main since this release

Network Improvements

Adds a few new features to Networks to power network analysis. (Thanks, Complex Networks Winter Workshop!)

  • Network.clusteringCoefficient(agent): Calculates the clustering coefficient for an agent in the network. The clustering coefficient is a measure of how connected this agent's neighbors are (i.e. how much of a 'cluster' it is a part of). If all of the agent's neighbors are also connected to each other, this will be 1, and if none of them are connected to each other, it will be 0.
  • Network.clusteringCoefficient(): Calling this method with no parameters returns the global clustering coefficient, a value between 0 and 1
  • Network.averageClusteringCoefficient(): The average clustering coefficient is another global measure, although it differs from the global clustering coefficient.

This also adds a new helper class Array2D, which is a thin wrapper around NumArray to handle 2-dimensional arrays. Under the hood, Networks now include both adjacency list and adjacency matrix representations, the latter being an Array2D of 0s and 1s.