Search this API

Interface Groups.Distances

Enclosing class:

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


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.

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

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