BfsLayerAssigner uses a breadth-first search for assigning layers to the nodes.
Remarks
The nodes of the first layer can be freely selected (see bfsLayerAssignerCoreNodes). The nodes that belong to a subsequent layer are determined as follows: Add all yet unassigned nodes to the new layer that are connected to nodes already assigned. As a consequence, all connected nodes will be at most one layer apart. Also, edges between nodes that belong to the same layer are possible.
Type Details
- yFiles module
- algorithms
Constructors
Creates an instance of BfsLayerAssigner.
Methods
Assigns all nodes of the graph to layers and adds them to the layers instance in the given layoutContext
.
Parameters
options - Object
A map of options to pass to the method.
A map of options to pass to the method.
- graph - LayoutGraph
- The input graph
- layoutContext - HierarchicalLayoutContext
- The HierarchicalLayoutContext used for querying information about the nodes and edges
See Also
Implements
Constants
A data key for identifying the core nodes of the BFS layering.
Remarks
The IMapper<K,V> registered with this key should provide boolean values for the nodes of the graph. The boolean value determines whether or not a node is to be placed in the first layer. If there are no nodes marked as core nodes, then nodes with in-degree
0
are considered to be the core nodes.See Also
It is recommended to use bfsLayerAssignerCoreNodes instead, which provides a simpler and more convenient way for identifying the core nodes of the BFS layering.