Skip to content

Commit

Permalink
Document input types for erdos_renyi function (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik-wolf authored Feb 9, 2024
1 parent ad28e9a commit 6028f5e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/SimpleGraphs/generators/randgraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,16 @@ function randbn(
end

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

"""
erdos_renyi(n, ne)
erdos_renyi(n, ne::Integer)
Create an [Erdős–Rényi](http://en.wikipedia.org/wiki/Erdős–Rényi_model) random
graph with `n` vertices and `ne` edges.
Expand Down

0 comments on commit 6028f5e

Please sign in to comment.