documentationfor yFiles for HTML 2.6

TransitiveClosure

Calculates the transitive closure for a directed acyclic graph.

Inheritance Hierarchy
TransitiveClosure

Remarks

Let G = (V, E) be a directed acyclic graph. The transitive closure of G is a graph which contains an edge (v, w) (with vw) only if there exists a path from v to w in G. This implementation produces the transitive closure and not the reflexive, transitive closure of the specified graph, since no representations for self-loops are added.

Other Transitivity Algorithms

yFiles for HTML supports other algorithms related to transitivity:

  • TransitiveEdges – calculates the edges which connect the visible nodes in a graph if these are indirectly connected via hidden nodes.
  • TransitiveReduction – calculates the transitive reduction of a graph, i.e. the edges that are unnecessary to only ensure that the same reachability relation is represented

Examples

Calculating the transitive closure of a graph
// prepare the transitive closure algorithm
const algorithm = new TransitiveClosure()
// run the algorithm
const result = algorithm.run(graph)

// Add the edges in the closure with a different style
for (const edge of result.edgesToAdd) {
  graph.createEdge(edge.source, edge.target, transitiveEdgeStyle)
}

Type Details

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

See Also

Constructors

Properties

Methods