DroidDiagram Programmer's Guide
AnnealLayout Class
Remarks See Also
 






Implements a simulated annealing graph layout algorithm.

Namespace: com.mindfusion.diagramming
Package: com.mindfusion.diagramming

 Syntax

Java  Copy Code

public class AnnealLayout implements Layout

 Remarks

Simulated Annealing is a general-purpose optimization method used to solve large-scale combinatorial problems by simulating the process of heating and cooling of metal to achieve freedom from defects. Finding a nice arrangement of a graph is a combinatorial problem that can be reduced to assigning costs to graph configurations and finding the minimum cost configuration. In that case, a cost is assigned to a graph configuration by evaluating different aesthetic criteria such as distance between nodes, length of links and the number of link crossings.

The AnnealLayout class implements a Simulated Annealing graph layout algorithm that can be used to arrange DroidDiagram diagrams. To arrange a diagram, create an AnnealLayout instance, set its properties and call the arrange method.

The algorithm starts the simulation with the temperature set via setInitialTemperature, and runs several cooling stages, as set via setStages. At each stage the algorithm evaluates several graph configurations for each node, as set by calling setIterationsPerStage. At the end of each stage, the algorithm selects the configuration that has a minimum cost and decreases the temperature by multiplying it by getTemperatureScale. The relative weight of an aesthetic criterion relative to the other criteria is set via the setDistributionFactor, setLinkLengthFactor, setBoundaryFactor and setCrossingLinksCost methods.

 Inheritance Hierarchy

java.lang.Object
    com.mindfusion.diagramming.AnnealLayout

 See Also

AnnealLayout Members
com.mindfusion.diagramming Namespace