documentationfor yFiles for HTML 2.6

KCoreComponents

Calculates the k-cores of an undirected input graph.

Inheritance Hierarchy
KCoreComponents

Remarks

The k-core of an undirected input graph consists of the subgraph components where each node has at least degree k. The algorithm has runtime complexity O((n+m)log(n)) and requires linear space.

Other Graph Connectivity Algorithms

yFiles for HTML supports a number of other analysis algorithms that partition the graph into components, based on various criteria.

  • ConnectedComponents – Determines components defined by the existence of an undirected path between nodes
  • StronglyConnectedComponents – Determines components defined by the existence of a directed path between nodes
  • BiconnectedComponents – Determines components defined by the existence of at least two separate undirected paths between all nodes
  • Bipartition – Divides a graph into two partitions where all edges have their source and target in different partitions
  • IndependentSets – Divides a graph into partitions where no nodes are connected within a partition

Examples

Calculating the k-cores of a graph
// prepare the k-core algorithm
const algorithm = new KCoreComponents()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of a given k-cores with different styles
for (const node of result.getKCore(3)) {
  graph.setStyle(node, highlightStyle)
}

Type Details

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

See Also

Self-loops are ignored.

Constructors

Properties

Methods