org.graphstream.algorithm.measure
Class CommunityDistribution

java.lang.Object
  extended by org.graphstream.stream.SinkAdapter
      extended by org.graphstream.algorithm.measure.CommunityMeasure
          extended by 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 Summary
CommunityDistribution(String marker)
          New size distribution measure using the specified marker as attribute name for the community assignment.
 
Method Summary
 float average()
          Compute the average community size
 Object biggestCommunity()
          Get the biggest generated community
 void compute()
          Run the algorithm.
 int maxCommunitySize()
          Get the maximum community size
 int minCommunitySize()
          Get the minimum community size
 int number()
          Get the number of communities
 Object smallestCommunity()
          Get the smallest generated community
 float stdev()
          Compute the standard deviation of the community size
 String toString()
          Updates the distribution information and returns a string for an easy display of the results.
 
Methods inherited from class org.graphstream.algorithm.measure.CommunityMeasure
edgeAdded, edgeRemoved, getLastComputedValue, getMeasure, graphCleared, init, nodeAdded, nodeAttributeAdded, nodeAttributeChanged, nodeRemoved, terminate
 
Methods inherited from class org.graphstream.stream.SinkAdapter
edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, nodeAttributeRemoved, stepBegins
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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 Detail

compute

public void compute()
Description copied from interface: Algorithm
Run the algorithm. The Algorithm.init(Graph) method has to be called before computing.

Specified by:
compute in interface Algorithm
Specified by:
compute in class CommunityMeasure
See Also:
Algorithm.init(Graph)

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.


Copyright © 2011. All Rights Reserved.