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 Summary
Constructors Constructor Description CommunityDistribution(String marker)
New size distribution measure using the specified marker as attribute name for the community assignment. -
Method Summary
Modifier and Type Method Description float
average()
Compute the average community sizeObject
biggestCommunity()
Get the biggest generated communityvoid
compute()
Computes and update the statistical information on size distribution.int
maxCommunitySize()
Get the maximum community sizeint
minCommunitySize()
Get the minimum community sizeint
number()
Get the number of communitiesObject
smallestCommunity()
Get the smallest generated communityfloat
stdev()
Compute the standard deviation of the community sizeString
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
-
Constructor Details
-
CommunityDistribution
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 interfaceAlgorithm
- Specified by:
compute
in classCommunityMeasure
- 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
Get the biggest generated community- Returns:
- the biggest community
-
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
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])
-