is_minimal_d_separator#
- graph_tool.structure.is_minimal_d_separator(g, x, y, z, included=None)[git][source]#
Check whether a set of vertices is a minimal d-separator of two others in a directed acyclic graph.
- Parameters:
- g
Graph Directed acyclic graph.
- xiterable of
intorVertex, or a single vertex First set of vertices.
- yiterable of
intorVertex, or a single vertex Second set of vertices.
- ziterable of
intorVertex, or a single vertex Candidate separator.
- includediterable of
intorVertex(optional, default:None) Vertices that the separator must contain, which are not required to be removable.
- g
- Returns:
- minimal
bool Trueif \(Z\) d-separates \(X\) from \(Y\) and no vertex of \(Z\) outsideincludedcan be removed while keeping this property.
- minimal
See also
is_d_separatorTest for d-separators
find_minimal_d_separatorMinimal d-separator of two sets of vertices
Notes
A set \(Z\) d-separates \(X\) from \(Y\) [pearl-probabilistic-1988] if every trail (path ignoring the edge directions) between a vertex of \(X\) and one of \(Y\) is blocked by \(Z\), i.e. contains a vertex \(v\) that either is a collider (both trail edges point to it) such that neither \(v\) nor any of its descendants is in \(Z\), or is not a collider and is in \(Z\) (see
is_d_separator()). The set \(Z\) is a minimal d-separator if it d-separates \(X\) from \(Y\) and no proper subset of it that containsincludeddoes. The test of van der Zander and Liśkiewicz [zander-finding-2020] runs in time \(O(V + E)\).References
[pearl-probabilistic-1988]Judea Pearl, “Probabilistic Reasoning in Intelligent Systems”, Morgan Kaufmann (1988).
[zander-finding-2020]Benito van der Zander and Maciej Liśkiewicz, “Finding minimal d-separators in linear time and applications”, Proceedings of the 35th Conference on Uncertainty in Artificial Intelligence, PMLR 115, 637-647 (2020), https://proceedings.mlr.press/v115/van-der-zander20a.html
Examples
>>> g = gt.Graph([(0, 1), (1, 2), (0, 3), (3, 2), (2, 4)]) >>> print(gt.is_minimal_d_separator(g, 0, 4, [2]), ... gt.is_minimal_d_separator(g, 0, 4, [1, 3]), ... gt.is_minimal_d_separator(g, 0, 4, [1, 2])) True True False