|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.labeling.AbstractLabelingAlgorithm y.layout.labeling.MISLabelingAlgorithm y.layout.labeling.SALabeling
public class SALabeling
A generic labeling algorithm for placing the labels of a graph.
Node labels and edge labels placed by the labeling algorithm
This algorithm reduces the labeling problem to the maximum independent set (MIS) problem and solves the problem using simulated annealing. It is inspired by the article from Christensen, Marks and Shieber: A General Cartographic Labelling Algorithm.
Due to the simulated annealing technique, this implementation is able to generate highly optimized label assignments.
For difficult labeling instances, this algorithm will likely produce higher quality results
than the simpler GreedyMISLabeling
. This especially holds if the label models allow a large number
of different LabelCandidate
s, i.e., if there is a high potential for optimizations.
However, the runtime of this algorithm may be slower compared to that of GreedyMISLabeling
.
It is recommended to use EdgeLabelModel
s and NodeLabelModel
s which allow
free positioning of labels to achieve best results with this generic labeling algorithm. If possible,
SmartEdgeLabelModel
and SmartNodeLabelModel
are recommended.
This algorithm works according to the general labeling concept defined by AbstractLabelingAlgorithm
.
maximal duration
is set to 0
, this implementation
automatically switches to the simpler but faster GreedyMISLabeling
.AbstractLabelingAlgorithm
Field Summary |
---|
Fields inherited from class y.layout.labeling.MISLabelingAlgorithm |
---|
boxesToNodes, conflictGraph, graph, nodesToBoxes, nodesToID, OPTIMIZATION_BALANCED, OPTIMIZATION_EDGE_OVERLAP, OPTIMIZATION_LABEL_OVERLAP, OPTIMIZATION_NODE_OVERLAP, OPTIMIZATION_NONE, OPTIMIZATION_PREFERRED_PLACEMENT |
Fields inherited from class y.layout.labeling.AbstractLabelingAlgorithm |
---|
EPS, LABEL_MODEL_DPKEY, setCustomizedProfitModel |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, NODE_TYPE_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
SALabeling()
Creates a new instance of SALabeling with default settings. |
Method Summary | |
---|---|
long |
getMaximalDuration()
Returns the time limit for this algorithm in milliseconds. |
boolean |
isDeterministicModeEnabled()
Returns whether or not this algorithm behaves deterministically. |
void |
setDeterministicModeEnabled(boolean deterministicModeEnabled)
Specifies whether or not this algorithm behaves deterministically. |
void |
setMaximalDuration(long maximumDuration)
Specifies the time limit for this algorithm in milliseconds. |
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 |
---|
public SALabeling()
SALabeling
with default settings.
Method Detail |
---|
public boolean isDeterministicModeEnabled()
true
if this algorithm works deterministically,
false
otherwisesetDeterministicModeEnabled(boolean)
public void setDeterministicModeEnabled(boolean deterministicModeEnabled)
deterministicModeEnabled
- true
if this algorithm should work deterministically,
false
otherwisepublic void setMaximalDuration(long maximumDuration)
Integer.MAX_VALUE
denotes that there is no time limit.
Values have to be greater than or equal to 0
.
Integer.MAX_VALUE
. There is no time limit.maximumDuration
- a non-negative value representing the time limit in milliseconds
java.lang.IllegalArgumentException
- if the given maximum duration is negativepublic long getMaximalDuration()
Integer.MAX_VALUE
denotes that there is no time limit.
Values have to be greater than or equal to 0
.
setMaximalDuration(long)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |