MeekRules.propagateToDAG
- MeekRules.propagateToDAG(*args)
Calls
propagateToCPDAGand then orients the remaining edges: into a consistent extension if the propagated graph has one, else with new v-structures. The orientation looks for small CPTs: withdomainSizes, it uses the domain size of each node; without, all the domains are considered equal (nodes with few parents). The DAG contains all the arcs of the propagated graph.pyagrum.MeekRules.choicesreturns the list of the arbitrary choices made by the last execution ofpyagrum.MeekRules.propagateToDAG.- Parameters:
mg (
pyagrum.MixedGraphorpyagrum.PDAG) – The graph to be completed.domainSizes (
dict[int,int], optional) – The domain size of each node ofmg(node id -> domain size).
- Returns:
The completed
pyagrum.DAG.- Return type:
- Raises:
pyagrum.InvalidArgument – If a node of
mghas no domain size indomainSizes, or a domain size 0.pyagrum.InvalidDirectedCycle – If
mgcontains a directed cycle of length 3 or more.
Example
import pyagrum as gum
mr = gum.MeekRules()
dag = mr.propagateToDAG(gum.fastMixedGraph("A->B-C-D"))
type(dag).__name__, sorted(dag.arcs())
# ('DAG', [(0, 1), (1, 2), (2, 3)])
Class