3.4.1. pywhy_graphs.algorithms.acyclification#

pywhy_graphs.algorithms.acyclification(G: MixedEdgeGraph, directed_edge_type: str = 'directed', bidirected_edge_type: str = 'bidirected', copy: bool = True) MixedEdgeGraph[source]#

Acyclify a cyclic graph.

Applies the acyclification procedure presented in [1]. This converts to G to what is called \(G^{acy}\) in the reference.

Parameters:
Gpywhy_nx.MixedEdgeGraph

A graph with cycles.

directed_edge_typestr

The name of the sub-graph of directed edges.

bidirected_edge_typestr

The name of the sub-graph of bidirected edges.

copybool

Whether to operate on the graph in place, or make a copy.

Returns:
Gpywhy_nx.MixedEdgeGraph

The acyclified graph.

Notes

This replaces all strongly connected components of G by fully connected bidirected components without any directed edges. Then any node with an edge pointing into the SC (i.e. a directed edge, or bidirected edge) is made fully connected with the nodes of the SC either with a directed, or bidirected edge.

References