Packagecom.yworks.yfiles.algo
Classpublic class Transitivity
InheritanceTransitivity Inheritance YObject Inheritance Object

Provides algorithms to compute reachability information for directed, acyclic graphs. The following algorithms are available:



Public Methods
 MethodDefined By
  
Transitivity(init:Boolean = true)
Transitivity
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
Transitivity
 Inherited
hashCode():int
YObject
  
[static]
Transitivity
  
[static] Calculates the transitive closure for a directed acyclic graph. The reflexive, transitive closure is defined as follows: Let G = (V,E) be an directed acyclic graph. The directed acyclic graph G* = (V,E*) is the reflexive, transitive closure of G, if (v,w) in E* iff there is a path from v to w in G. REMARK: Note, that this implementation produces the transitive closure and not the reflexive, transitive closure of the specified graph, since no self-loops are added to the specified graph.
Transitivity
  
[static] Like transitiveClosure(), additionally this method returns the edges that have been added to the graph.
Transitivity
  
[static] Calculates the transitive reduction for a directed acyclic graph.
Transitivity
  
[static] Like transitiveReduction() this method calculates the transitive reduction of a graph.
Transitivity
Protected Methods
 MethodDefined By
  
Transitivity
Constructor Detail
Transitivity()Constructor
public function Transitivity(init:Boolean = true)



Parameters
init:Boolean (default = true)
Method Detail
getClass()method
override public function getClass():Class

Returns
Class
initTransitivity()method 
protected final function initTransitivity():void

newTransitivity()method 
public static function newTransitivity():Transitivity

Returns
Transitivity
transitiveClosure()method 
public static function transitiveClosure(graph:Graph):void

Calculates the transitive closure for a directed acyclic graph. The reflexive, transitive closure is defined as follows: Let G = (V,E) be an directed acyclic graph. The directed acyclic graph G* = (V,E*) is the reflexive, transitive closure of G, if (v,w) in E* iff there is a path from v to w in G. REMARK: Note, that this implementation produces the transitive closure and not the reflexive, transitive closure of the specified graph, since no self-loops are added to the specified graph.

Precondition GraphChecker.isAcyclic(graph)

Parameters

graph:Graph — input graph to which this method will add transitive edges if necessary.

transitiveClosureGetAddedEdges()method 
public static function transitiveClosureGetAddedEdges(graph:Graph, addedEdges:EdgeList):void

Like transitiveClosure(), additionally this method returns the edges that have been added to the graph.

Precondition GraphChecker.isAcyclic(graph)

Parameters

graph:Graph — input graph to which this method will add transitive edges if necessary.
 
addedEdges:EdgeList — contains edges that have been added to the graph by this method.

See also

transitiveReduction()method 
public static function transitiveReduction(graph:Graph):void

Calculates the transitive reduction for a directed acyclic graph. The transitive edges in the graph will be removed by this method. The transitive reduction is defined as follows: Let G = (V,E) be an directed acyclic graph. The directed acyclic graph G* = (V,E*) is the transitive reduction of G, if (v,w) in E* iff there is no path from v to w in G of length 2 or more. WARNING: This implementation is costly in terms of memory, since a (n x n)-Matrix is allocated to store reach data.

Complexity O(n^3), where n is the node count of the specified graph

Precondition GraphChecker.isAcyclic(graph)

Parameters

graph:Graph

transitiveReductionGetEdgesToRemove()method 
public static function transitiveReductionGetEdgesToRemove(graph:Graph, transitiveEdges:EdgeList):void

Like transitiveReduction() this method calculates the transitive reduction of a graph. The transitive edges will not be removed from the graph. Instead they will be returned in an EdgeList.

Complexity O(n^3), where n is the node count of the specified graph

Precondition GraphChecker.isAcyclic(graph)

Parameters

graph:Graph — the input graph
 
transitiveEdges:EdgeList — returns the result. It will contain all transitive edges of the given graph. Removal of these edges will yield the transitive reduction of the graph.

See also