Skip to content

Commit 6028f5e

Browse files
authored
Document input types for erdos_renyi function (#340)
1 parent ad28e9a commit 6028f5e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/SimpleGraphs/generators/randgraphs.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,16 @@ function randbn(
127127
end
128128

129129
"""
130-
erdos_renyi(n, p)
130+
erdos_renyi(n, p::Real)
131131
132132
Create an [Erdős–Rényi](http://en.wikipedia.org/wiki/Erdős–Rényi_model)
133133
random graph with `n` vertices. Edges are added between pairs of vertices with
134-
probability `p`.
134+
probability `p`.
135+
136+
Note that there exists another definition of the Erdös-Rényi model in which the
137+
total number of edges is kept constant, rather than the probability `p`.
138+
To access this definition, use `erdos_renyi(n, ne::Integer)`
139+
(specifically: `erdos_renyi(n, 1) != erdos_renyi(n, 1.0)`).
135140
136141
### Optional Arguments
137142
- `is_directed=false`: if true, return a directed graph.
@@ -170,7 +175,7 @@ function erdos_renyi(
170175
end
171176

172177
"""
173-
erdos_renyi(n, ne)
178+
erdos_renyi(n, ne::Integer)
174179
175180
Create an [Erdős–Rényi](http://en.wikipedia.org/wiki/Erdős–Rényi_model) random
176181
graph with `n` vertices and `ne` edges.

0 commit comments

Comments
 (0)