documentationfor yFiles for HTML 2.6

EdgeBetweennessClustering

Partitions the graph into clusters using edge betweenness centrality, as proposed by Girvan and Newman.

Inheritance Hierarchy
EdgeBetweennessClustering

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:

Examples

Calculating the edge betweenness clusters of a graph
// prepare the edge betweenness clustering algorithm
const algorithm = new EdgeBetweennessClustering()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the clusters with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeClusterIds.get(node)
  graph.setStyle(node, clusterStyles.get(componentId))
}// prepare the edge betweenness clustering algorithm
const algorithm = new EdgeBetweennessClustering()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the clusters with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeClusterIds.get(node)
  graph.setStyle(node, clusterStyles.get(componentId)!)
}

Type Details

yfiles module
view-layout-bridge
yfiles-umd modules
view-layout-bridge
Legacy UMD name
yfiles.analysis.EdgeBetweennessClustering

See Also

Constructors

Properties

Methods