documentationfor yFiles for HTML 2.6

IndependentSets

Partitions the set of nodes of the given graph into independent sets.

Inheritance Hierarchy
IndependentSets

Remarks

An independent set is a set of nodes in a graph, in which no two nodes are adjacent.

Circular nodes represent one of the independent sets of the given graph

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
  • 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 independent sets on a graph
// prepare the independent sets algorithm
const algorithm = new IndependentSets()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the independent sets with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeSetIds.get(node)
  graph.setStyle(node, nodeSetStyles.get(componentId))
}// prepare the independent sets algorithm
const algorithm = new IndependentSets()
// run the algorithm
const result = algorithm.run(graph)

// highlight the nodes of the independent sets with different styles
for (const node of graph.nodes) {
  const componentId = result.nodeSetIds.get(node)
  graph.setStyle(node, nodeSetStyles.get(componentId)!)
}

Type Details

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

See Also

Constructors

Properties

Methods