at.tuwien.ifs.somtoolbox.visualization.minimumSpanningTree
Class Graph

java.lang.Object
  extended by at.tuwien.ifs.somtoolbox.visualization.minimumSpanningTree.Graph
Direct Known Subclasses:
InputdataGraph, SomGraph

public abstract class Graph
extends java.lang.Object

Version:
$Id: Graph.java 3883 2010-11-02 17:13:23Z frank $
Author:
Thomas Kern, Magdalena Widl, Rudolf Mayer

Field Summary
protected  java.util.TreeMap<Node,java.util.LinkedList<Edge>> adjList
           
protected  java.util.ArrayList<Edge> edges
           
protected  GrowingSOM gsom
           
protected  double maximumEdgeWeight
           
static L2Metric metric
           
protected  double minimumEdgeWeight
           
protected  java.util.List<Edge> mst
           
 
Constructor Summary
Graph(GrowingSOM gsom)
           
 
Method Summary
protected abstract  java.util.List<Edge> calculateEdge()
           
protected  int[] computeLineThickness(Edge e, int unitWidth, int unitHeight, boolean weighting)
           
protected  void connectTwoNodes(Unit unit, java.util.HashMap<Unit,Unit> hm, Unit neighbour)
           
protected abstract  void createNodes(Unit[] units)
           
abstract  void drawLine(java.awt.Graphics2D g, int unitWidth, int unitHeight, Edge e, boolean weighting)
           
 double getMaximumEdgeWeight()
           
 double getMinimumEdgeWeight()
           
 java.util.List<Edge> getMinimumSpanningTree()
           
protected abstract  java.util.ArrayList<Unit> getNeighbours(int horIndex, int verIndex, Unit[][] units)
           
protected  Node getNode(java.lang.String label)
           
protected  void insert(Node u, Node v, double w)
           
protected  java.util.List<Edge> kruskalMST()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

metric

public static L2Metric metric

adjList

protected java.util.TreeMap<Node,java.util.LinkedList<Edge>> adjList

edges

protected java.util.ArrayList<Edge> edges

gsom

protected GrowingSOM gsom

mst

protected java.util.List<Edge> mst

maximumEdgeWeight

protected double maximumEdgeWeight

minimumEdgeWeight

protected double minimumEdgeWeight
Constructor Detail

Graph

public Graph(GrowingSOM gsom)
Method Detail

calculateEdge

protected abstract java.util.List<Edge> calculateEdge()

connectTwoNodes

protected void connectTwoNodes(Unit unit,
                               java.util.HashMap<Unit,Unit> hm,
                               Unit neighbour)

createNodes

protected abstract void createNodes(Unit[] units)

drawLine

public abstract void drawLine(java.awt.Graphics2D g,
                              int unitWidth,
                              int unitHeight,
                              Edge e,
                              boolean weighting)

getMinimumSpanningTree

public java.util.List<Edge> getMinimumSpanningTree()

getNeighbours

protected abstract java.util.ArrayList<Unit> getNeighbours(int horIndex,
                                                           int verIndex,
                                                           Unit[][] units)

getNode

protected Node getNode(java.lang.String label)

insert

protected void insert(Node u,
                      Node v,
                      double w)

kruskalMST

protected java.util.List<Edge> kruskalMST()

computeLineThickness

protected int[] computeLineThickness(Edge e,
                                     int unitWidth,
                                     int unitHeight,
                                     boolean weighting)

getMaximumEdgeWeight

public double getMaximumEdgeWeight()
Returns:
Returns the maximum edge weight (maximumEdgeWeight)

getMinimumEdgeWeight

public double getMinimumEdgeWeight()
Returns:
Returns the minimum edge weight (minimumEdgeWeight)