find_minimal_d_separator

find_minimal_d_separator#

graph_tool.structure.find_minimal_d_separator(g, x, y, included=None, restricted=None)[git][source]#

Return a minimal d-separator of two sets of vertices 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.

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

Vertices that must belong to the separator.

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

If given, the separator may contain only these vertices.

Returns:
znumpy.ndarray or None

The vertices of a minimal d-separator (see is_d_separator()), or None if there is none within the constraints.

See also

is_d_separator

Test for d-separators

is_minimal_d_separator

Test for minimal d-separators

graph_tool.generation.moral_graph

Moral graph of a directed acyclic graph

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 separator is minimal with respect to inclusion among those that contain included: no vertex outside included can be removed from it. It is found with the algorithm of van der Zander and Liśkiewicz [zander-finding-2020], which restricts the candidates to the ancestors of \(X \cup Y \cup I\) and removes those not reachable by active trails from both sides, 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), (2, 3), (1, 3)])
>>> print(gt.find_minimal_d_separator(g, 0, 3))
[1]
>>> print(gt.find_minimal_d_separator(g, 0, 3, restricted=[2]))
None