pywhy_graphs.algorithms.order_edges#

pywhy_graphs.algorithms.order_edges(G: DiGraph)[source]#

Find total ordering of the edges of DAG G.

A total ordering is a topological sorting of the nodes, and then ordering all possible edges according to Algorithm 4 in [1]. The edges are sorted such that the edges obey the topological sorting of the nodes, but also is sorted such that the source node of the edge is ordered based on the topological sort as well.

Parameters:
GDAG

A directed acyclic graph.

Returns:
list

A list of edges in the DAG.

References