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.


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.
 Graph 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
 

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 Graph 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.

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

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)