C

LayoutGraphNodeAggregation

This class realizes an algorithm that aggregates nodes in a LayoutGraph and creates a hierarchical clustering structure subject to user-specified constraints like the type of nodes as well as the preferred minimum and maximum size of a cluster.
Inheritance Hierarchy

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

NameDefaultDescription
aggregationPolicyNodeAggregationPolicy.STRUCTURAL
maximumClusterSize10
minimumClusterSize5
nodesOnlyOnLeavestrue
Nodes are only mapped to leaves of the aggregation tree.
nodeTypePolicyNodeTypePolicy.IGNORE
stopDurationTimeSpan.MAX_VALUE
The algorithm runs unrestricted.

Members

No filters for this type

Constructors

Creates a new LayoutGraphNodeAggregation instance with default settings.

Parameters

Properties

Gets or sets the policy applied for determining the clusters.
conversionfinal

Property Value

one of the predefined policies for determining the clusters

Default Value

The default value is: NodeAggregationPolicy.STRUCTURAL
Gets or sets the preferred maximum number of elements contained in a cluster.
The minimum allowed value for this property is 2.
The algorithm doesn't guarantee that the found solution observes this value.
final

Property Value

the preferred maximum number of elements contained in a cluster

Throws

Exception ({ name: 'ArgumentError' })
if the maximum cluster size is less than 2

Default Value

The default value is: 10

See Also

API
minimumClusterSize
Gets or sets the preferred minimum number of elements contained in a cluster.
The minimum allowed value for this property is 1.
The algorithm doesn't guarantee that the found solution observes this value.
final

Property Value

the preferred minimum number of elements contained in a cluster

Throws

Exception ({ name: 'ArgumentError' })
if the minimum cluster size is less than 1

Default Value

The default value is: 5

See Also

API
maximumClusterSize
Gets or sets whether or not all original nodes are only mapped to leaves of the directed rooted aggregation tree that represents the hierarchical clustering structure.
If this property is disabled, nodes can also represent inner nodes and, thus, contain other node elements. This may allow a more efficient representation of the resulting tree structure. For example, for a star-like structure in the input graph, the root of the star can directly represent the parent aggregate of the star. Otherwise, an additional virtual tree node must be inserted.
final

Property Value

true if nodes are only mapped to leaves, false otherwise

Default Value

The default value is: true
Nodes are only mapped to leaves of the aggregation tree.
Gets or sets the policy for handling nodes of different type.
conversionfinal

Property Value

one of the predefined policies for handling nodes of different type

Default Value

The default value is: NodeTypePolicy.IGNORE
Gets or sets the duration that this algorithm should preferably run before stopping.
The duration needs to be non-negative.
Restricting the stop duration may result in a lower aggregation quality. Furthermore, the real runtime may exceed the stop duration since the algorithm still has to find a valid solution.
conversionfinal

Property Value

a non-negative duration

Throws

Exception ({ name: 'ArgumentError' })
if the specified duration has a negative value

Default Value

The default value is: TimeSpan.MAX_VALUE
The algorithm runs unrestricted.

Methods

Starts the node aggregation for the specified graph.
The aggregation result 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 that is stored in the given IMapper<K, V> 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.
final

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.
If the aggregationPolicy is set to STRUCTURAL, nodes connected by edges with high weights are more likely to be clustered together.
Edge weights are only considered if the aggregationPolicy is set to STRUCTURAL.
static

See Also

API
aggregationPolicy, STRUCTURAL
A data key for specifying the (non-negative) weights of the nodes.
Depending on the exact setting, the algorithm applies multiple different aggregation approaches and chooses the best one. If nodes have weights, it prefers aggregation results where nodes with higher weight are closer to the root of the aggregation hierarchy.
static
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.

static