is_minimal_d_separator

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:
gGraph

Directed acyclic graph.

xiterable of int or Vertex, or a single vertex

First set of vertices.

yiterable of int or Vertex, or a single vertex

Second set of vertices.

ziterable of int or Vertex, or a single vertex

Candidate separator.

includediterable of int or Vertex (optional, default: None)

Vertices that the separator must contain, which are not required to be removable.

Returns:
minimalbool

True if \(Z\) d-separates \(X\) from \(Y\) and no vertex of \(Z\) outside included can be removed while keeping this property.

See also

is_d_separator

Test for d-separators

find_minimal_d_separator

Minimal 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 contains included does. 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