From a41a11e516f4345d84ed356433cd543aab914643 Mon Sep 17 00:00:00 2001 From: Navya Agarwal <82928853+navyagarwal@users.noreply.github.com> Date: Thu, 23 Mar 2023 23:12:17 +0530 Subject: Add docstring examples to dag.py (#6491) * Docstr examples for compute-v-structures * Removed unnecessary example --- networkx/algorithms/dag.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- cgit v1.2.1