Search this API

y.algo
Interface Groups.Distances

Enclosing class:
Groups

public static interface Groups.Distances

An interface that determines the distance between two nodes of a graph.

It is used by the hierarchical clustering algorithm in order to determine the distance between any two nodes of a graph.

See Also:
Groups.hierarchicalClustering(Graph, int, NodeMap, Distances, byte), Groups.hierarchicalClustering(Graph, NodeMap, Distances, byte, double), Groups.hierarchicalClustering(Graph, Distances, byte)
 

Method Summary
 double getDistance(Node n1, Node n2)
          Returns the distance between two given nodes of a graph.
 

Method Detail

getDistance

double getDistance(Node n1,
                   Node n2)
Returns the distance between two given nodes of a graph.

Implementations of this method have to guarantee that the returned value is greater or equal to zero. Furthermore, the distances between two nodes have to be symmetric, i.e., the distance between node n1 and n2 is equal to the distance between node n2 and n1.

Parameters:
n1 - the first node
n2 - the second node
Returns:
the distance between the two given nodes

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.