Partitions the graph into clusters using edge betweenness centrality, as proposed by Girvan and Newman.
Remarks
Betweenness centrality is a measure for how often a node lies on a shortest path between each pair of nodes in the graph.
In each iteration the edge with the highest betweenness centrality is removed from the graph. The method stops if there are no more edges to remove or if the requested maximum number of clusters is found. The clustering with the best quality reached during the process is returned.
The algorithm includes several heuristic speed-up techniques available through the quality/time ratio. For the highest quality setting, it is used almost unmodified. The fast betweenness approximation of Brandes and Pich (Centrality Estimation in Large Networks) is employed for values around 0.5
. Typically, this results in a tiny decrease in quality but a large speed-up and is the recommended setting. To achieve the lowest running time, a local betweenness calculation is used (Gregory: Local Betweenness for Finding Communities in Networks).
Other Clustering Algorithms
yFiles for HTML supports a number of other clustering algorithms:
- KMeansClustering – partitions the graph into clusters based on the distance between nodes and the cluster midpoints.
- HierarchicalClustering – partitions the graph into clusters by merging smaller clusters based on their distance.
- BiconnectedComponentClustering – partitions the graph into clusters based on its biconnected components.
- LouvainModularityClustering – partitions the graph into clusters by applying the Louvain modularity method.
- LabelPropagationClustering – partitions the graph into clusters by applying a label propagation algorithm.
Examples
Type Details
- yfiles module
- view-layout-bridge
- yfiles-umd modules
- view-layout-bridge
- Legacy UMD name
- yfiles.analysis.EdgeBetweennessClustering
See Also
Constructors
Creates a new EdgeBetweennessClustering instance.
Parameters
A map of options to pass to the method.
- directed - boolean
A value indicating whether edge direction should be considered. This option sets the directed property on the created object.
- minimumClusterCount - number
The minimum number of clusters that will be returned. This option sets the minimumClusterCount property on the created object.
- maximumClusterCount - number
The maximum number of clusters that will be returned. This option sets the maximumClusterCount property on the created object.
- weights - ItemMapping<IEdge,number>
A mapping for edge weights. This option sets the weights property on the created object.
- qualityTimeRatio - number
A desired quality value for the result. This option sets the qualityTimeRatio property on the created object.
- subgraphNodes - ItemCollection<INode>
The collection of nodes which define a subset of the graph for the algorithms to work on. This option sets the subgraphNodes property on the created object.
- subgraphEdges - ItemCollection<IEdge>
The collection of edges which define a subset of the graph for the algorithms to work on. This option sets the subgraphEdges property on the created object.
Properties
Gets or sets a value indicating whether edge direction should be considered.
Remarks
true
.1
and the graph is considered undirected.Gets or sets the maximum number of clusters that will be returned.
Remarks
A negative value will not limit the number of clusters.
Despite the value of this setting, the number of clusters is always at least the number of connected components in the graph.
Default is -1
meaning that there is no limit for the number of clusters.
See Also
Gets or sets a desired quality value for the result.
Remarks
This must be a value between 0.0
(low quality, faster) and 1.0
(high quality, slower). For large graphs the recommended value is 0.5
.
Default is 1
.
Gets or sets the collection of edges which define a subset of the graph for the algorithms to work on.
Remarks
If nothing is set, all edges of the graph will be processed.
If only the excludes are set all edges in the graph except those provided in the excludes are processed.
Note that edges which start or end at nodes which are not in the subgraphNodes are automatically not considered by the algorithm.
ItemCollection<T> instances may be shared among algorithm instances and will be (re-)evaluated upon (re-)execution of the algorithm.
Examples
Gets or sets the collection of nodes which define a subset of the graph for the algorithms to work on.
Remarks
If nothing is set, all nodes of the graph will be processed.
If only the excludes are set all nodes in the graph except those provided in the excludes are processed.
ItemCollection<T> instances may be shared among algorithm instances and will be (re-)evaluated upon (re-)execution of the algorithm.
Examples
Gets or sets a mapping for edge weights.
Remarks
Edge weights influence the importance of certain edges. If no weights are provided at all, all edges have the same uniform weight of 1
.
Edge weights for edge betweenness clustering must be finite and positive.
1
, as the heuristics assume uniform weights.Methods
Partitions the graph into groups using edge betweenness centrality.
Complexity
- O(|V| ⋅ |E|²) for unweighted graphs or when
is less than 1
- O(|E| ⋅ |V| ⋅ (|E| + |V|) ⋅ log |V|) for weighted graphs
Parameters
A map of options to pass to the method.
- graph - IGraph
- The input graph to run the algorithm on.
Returns
- ↪EdgeBetweennessClusteringResult
- A EdgeBetweennessClusteringResult containing the computed clusters.
Throws
- Exception({ name: 'InvalidOperationError' })
- If the algorithm can't create a valid result due to an invalid graph structure or wrongly configured properties.