org.graffiti.plugins.algorithms.HighDimEmbed
Class HighDimEmbedAlgorithm

java.lang.Object
  extended by org.graffiti.plugin.AbstractParametrizable
      extended by org.graffiti.plugin.algorithm.AbstractAlgorithm
          extended by org.graffiti.plugins.algorithms.HighDimEmbed.HighDimEmbedAlgorithm
All Implemented Interfaces:
Algorithm, Parametrizable

public class HighDimEmbedAlgorithm
extends AbstractAlgorithm

Author:
Harald Aigner A grapgh drawing algorithm based on Yehuda Koren�s method using 1) pivot node choosing by k-center-problem 2) hgh-dimensional embedding 3) reprojection into low-dimensional space by a) using the covariance matrix b) computing the eigenvectors 4) drawing graph along new axises represented by eigenvectors

Constructor Summary
HighDimEmbedAlgorithm()
          Constructs a new instance.
 
Method Summary
 Node calculateNewPivot(Map<Node,? extends Number> UsedNumsMin, Collection<Node> UsedNodes)
          calculate new Pivots by regarding the maximum distance of the minimum bfs or dijkstra-numbers ( ^= solve the k-center-problem approximation)
 void check()
          Checks whether all preconditions of the current graph are satisfied.
 HashMap<Node,Integer> enumerateNodes(Collection<Node> UsedNodes)
          identifies the calculated nodes with an Integer
 void execute()
          Executes the whole algorithm.
 Parameter<?>[] getAlgorithmParameters()
           
 String getName()
          Returns the name (id) of this Parametrizable.
 void printMatrix(String Name, double[][] HighEmbMatrix, int m, int n, int length)
          print the Matrix on System.out nad in an Exception (optional)
 void setAlgorithmParameters(Parameter<?>[] params)
           
 void setLabels(Collection<Node> Nodes, String label)
          set the labels of the nodes in graph/
 
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
attach, getAnimation, reset, supportsAnimation
 
Methods inherited from class org.graffiti.plugin.AbstractParametrizable
copyParameters, getDefaultParameters, getParameters, getUserParameters, saveUserParameters, saveUserParameters, setParameters
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getParameters, setParameters
 

Constructor Detail

HighDimEmbedAlgorithm

public HighDimEmbedAlgorithm()
Constructs a new instance.

Method Detail

getName

public String getName()
Description copied from interface: org.graffiti.plugin.Parametrizable
Returns the name (id) of this Parametrizable.

Returns:
DOCUMENT ME!
See Also:
Parametrizable.getName()

setAlgorithmParameters

public void setAlgorithmParameters(Parameter<?>[] params)
Overrides:
setAlgorithmParameters in class AbstractParametrizable
See Also:
AbstractParametrizable.setAlgorithmParameters(Parameter[])

getAlgorithmParameters

public Parameter<?>[] getAlgorithmParameters()
Overrides:
getAlgorithmParameters in class AbstractParametrizable
See Also:
AbstractParametrizable.getAlgorithmParameters()

check

public void check()
           throws PreconditionException
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Checks whether all preconditions of the current graph are satisfied.

Specified by:
check in interface Algorithm
Overrides:
check in class AbstractAlgorithm
Throws:
PreconditionException - if the preconditions of the current graph are not satisfied.
See Also:
Algorithm.check()

execute

public void execute()
             throws RuntimeException
Description copied from interface: org.graffiti.plugin.algorithm.Algorithm
Executes the whole algorithm.

Throws:
RuntimeException
See Also:
Algorithm.execute()

printMatrix

public void printMatrix(String Name,
                        double[][] HighEmbMatrix,
                        int m,
                        int n,
                        int length)
                 throws RuntimeException
print the Matrix on System.out nad in an Exception (optional)

Parameters:
HighEmbMatrix - 2-D Matrix as a double[][]-array
m - Dimension m of mxn-Matrix
n - Dimension n of mxn-Matrix
Throws:
RuntimeException

enumerateNodes

public HashMap<Node,Integer> enumerateNodes(Collection<Node> UsedNodes)
identifies the calculated nodes with an Integer

Parameters:
UsedNodes - Collection that contains the calculated Dijkstra or BFS nodes
Returns:
Hashmap with "key = node", "value = ID"

calculateNewPivot

public Node calculateNewPivot(Map<Node,? extends Number> UsedNumsMin,
                              Collection<Node> UsedNodes)
calculate new Pivots by regarding the maximum distance of the minimum bfs or dijkstra-numbers ( ^= solve the k-center-problem approximation)

Parameters:
UsedNumsMin - The map of minimum current bfs or Dijkstra-numbers
UsedNodes - The Collection
Returns:
the new pivot node

setLabels

public void setLabels(Collection<Node> Nodes,
                      String label)
set the labels of the nodes in graph/

Parameters:
Nodes - Collection of Nodes to set labels
label - The new label as String


Generated at 2012-05-30 11:01:25 PM CEST