cascade.graph.acyclify

cascade.graph.acyclify(digraph, edge_attr='weight')[source]

Acyclify a directed graph by iteratively removing cycle-inducing edges with the lowest weights

Parameters:
  • digraph (DiGraph) – Directed graph

  • edge_attr (str) – Attribute key for edge weights

Return type:

DiGraph

Returns:

Acyclic directed graph

Caution

This might not be reproducible due to the unstable order of identified cycles.