Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.algorithms.dag.transitive_closure

transitive_closure(G)[source]

Returns transitive closure of a directed graph

The transitive closure of G = (V,E) is a graph G+ = (V,E+) such that for all v,w in V there is an edge (v,w) in E+ if and only if there is a non-null path from v to w in G.

Parameters:G (NetworkX DiGraph) – A directed graph
Returns:The transitive closure of G
Return type:NetworkX DiGraph
Raises:NetworkXNotImplemented – If G is not directed

References

[1]http://www.ics.uci.edu/~eppstein/PADS/PartialOrder.py