gr.demokritos.iit.jinsect.algorithms.clustering
Class SingleLinkClusterer

java.lang.Object
  extended by gr.demokritos.iit.jinsect.algorithms.clustering.SingleLinkClusterer
All Implemented Interfaces:
IClusterer
Direct Known Subclasses:
AverageLinkClusterer, CompleteLinkClusterer

public class SingleLinkClusterer
extends java.lang.Object
implements IClusterer

A single link clustering algorithm implementation class.


Field Summary
static java.lang.String CLUSTER_NAME_SEPARATOR
          The separator string between names of clusters in super-cluster labels.
 
Constructor Summary
SingleLinkClusterer()
          Creates a new instance of SingleLinkClusterer.
 
Method Summary
 void calculateClusters(java.util.Set sObjects, SimilarityComparatorListener clDistanceCalculator)
          A method clustering a set of objects, given a distance calculator upon pairs of these objects.
 UniqueVertexGraph getHierarchy()
          Returns the (calculated) hierarchy of the clusters.
protected  double getSimilarityBetweenClusters(java.util.Set sClusterOne, java.util.Set sClusterTwo, SimilarityComparatorListener clDistanceCalculator)
          Calculates the similarity between two clusters.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLUSTER_NAME_SEPARATOR

public static final java.lang.String CLUSTER_NAME_SEPARATOR
The separator string between names of clusters in super-cluster labels.

See Also:
Constant Field Values
Constructor Detail

SingleLinkClusterer

public SingleLinkClusterer()
Creates a new instance of SingleLinkClusterer. No parameters required.

Method Detail

calculateClusters

public void calculateClusters(java.util.Set sObjects,
                              SimilarityComparatorListener clDistanceCalculator)
Description copied from interface: IClusterer
A method clustering a set of objects, given a distance calculator upon pairs of these objects.

Specified by:
calculateClusters in interface IClusterer
Parameters:
sObjects - The set of objects to cluster.
clDistanceCalculator - The similarity comparison event listener object, that actually performs the similarity calculation.

getHierarchy

public UniqueVertexGraph getHierarchy()
Description copied from interface: IClusterer
Returns the (calculated) hierarchy of the clusters. For non-hierarchical algorithms, there will be no edges in the graph. Every edge in the graph points from the child to the parent cluster.

Specified by:
getHierarchy in interface IClusterer
Returns:
The hierarchy as a UniqueVertexGraph.

getSimilarityBetweenClusters

protected double getSimilarityBetweenClusters(java.util.Set sClusterOne,
                                              java.util.Set sClusterTwo,
                                              SimilarityComparatorListener clDistanceCalculator)
Calculates the similarity between two clusters. In this algorithm the maximum similarity over all pairs of the two clusters is used.

Parameters:
sClusterOne - The first cluster.
sClusterTwo - The second cluster.
clDistanceCalculator - The calculator of distance between set elements.
Returns:
The similarity between the clusters.

main

public static void main(java.lang.String[] args)