documentationfor yFiles for HTML 2.6

TransitiveEdges

Calculates the transitive edges that connect the visible nodes in the specified graph.

Inheritance Hierarchy
TransitiveEdges

Remarks

The algorithm suggests a transitive edge between two visible nodes if:

  • there is a (directed/undirected) path between the nodes using only invisible nodes as intermediate nodes
  • and there is not already an edge between the two nodes

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
  • 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

Other than TransitiveClosure, this algorithm only suggests edges for nodes which are indirectly connected via nodes which are hidden, i.e. not visible.

This can be useful to simplify graphs where unimportant nodes are removed but the (indirect) connections between the important nodes should be kept:

Examples

Calculating the transitive edges between the selected nodes.
// calculate the transitive edges between the selected nodes
const algorithm = new TransitiveEdges({
  visibleNodes: graphComponent.selection.selectedNodes
})
// run the algorithm
const result = algorithm.run(graph)

// add the edges
for (const edge of result.edgesToAdd) {
  graph.createEdge(edge.source, edge.target, edgeStyle)
}

Type Details

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

See Also

Sample Graphs

Constructors

Properties

Methods