The clustering mode
ibm_ilog.graphlayout.circular.CircularLayout.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 (ibm_ilog.graphlayout.tree.TreeLayout
)
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 instance 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:
Use the method:
layout.setClusterByBiconnectivity(false)
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:
Use the method:
layout.setMinimumClusterSize(10)
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 obeyed.
Example of specifying the maximum cluster size (CL algorithm)
To specify the maximum cluster size:
Use the method:
layout.setMaximumClusterSize(20)
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:
Use the method:
layout.setMaximumNumberOfIterationsToReachMaxClusterSize(100)
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:
Use the method:
layout.setHighDegreeStarClusterSize(5)
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 on 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:
Use the method:
layout.setInterClusterCrossingReduction(false)
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:
Use the method:
layout.setIntraClusterLinkCrossingPenalty(2)
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:
Use the method:
layout.setInterClusterLinkCrossingPenalty(3)
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:
Use the method:
layout.setMixedClusterLinkCrossingPenalty(4)
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 on 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 of layout of cluster graphs
The layout parameters of the tree layout can be changed
by accessing the tree layout:
Use the method:
var layoutOfClusterGraph = layout.getLayoutOfClusterGraph()
to access the layout of the cluster graph. By default,
it is an instance of
ibm_ilog.graphlayout.tree.TreeLayout
.
You can set any global tree layout parameter on this layout instance. You can also specify a different layout instance to place
the clusters:
Use the method:
layout.setLayoutOfClusterGraph(otherLayout)
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:
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. Of course 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
circularLayout.getLayoutOfClusterGraph().setLayoutOfConnectedComponentsEnabled(true); circularLayout.getLayoutOfClusterGraph().setLayoutOfCOnnectedComponents(someGridLayout);
but this has exactly the same effect as if you specify
it directly at the circular layout instance.