y.layout.labeling
Class SALabeling

java.lang.Object
  |
  +--y.layout.AbstractLayoutStage
        |
        +--y.layout.labeling.AbstractLabelingAlgorithm
              |
              +--y.layout.labeling.MISLabelingAlgorithm
                    |
                    +--y.layout.labeling.SALabeling
All Implemented Interfaces:
Layouter, LayoutStage

public class SALabeling
extends MISLabelingAlgorithm

This class places the labels of a graph using a simulated annealing strategy. This algorithm is slower than the greedy-strategy but achieves in general better results. The algorithm is inspired by the article of Christensen, Marks and Shieber.


Field Summary
 
Fields inherited from class y.layout.labeling.MISLabelingAlgorithm
conflictGraph, nodesToBoxes, nodesToID, showGraph
 
Fields inherited from interface y.layout.Layouter
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES
 
Constructor Summary
SALabeling()
           
 
Method Summary
protected  void createNodes(y.layout.labeling.Label[] labels)
          Overwrittes existing method to add the created nodes to an array.
protected  void iterate(y.layout.labeling.Label[] labels, Node[] solution)
          Perform simulated annealing.
protected  boolean iterateFast(y.layout.labeling.Label[] labels, Node[] solution, double t, int labelCount)
          Do the simulated annealing at a fixed temperature.
protected  boolean iterateSlow(y.layout.labeling.Label[] labels, Node[] solution, double t, int labelCount)
          Do the simulated annealing at a fixed temperature.
protected  boolean randomLayout(y.layout.labeling.Label[] labels, Node[] result)
          Computes a random start label assignment.
protected  NodeList solveMIS(y.layout.labeling.Label[] labels)
          Calculates labeling with simulated annealing.
 
Methods inherited from class y.layout.labeling.MISLabelingAlgorithm
assignProfit, createConflictGraph, createEdges, intersectionSL, label, propagateSolution
 
Methods inherited from class y.layout.labeling.AbstractLabelingAlgorithm
canLayout, doLayout, getPlaceEdgeLabels, getPlaceNodeLabels, getProfit, getRects, getRemoveEdgeOverlaps, getRemoveNodeOverlaps, getSelectionKey, isEdgeGroupOverlapAllowed, isStoreRects, label, label, label, removeEdgesOverlaps, removeNodesOverlaps, setEdgeGroupOverlapAllowed, setPlaceEdgeLabels, setPlaceNodeLabels, setProfitModel, setRemoveEdgeOverlaps, setRemoveNodeOverlaps, setSelection, setStoreRects
 
Methods inherited from class y.layout.AbstractLayoutStage
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SALabeling

public SALabeling()
Method Detail

solveMIS

protected NodeList solveMIS(y.layout.labeling.Label[] labels)
Calculates labeling with simulated annealing.

Specified by:
solveMIS in class MISLabelingAlgorithm

createNodes

protected void createNodes(y.layout.labeling.Label[] labels)
Overwrittes existing method to add the created nodes to an array.

Overrides:
createNodes in class MISLabelingAlgorithm

randomLayout

protected boolean randomLayout(y.layout.labeling.Label[] labels,
                               Node[] result)
Computes a random start label assignment.

Parameters:
labels - the list of labels to place
result - here the random solution is stored
Returns:
true if there are only empty candidate lists.

iterate

protected void iterate(y.layout.labeling.Label[] labels,
                       Node[] solution)
Perform simulated annealing.


iterateSlow

protected boolean iterateSlow(y.layout.labeling.Label[] labels,
                              Node[] solution,
                              double t,
                              int labelCount)
Do the simulated annealing at a fixed temperature. This is the slow code using global calculation of the objective function at each step.

Parameters:
t - the temperature

iterateFast

protected boolean iterateFast(y.layout.labeling.Label[] labels,
                              Node[] solution,
                              double t,
                              int labelCount)
Do the simulated annealing at a fixed temperature. This is the fast code using local calculation of the objective function at each step.

Parameters:
t - the temperature

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003