This class is a ISequencer implementation that performs the second phase of the Sugiyama algorithm.
Remarks
Default Values of Properties
randomizationRounds | 50 | The number of randomized rounds is 50 , if the 14 . |
stopDuration | MAX_VALUE
| The algorithm runs unrestricted. |
transposition | true | The transposition rule is active. |
weightHeuristic | BARYCENTER
| A barycenter heuristic is used. |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new instance of DefaultSequencer.
Parameters
A map of options to pass to the method.
- transposition - boolean
- Whether to apply an additional crossing minimization heuristic. This option sets the transposition property on the created object.
- weightHeuristic - SequencerWeightHeuristic
- The weight heuristic that should be used. This option sets the weightHeuristic property on the created object.
- stopDuration - TimeSpan
- The time limit set for this sequencer per execution. This option sets the stopDuration property on the created object.
- randomizationRounds - number
- The number of randomized rounds that this algorithm performs, if there was no optimal solution. This option sets the randomizationRounds property on the created object.
Properties
Gets or sets the number of randomized rounds that this algorithm performs, if there was no optimal solution.
Remarks
0
.Default Value
50
.The number of randomized rounds is 50
, if the 14
.
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if a negative value is given
Gets or sets the time limit set for this sequencer per execution.
Gets or sets whether to apply an additional crossing minimization heuristic.
Remarks
Default Value
true
.The transposition rule is active.
Property Value
true
if the crossing minimization heuristic is applied, false
otherwiseSample Graphs
Gets or sets the weight heuristic that should be used.
Default Value
Property Value
Methods
getCrossingCost
(edge1: LayoutEdge, edge2: LayoutEdge, layoutContext: HierarchicalLayoutContext) : numberReturns the cost of an edge crossing between the two given edges.
Remarks
The default implementation defines the crossing cost of two edges as the product of the individual crossing costs which are defined with edgeCrossingCosts. If no individual crossing costs are defined, all edges have a cost of 1
, hence, this method also returns 1
.
This method may be overridden to specify costs for a specific pair of edges. The given HierarchicalLayoutContext is helpful to determine the type of the edges by using method getEdgeContext. Furthermore, using the original edge to decide what a crossing costs might be helpful, see getOriginalEdge.
Parameters
A map of options to pass to the method.
- edge1 - LayoutEdge
- the first edge involved in the crossing
- edge2 - LayoutEdge
- the second edge involved in the crossing
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext containing information about the edges and nodes
Returns
- ↪number
- the crossing cost for the two given edges
Calculates the sequence of the nodes within each layer of the layers list in the given layoutContext
.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutContext - HierarchicalLayoutContext
- The HierarchicalLayoutContext instance which provides access to context information about the nodes and edges of the graph, as well as the ItemFactory used temporarily for modifying the graph instance.