documentationfor yFiles for HTML 2.6

TransitiveReduction

Calculates the transitive reduction for a directed acyclic graph.

Inheritance Hierarchy
TransitiveReduction

Remarks

Given G = (V, E) be a directed acyclic graph. The transitive reduction of G is a graph which contains an edge (v, w) only if no path exists from v to w in G of length 2 or more.

Other Transitivity Algorithms

yFiles for HTML supports other algorithms related to transitivity:

  • TransitiveClosure – calculates the transitive closure of a graph, i.e. the edges that would have to be added that the set of edges defines the reachability relation in the graph
  • TransitiveEdges – calculates the edges which connect the visible nodes in a graph if these are indirectly connected via hidden nodes.

Examples

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

// Remove the edges in the reduction
for (const edge of result.edgesToRemove) {
  graph.remove(edge)
}

Type Details

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

See Also

This implementation is costly in terms of memory, since a (n × n) matrix is allocated to store reach data.

Constructors

Properties

Methods