documentationfor yFiles for HTML 2.6

EigenvectorCentrality

Computes an eigenvector centrality for each node of a given undirected, unweighted graph.

Inheritance Hierarchy
EigenvectorCentrality

Remarks

Eigenvector centrality is a measure of the influence a node has on a network: The more nodes point to a node the higher is that node's centrality.

The centrality values are scaled so that the largest centrality value is 1.0.

Other Centrality Measures

yFiles for HTML supports a number of other centrality measures:

Examples

const result = new EigenvectorCentrality().run(graph)

// add node labels for centrality values
// and adjust node size according to centrality
result.nodeCentrality.forEach(({ key, value }) => {
  const node = key
  const centrality = value
  graph.addLabel(node, String(centrality))
  graph.setNodeLayout(
    node,
    new Rect(node.layout.center, new Size(centrality, centrality))
  )
})

Type Details

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

See Also

The PageRank algorithm is also based on eigenvector centrality but allows for more configuration options.
For some input graphs the power iteration method that is used to calculate the dominant eigenvector doesn't converge and, thus, this method doesn't find a valid solution. This is indicated by a false isValid of the result. In such cases, we recommend to switch to the PageRank algorithm.

Constructors

Properties

Methods