The clustering mode
AUTOMATIC
can calculate clusters and order the nodes within clusters to
avoid link crossings. By default, it places the clusters relative
to each other with a tree layout (
IlvTreeLayout
) in radial mode. You can also specify other layouts to handle
the cluster placement. The following parameters work only in
clustering mode
AUTOMATIC
.
Fine-tuning the clustering
The clustering mode
AUTOMATIC
takes the specified clusters as initial clusters into account. If
some or all nodes have no specified cluster, it calculates
clusters from the topology of the graph.
This mode takes several topology
criteria into account:
- Biconnectivity
- Minimum number of nodes per cluster
- Maximum number of nodes per cluster
- High degree nodes to form star clusters
Clustering by biconnectivity
If a set of nodes has many connections
among each other, they must form a cluster. The informal
property "many connections" can be mathematically described by
the term biconnectivity: A set of nodes is biconnected if
removing only one node or only one link keeps the nodes
connected. For example, a connection ring is always
biconnected. It is a suitable criterion for clusters. The
algorithm detects by default first the biconnected parts of the
graph, and forms a regular cluster (not a star cluster) for
each part. If it is not suitable, the detection of biconnected
components can also be disabled.
Example of disabling the detection of
biconnected parts (CL algorithm)
To disable the detection of
biconnected components:
In CSS
Add to the
GraphLayout
section:
clusterByBiconnectivity: "false";
In Java
Use the method:
void setClusterByBiconnectivity(boolean enable)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Minimum cluster size
It is possible to specify the minimal
size of regular clusters (not of star clusters). If the initial
clusters are too small, they are merged into larger clusters.
Example of specifying the minimum
cluster size (CL algorithm)
To specify the minimum cluster size:
In CSS
Add to the
GraphLayout
section:
minimumClusterSize: "10";
In Java
Use the method:
void setMinimumClusterSize(int size)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Maximum cluster size
It is possible to specify the maximal
size of regular clusters (not of star clusters). If the initial
clusters are too large, they are split into smaller clusters.
This value is only a hint. If the minimum cluster size and the
maximum cluster size are close to each other, the maximum
cluster size cannot always be respected.
Example of specifying the maximum
cluster size (CL algorithm)
To specify the maximum cluster size:
In CSS
Add to the
GraphLayout
section:
maximumClusterSize: "30";
In Java
Use the method:
void setMaximumClusterSize(int size)
Splitting clusters is an iterative
process. It is possible to specify the maximum number of
iterations to obtain the maximum cluster size; the more
iterations, the better the quality, and the slower the
layout.
Example of specifying the maximum
number of max cluster iterations (CL algorithm)
To specify the maximum number of
iterations:
In CSS
Add to the
GraphLayout
section:
maximumNumberOfIterationsToReachMaxClusterSize: "15";
In Java
Use the method:
void setMaximumNumberOfIterationsToReachMaxClusterSize(int numIterations)
These parameters have no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Minimum star cluster size
Besides regular clusters, the layout
algorithm can also detect star clusters. It detects nodes with
high degree that have many unclustered neighbors and forms them
into clusters with the high degree node as star center
Example of specifying the minimum star
cluster size (CL algorithm)
To specify the minimum degree to form
a node and its neighbor to a star cluster:
In CSS
Add to the
GraphLayout
section:
highDegreeStarClusterSize: "10";
In Java
Use the method:
void setHighDegreeStarClusterSize(int size)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Fine-tuning the crossing reduction
If the ordering of the nodes within each cluster is not specified
by cluster indices (see Cluster membership and order of the nodes
in a cluster (CL)), then the
AUTOMATIC
mode reorders the nodes within each cluster to avoid link
crossings. It is only a heuristic and cannot always guarantee the
minimum number of link crossings. There are two types of links:
intracluster links connect nodes that belong to the same cluster,
and intercluster links connect nodes of different clusters.
During the crossing reduction, intracluster links compete with
intercluster links. Some node orderings of a cluster produce more
crossings of links inside the cluster, while other node orderings
produce more crossings of links connecting different clusters.
The behavior can be controlled by crossing weights.
Intercluster link crossing reduction
The crossing reduction step that
considers intercluster links is the slowest part of the
crossing reduction. It is enabled by default, but it can be
disabled. If disabled, only intracluster links are considered
to calculate the ordering of nodes within each cluster.
Example of disabling intercluster link
crossing reduction (CL algorithm)
To disable the intercluster link
crossing reduction:
In CSS
Add to the
GraphLayout
section:
interClusterCrossingReduction: "false";
In Java
Use the method:
void setInterClusterCrossingReduction(boolean enable)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Intracluster link crossing penalty
The crossing reduction tries to minimize
the sum of penalties of crossings. If two intracluster links
cross, it contributes to the sum with the intracluster penalty.
Increase this penalty if intracluster links must have a higher
weight when calculating the node ordering for each cluster.
Example of specifying the intracluster
penalty (CL algorithm)
To specify the intracluster link
crossing penalty:
In CSS
Add to the
GraphLayout
section:
intraClusterLinkCrossingPenalty: "2.0";
In Java
Use the method:
void setIntraClusterLinkCrossingPenalty(float penalty)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Intercluster link crossing penalty
If two intercluster links cross, it
contributes to the penalty sum with the intercluster penalty.
Increase this penalty if intercluster links must have a higher
weight when calculating the node ordering for each cluster.
Example of specifying the intercluster
penalty (CL algorithm)
To specify the intercluster link
crossing penalty:
In CSS
Add to the
GraphLayout
section:
interClusterLinkCrossingPenalty: "2.0";
In Java
Use the method:
void setInterClusterLinkCrossingPenalty(float penalty)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Mixed cluster link crossing penalty
If an intracluster link crosses an
intercluster link, it contributes to the penalty sum with the
mixed cluster penalty.
Example of specifying the mixed
cluster penalty (CL algorithm)
To specify the mixed cluster link
crossing penalty:
In CSS
Add to the
GraphLayout
section:
mixedClusterLinkCrossingPenalty: "2.0";
In Java
Use the method:
void setMixedClusterLinkCrossingPenalty(float penalty)
This parameter has no effect if the clustering mode is
BY_CLUSTER_IDS
or
BY_SUBGRAPHS
.
Layout of cluster graph
The nodes of each cluster are placed in a
circle. Then each circle is placed in the plane. The circular
layout uses by default a tree layout in radial mode to place the
circles.
Example of handling layout of cluster
graphs
The layout parameters of the tree layout
can be changed by accessing the tree layout:
In Java
To access the layout of the cluster
graph, use the method:
IlvGraphLayout getLayoutOfClusterGraph()
By default, the layout is an instance of
IlvTreeLayout
. You can set any global tree layout parameter on this layout
instance.
You can also specify a different layout
instance to place the clusters:
In CSS
Add to the
GraphLayout
section:
layoutOfClusterGraph: "@#MyLayout";
and a new rule that specifies the details of
MyLayout
, for instance:
Subobject#MyLayout { class : "ilog.views.graphlayout.uniformlengthedges.IlvUniformLengthEdgesLayout" ; respectNodeSizes : "true" ; }
In Java
Use the method:
void setLayoutOfClusterGraph(IlvGraphLayout layout)
Handling of disconnected graphs
The layout algorithm can use the generic mechanism to lay out
connected components. (For more information about this mechanism,
see Layout of connected components). This
generic mechanism is available at the circular layout instance
itself, but as well at the tree layout instance that lays out the
cluster graph.
Example of handling of disconnected
graphs
You can enable it on the circular layout
itself:
In CSS
Add to the
GraphLayout
section:
layoutOfConnectedComponentsEnabled: "true"; layoutOfConnectedComponents: "@#SomeGridLayout";
In Java
Call on the circular layout instance:
circularLayout.setLayoutOfConnectedComponentsEnabled(true); circularLayout.setLayoutOfCOnnectedComponents(someGridLayout);
If it is disabled on the circular
layout, the layout of the cluster graph handles disconnected
components. You can enable the generic handling of
disconnected components as well on the layout of the cluster
graph (if it is supported there, which is true for the default
tree layout) via
In Java
circularLayout.getLayoutOfClusterGraph().setLayoutOfConnectedComponentsEnabled(true); circularLayout.getLayoutOfClusterGraph().setLayoutOfCOnnectedComponents(someGridLayout);
but it has the same effect as if you
specify it directly on the circular layout instance.