Implements a simulated annealing graph layout algorithm.
Namespace: MindFusion.Diagramming.Layout
Assembly: MindFusion.Diagramming
C# Copy Code |
---|
public class AnnealLayout : Layout |
Visual Basic Copy Code |
---|
Public Class AnnealLayout |
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 MindFusion.Diagramming for .NET MAUI 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 in InitialTemperature, and runs several cooling Stages. At each stage the algorithm evaluates several graph configurations for each node, as set in IterationsPerStage. At the end of each stage, the algorithm selects the configuration that has a minimum cost and decreases the temperature by multiplying it by TemperatureScale. The relative weight of an aesthetic criterion relative to the other criteria is set by the DistributionFactor, LinkLengthFactor, BoundaryFactor and CrossingLinksCost properties.
Anchoring specifies whether the layout algorithm must attach links to the anchor points of graphs nodes. The layout algorithm produces best results if it can place link ends at arbitrary positions over the nodes outlines, that is, when using the Ignore value. If your application logic requires links to be always attached to anchor points, use the other two values. In such cases Reassign would yield better results.
System.Object
MindFusion.Diagramming.Layout.Layout
MindFusion.Diagramming.Layout.AnnealLayout