Remarks
Important: This class is designed for graphs of type LayoutGraph. To compute a node aggregation directly on a graph of type IGraph, please refer to NodeAggregation.
The algorithm can be started via method aggregate. The result of the aggregation can be used to (interactively) visualize parts of large graphs.
Note that the resulting clustering structure corresponds to a directed rooted tree which we encode by means of a set of NodeAggregationInfo instances. More precisely, each node of the original graph is mapped to a unique NodeAggregationInfo instance. This mapping is stored in the IMapper<K, V> that is passed to method aggregate. Each NodeAggregationInfo has a reference to its parent which induces a directed tree structure. There is always exactly one NodeAggregationInfo without a parent that represents the root of the tree. Property nodesOnlyOnLeaves allows to specify whether nodes are only mapped to leaves of the tree structure or if they can also be mapped to inner nodes.
Property aggregationPolicy allows to specify whether the algorithm should consider STRUCTURAL properties (i.e., considering the connectivity) for the aggregation or GEOMETRIC properties (i.e., the distance between nodes). For the second policy, the coordinates of the nodes are taken from the layout property, so that it is important to specify proper coordinates and not use a structure-only graph instance.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| aggregationPolicy | NodeAggregationPolicy.STRUCTURAL | |
| maximumClusterSize | 10 | |
| minimumClusterSize | 5 | |
| nodesOnlyOnLeaves | true | Nodes are only mapped to leaves of the aggregation tree. |
| nodeTypePolicy | NodeTypePolicy.IGNORE | |
| stopDuration | TimeSpan.MAX_VALUE | The algorithm runs unrestricted. |
Members
Constructors
Creates a new LayoutGraphNodeAggregation instance with default settings.
Parameters
Properties
Gets or sets the policy applied for determining the clusters.
Property Value
Default Value
2.Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the maximum cluster size is less than 2
Default Value
See Also
1.Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum cluster size is less than 1
Default Value
See Also
Property Value
true if nodes are only mapped to leaves, false otherwiseDefault Value
Gets or sets the policy for handling nodes of different type.
Property Value
Default Value
Gets or sets the duration that this algorithm should preferably run before stopping.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified duration has a negative value
Default Value
Methods
Starts the node aggregation for the specified graph.
aggregationResult. Each NodeAggregationInfo has a reference to its parent which induces a directed tree structure. There is always exactly one NodeAggregationInfo without a parent that represents the root of the tree.Parameters
- graph: LayoutGraph
- the input graph
- aggregationResult: IMapper<LayoutNode, NodeAggregationInfo>
- stores a unique aggregation info associated with each node
Constants
A data key for specifying the (non-negative) weights of the edges.
See Also
A data key for specifying the (non-negative) weights of the nodes.
A data key for specifying the top-level nodes of the aggregation info.
Assign true to a node if the node should be a top-level node, or false otherwise.
Top-level nodes are directly contained in the root cluster of the aggregation result or in direct children of the root if there are top-level nodes with different types (nodes of different type are not allowed to be directly contained in the same cluster). The only exception to this rules is if there are group nodes, because a group is a kind of user-specified cluster and, thus, a top-level node contained in a group is always placed in the cluster associated with that group.