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 Object

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

Field Summary
protected  TreeMap<Node,LinkedList<Edge>> adjList
           
protected  ArrayList<Edge> edges
           
protected  GrowingSOM gsom
           
protected  double maximumEdgeWeight
           
static L2Metric metric
           
protected  double minimumEdgeWeight
           
protected  List<Edge> mst
           
 
Constructor Summary
Graph(GrowingSOM gsom)
           
 
Method Summary
protected abstract  List<Edge> calculateEdge()
           
protected  int[] computeLineThickness(Edge e, int unitWidth, int unitHeight, boolean weighting)
           
protected  void connectTwoNodes(Unit unit, HashMap<Unit,Unit> hm, Unit neighbour)
           
protected abstract  void createNodes(Unit[] units)
           
abstract  void drawLine(Graphics2D g, int unitWidth, int unitHeight, Edge e, boolean weighting)
           
 double getMaximumEdgeWeight()
           
 double getMinimumEdgeWeight()
           
 List<Edge> getMinimumSpanningTree()
           
protected abstract  ArrayList<Unit> getNeighbours(int horIndex, int verIndex, Unit[][] units)
           
protected  Node getNode(String label)
           
protected  void insert(Node u, Node v, double w)
           
protected  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 TreeMap<Node,LinkedList<Edge>> adjList

edges

protected ArrayList<Edge> edges

gsom

protected GrowingSOM gsom

mst

protected List<Edge> mst

maximumEdgeWeight

protected double maximumEdgeWeight

minimumEdgeWeight

protected double minimumEdgeWeight
Constructor Detail

Graph

public Graph(GrowingSOM gsom)
Method Detail

calculateEdge

protected abstract List<Edge> calculateEdge()

connectTwoNodes

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

createNodes

protected abstract void createNodes(Unit[] units)

drawLine

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

getMinimumSpanningTree

public List<Edge> getMinimumSpanningTree()

getNeighbours

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

getNode

protected Node getNode(String label)

insert

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

kruskalMST

protected 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)