Class CommunityDistribution

java.lang.Object
org.graphstream.stream.SinkAdapter
org.graphstream.algorithm.measure.CommunityMeasure
org.graphstream.algorithm.measure.CommunityDistribution
All Implemented Interfaces:
Algorithm, DynamicAlgorithm, org.graphstream.stream.AttributeSink, org.graphstream.stream.ElementSink, org.graphstream.stream.Sink

public class CommunityDistribution
extends CommunityMeasure
Provides some statistical information on the size of current community assignment on the specified graph as it evolves.
Author:
Guillaume-Jean Herbiet
  • Constructor Details

    • CommunityDistribution

      public CommunityDistribution​(String marker)
      New size distribution measure using the specified marker as attribute name for the community assignment.
      Parameters:
      marker - Attribute name for the community assignment.
  • Method Details

    • compute

      public void compute()
      Computes and update the statistical information on size distribution.
      Specified by:
      compute in interface Algorithm
      Specified by:
      compute in class CommunityMeasure
      See Also:
      Algorithm.init(Graph)
      Computational Complexity :
      O(C), where C is the expected number of communities.
    • number

      public int number()
      Get the number of communities
      Returns:
      an int representing the current number of communities
    • biggestCommunity

      public Object biggestCommunity()
      Get the biggest generated community
      Returns:
      the biggest community
    • smallestCommunity

      public Object smallestCommunity()
      Get the smallest generated community
      Returns:
      the smallest community
    • maxCommunitySize

      public int maxCommunitySize()
      Get the maximum community size
      Returns:
      an int reflecting the size of the biggest community
    • minCommunitySize

      public int minCommunitySize()
      Get the minimum community size
      Returns:
      an int reflecting the size of the smallest community
    • average

      public float average()
      Compute the average community size
      Returns:
      Average community size
    • stdev

      public float stdev()
      Compute the standard deviation of the community size
      Returns:
      Standard deviation of the community size
    • toString

      public String toString()
      Updates the distribution information and returns a string for an easy display of the results. The string has the following format: [number of communities] [average size] [stdev size] [min size] ([smallest community]) [max size] ([biggest community])
      Overrides:
      toString in class Object
      Returns:
      a String containing all computed distribution information.