summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networkx/algorithms/dag.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/networkx/algorithms/dag.py b/networkx/algorithms/dag.py
index 0d719e71..20968123 100644
--- a/networkx/algorithms/dag.py
+++ b/networkx/algorithms/dag.py
@@ -1224,6 +1224,13 @@ def compute_v_structures(G):
The v structures within the graph. Each v structure is a 3-tuple with the
parent, collider, and other parent.
+ Examples
+ --------
+ >>> G = nx.DiGraph()
+ >>> G.add_edges_from([(1, 2), (0, 5), (3, 1), (2, 4), (3, 1), (4, 5), (1, 5)])
+ >>> list(nx.compute_v_structures(G))
+ [(0, 5, 4), (0, 5, 1), (1, 5, 4)]
+
Notes
-----
https://en.wikipedia.org/wiki/Collider_(statistics)