Describe the bug
While applying Orient graph to orient a CPDAG, the procedure removes some of the edges present in the graph. I specifically used ANM object to call this procedure.
def orient_graph(self, df_data, graph, printout=None, **kwargs):
if isinstance(graph, nx.DiGraph):
edges = [a for a in list(graph.edges()) if (a[1], a[0]) in list(graph.edges())]
oriented_edges = [a for a in list(graph.edges()) if (a[1], a[0]) not in list(graph.edges())]
Describe the bug While applying Orient graph to orient a CPDAG, the procedure removes some of the edges present in the graph. I specifically used ANM object to call this procedure.
[('V2', 'V7'), ('V3', 'V7'), ('V7', 'V2'), ('V7', 'V3'), ('V7', 'V8'), ('V8', 'V7'), ('V8', 'V9'), ('V9', 'V8')]
// below code deletes the edges from the edge list which later would be used for orientation
[('V7', 'V3'), ('V9', 'V8')]
Not Sure why the algorithm deleting some of the un-oriented edges