de.aitools.iv.graphdrawing.datastructures.graph.algorithms
Class KNearestNeighbor

java.lang.Object
  extended by de.aitools.iv.graphdrawing.datastructures.graph.algorithms.KNearestNeighbor
All Implemented Interfaces:
GraphProcedure

public class KNearestNeighbor
extends java.lang.Object
implements GraphProcedure

implements an algorithm to compute the k nearest neighbor graph of a weighted graph. NOTE: if the weight of the k-th edge occurs several times in the list of a node's incident edges (a tie), all these occurrences are treated as to be retained. TODO: Introduce tie-handling as an option.

Author:
tim.gollub@medien.uni-weimar.de

Field Summary
static int MUTUAL
           
static int NORMAL
           
 
Constructor Summary
KNearestNeighbor()
           
KNearestNeighbor(int k, int mode)
           
 
Method Summary
 void computeKNNGraph(WeightedGraph graph, int k)
           
 void computeMutualKNNGraph(WeightedGraph graph, int k)
           
 java.lang.Object execute(WeightedGraph g)
           
 void setProperties(int k, int mode)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MUTUAL

public static final int MUTUAL
See Also:
Constant Field Values

NORMAL

public static final int NORMAL
See Also:
Constant Field Values
Constructor Detail

KNearestNeighbor

public KNearestNeighbor()

KNearestNeighbor

public KNearestNeighbor(int k,
                        int mode)
Method Detail

setProperties

public void setProperties(int k,
                          int mode)

computeKNNGraph

public void computeKNNGraph(WeightedGraph graph,
                            int k)

computeMutualKNNGraph

public void computeMutualKNNGraph(WeightedGraph graph,
                                  int k)

execute

public java.lang.Object execute(WeightedGraph g)
Specified by:
execute in interface GraphProcedure