distanceFunction
Class RandomDistanceFunctions

java.lang.Object
  extended by distanceFunction.RandomDistanceFunctions

public class RandomDistanceFunctions
extends java.lang.Object

This class provides the methods which will be used to create random distance functions.

Author:
Sepp Hartung

Constructor Summary
RandomDistanceFunctions()
           
 
Method Summary
static int[][] getDerangedUltrametric(int[][] distance, int maxDistValue, int variations)
          Derange the given distance function (uniform distribution).
static int[][] getRandomDistanceFunction(int n, int maxDistValue, int variations)
          Returns a random distance functions which is build by a derangement of an ultrametric.
static int[][] getUltrametric(int n, int maxDistValue)
          Returns a random ultrametric.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RandomDistanceFunctions

public RandomDistanceFunctions()
Method Detail

getRandomDistanceFunction

public static int[][] getRandomDistanceFunction(int n,
                                                int maxDistValue,
                                                int variations)
Returns a random distance functions which is build by a derangement of an ultrametric.

Parameters:
n - number of nodes
maxDistValue -
variations -
Returns:

getDerangedUltrametric

public static int[][] getDerangedUltrametric(int[][] distance,
                                             int maxDistValue,
                                             int variations)
Derange the given distance function (uniform distribution).

Parameters:
distance - distance function
maxDistValue - range of distance values
variations - number of places which will be deranged
Returns:

getUltrametric

public static int[][] getUltrametric(int n,
                                     int maxDistValue)
Returns a random ultrametric.

Parameters:
n - number of nodes
maxDistValue - distance value range [1..maxDistValue]
Returns: