|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<O,R>
de.lmu.ifi.dbs.elki.algorithm.DistanceBasedAlgorithm<O,D,MultiResult>
de.lmu.ifi.dbs.elki.algorithm.clustering.SLINK<O,D>
O
- the type of DatabaseObject the algorithm is applied onD
- the type of Distance usedpublic class SLINK<O extends DatabaseObject,D extends Distance<D>>
Efficient implementation of the Single-Link Algorithm SLINK of R. Sibson.
Reference:
R. Sibson: SLINK: An optimally efficient algorithm for the single-link cluster method.
In: The Computer Journal 16 (1973), No. 1, p. 30-34.
Field Summary | |
---|---|
private HashMap<Integer,D> |
lambda
The values of the function Lambda of the pointer representation. |
private HashMap<Integer,D> |
m
The values of the helper function m to determine the pointer representation. |
private HashMap<Integer,Integer> |
pi
The values of the function Pi of the pointer representation. |
protected MultiResult |
result
Provides the result of the algorithm. |
private static AssociationID<Distance<?>> |
SLINK_LAMBDA
Association ID for SLINK lambda value |
private static AssociationID<Integer> |
SLINK_PI
Association ID for SLINK pi pointer |
Fields inherited from class de.lmu.ifi.dbs.elki.algorithm.DistanceBasedAlgorithm |
---|
DISTANCE_FUNCTION_ID, DISTANCE_FUNCTION_PARAM |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
SLINK()
Creates a new instance of a single link algorithm. |
Method Summary | |
---|---|
Description |
getDescription()
Returns a description of the algorithm. |
MultiResult |
getResult()
Returns the result of the algorithm. |
protected MultiResult |
runInTime(Database<O> database)
Performs the SLINK algorithm on the given database. |
private void |
step1(int newID)
First step: Initialize P(id) = id, L(id) = infinity. |
private void |
step2(int newID,
ArrayList<Integer> processedIDs)
Second step: Determine the pairwise distances from all objects in the pointer representation to the new object with the specified id. |
private void |
step3(int newID,
ArrayList<Integer> processedIDs)
Third step: Determine the values for P and L |
private void |
step4(int newID,
ArrayList<Integer> processedIDs)
Fourth step: Actualize the clusters if necessary |
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.DistanceBasedAlgorithm |
---|
getDistanceFunction, setParameters |
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm |
---|
isTime, isVerbose, run, setTime, setVerbose |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription |
Field Detail |
---|
private static final AssociationID<Integer> SLINK_PI
private static final AssociationID<Distance<?>> SLINK_LAMBDA
private HashMap<Integer,Integer> pi
private HashMap<Integer,D extends Distance<D>> lambda
private HashMap<Integer,D extends Distance<D>> m
protected MultiResult result
Constructor Detail |
---|
public SLINK()
Method Detail |
---|
protected MultiResult runInTime(Database<O> database) throws IllegalStateException
runInTime
in class AbstractAlgorithm<O extends DatabaseObject,MultiResult>
database
- the database to run the algorithm on
IllegalStateException
- if the algorithm has not been initialized
properly (e.g. the setParameters(String[]) method has been failed
to be called).public MultiResult getResult()
public Description getDescription()
private void step1(int newID)
newID
- the id of the object to be inserted into the pointer
representationprivate void step2(int newID, ArrayList<Integer> processedIDs)
newID
- the id of the object to be inserted into the pointer
representationprocessedIDs
- the already processed idsprivate void step3(int newID, ArrayList<Integer> processedIDs)
newID
- the id of the object to be inserted into the pointer
representationprocessedIDs
- the already processed idsprivate void step4(int newID, ArrayList<Integer> processedIDs)
newID
- the id of the current objectprocessedIDs
- the already processed ids
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |