documentationfor yFiles for HTML 2.6

StronglyConnectedComponents

Determines the strongly connected components of a given graph.

Inheritance Hierarchy
StronglyConnectedComponents

Remarks

A graph is called strongly connected if there exists a directed path between each pair of nodes.

The strongly connected components of a graph are the strongly connected subgraphs of which it consists.

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
  • 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
  • KCoreComponents – Calculates the k-cores of an undirected input graph. The k-core of an undirected input graph consists of the subgraph components where each node has at least degree k.

Examples

Calculating strongly connected components on a graph
// prepare the strongly connected components algorithm
const algorithm = new StronglyConnectedComponents()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the connected components with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeComponentIds.get(node)
  graph.setStyle(node, componentStyles.get(componentId))
}// prepare the strongly connected components algorithm
const algorithm = new StronglyConnectedComponents()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the connected components with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeComponentIds.get(node)
  graph.setStyle(node, componentStyles.get(componentId)!)
}

Type Details

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

See Also

Constructors

Properties

Methods