at.tuwien.ifs.somtoolbox.visualization.clustering
Class SingleLinkageTreeBuilder

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.visualization.clustering.TreeBuilder
      extended by at.tuwien.ifs.somtoolbox.visualization.clustering.SingleLinkageTreeBuilder

public class SingleLinkageTreeBuilder
extends TreeBuilder

Single Linkage Clustering Algorithm. This is an adapted version only calculating the distances to the direct neighbours. This class is not compatible with mnemonic SOMs (and probably also not compatible with hierarchical SOMs)

Version:
$Id: SingleLinkageTreeBuilder.java 3938 2010-11-17 15:15:25Z mayer $
Author:
Angela Roiger

Field Summary
 
Fields inherited from class at.tuwien.ifs.somtoolbox.visualization.clustering.TreeBuilder
level, monitor, progress, progressWriter
 
Constructor Summary
SingleLinkageTreeBuilder()
           
 
Method Summary
private  TreeSet<NodeDistance> calculateNearestDistances(GeneralUnitPNode[][] units)
          Calculates the distances from each unit to its neighbours to the right, bottom and bottom-right.
 ClusteringTree createTree(GeneralUnitPNode[][] units)
          Calculation of the Clustering.
 String getClusteringAlgName()
           
 
Methods inherited from class at.tuwien.ifs.somtoolbox.visualization.clustering.TreeBuilder
allowAborting, finishMonitor, incrementMonitor, resetMonitor, setMonitor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingleLinkageTreeBuilder

public SingleLinkageTreeBuilder()
Method Detail

createTree

public ClusteringTree createTree(GeneralUnitPNode[][] units)
                          throws ClusteringAbortedException
Calculation of the Clustering. This code is only compatible with rectangular, non hierarchical SOMs!

Specified by:
createTree in class TreeBuilder
Parameters:
units - the GeneralUnitPNode Array containing all the units of the SOM
Returns:
the ClusteringTree (i.e. the top node of the tree)
Throws:
ClusteringAbortedException

calculateNearestDistances

private TreeSet<NodeDistance> calculateNearestDistances(GeneralUnitPNode[][] units)
                                                 throws ClusteringAbortedException
Calculates the distances from each unit to its neighbours to the right, bottom and bottom-right.

Parameters:
units - A GeneralUnitPNode[][] containing the Units of the som
Returns:
a TreeSet of NodeDistances containing the distances between the units starting with the smallest.
Throws:
ClusteringAbortedException

getClusteringAlgName

public String getClusteringAlgName()
Specified by:
getClusteringAlgName in class TreeBuilder