is_d_separator#
- graph_tool.structure.is_d_separator(g, x, y, z)[git][source]#
Check whether a set of vertices d-separates two others in a directed acyclic graph.
- Parameters:
- Returns:
- separated
bool Trueif \(Z\) d-separates \(X\) from \(Y\).
- separated
See also
find_minimal_d_separatorMinimal d-separator of two sets of vertices
is_minimal_d_separatorTest for minimal d-separators
graph_tool.generation.moral_graphMoral graph of a directed acyclic graph
graph_tool.flow.is_separatorVertex separator test for undirected graphs
Notes
In a Bayesian network, \(Z\) d-separates \(X\) from \(Y\) if every trail (path ignoring the edge directions) between them is blocked, which implies that \(X\) and \(Y\) are conditionally independent given \(Z\). A trail is blocked by a vertex \(v\) on it if \(v\) is a collider (both trail edges point to it) and neither \(v\) nor any of its descendants is in \(Z\), or if \(v\) is not a collider and is in \(Z\) [pearl-probabilistic-1988]. The active trails from \(X\) are explored with the “Bayes ball” search [shachter-bayes-1998], in time \(O(V + E)\). The three sets must be disjoint.
References
[pearl-probabilistic-1988]Judea Pearl, “Probabilistic Reasoning in Intelligent Systems”, Morgan Kaufmann (1988).
[shachter-bayes-1998]Ross D. Shachter, “Bayes-ball: The rational pastime (for determining irrelevance and requisite information in belief networks and influence diagrams)”, Proceedings of the Fourteenth Conference on Uncertainty in Artificial Intelligence, 480-487 (1998), arXiv: 1301.7412
Examples
>>> g = gt.Graph([(0, 1), (1, 2), (3, 1)]) >>> print(gt.is_d_separator(g, 0, 2, [1]), gt.is_d_separator(g, 0, 3, []), ... gt.is_d_separator(g, 0, 3, [2])) True True False