Skip to content

Commit ab37f7f

Browse files
authored
Update random DAG generation tutorial
and mention that the sampling is uniform
1 parent 0d4ffc3 commit ab37f7f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

doc/examples_sphinx-gallery/generate_dag.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414

1515

1616
# %%
17-
# First, we set a random seed for reproducibility
17+
# First, we set a random seed for reproducibility.
1818
random.seed(0)
1919

2020
# %%
21-
# First, we generate a random undirected graph without loops
22-
g = ig.Graph.Erdos_Renyi(n=15, p=0.3, directed=False, loops=False)
21+
# First, we generate a random undirected graph with a fixed number of edges, without loops.
22+
g = ig.Graph.Erdos_Renyi(n=15, m=30, directed=False, loops=False)
2323

2424
# %%
25-
# Then we convert it to a DAG *in place*
25+
# Then we convert it to a DAG *in place*. This method samples DAGs with a given number of edges and vertices uniformly.
2626
g.to_directed(mode="acyclic")
2727

2828
# %%
29-
# We can print out a summary of the DAG
29+
# We can print out a summary of the DAG.
3030
ig.summary(g)
3131

3232

0 commit comments

Comments
 (0)