alpha_order#

fedcausal.fusion.alpha_order(dags)[source]#

Return a topological order that the DAGs in dags agree on as much as possible.

The order is built from the sinks up. Each step picks the node whose removal costs the fewest edge changes summed over every DAG (arc reversals plus the moral edges they force), places it before the nodes already ordered, and peels it from every DAG. Ties go to the lowest index.

Parameters:
dagssequence of DAG

DAGs over the same nodes. At least one.

Returns:
list of int

A permutation of the nodes, sinks last.