Skip to content

error in erdos_renyi generator #173

Closed
@CarloLucibello

Description

@CarloLucibello
Member

Some branches of the erdos_renyi function produce an error:

julia> erdos_renyi(4, 6, seed=1)
ERROR: ArgumentError: Cannot specify both, seed and rng
Stacktrace:
 [1] rng_from_rng_or_seed(rng::Random.MersenneTwister, seed::Int64)
   @ Graphs ~/.julia/packages/Graphs/2JiDT/src/utils.jl:68
 [2] SimpleGraph{Int64}(nv::Int64, ne::Int64; rng::Random.MersenneTwister, seed::Int64)
   @ Graphs.SimpleGraphs ~/.julia/packages/Graphs/2JiDT/src/SimpleGraphs/generators/randgraphs.jl:29
 [3] SimpleGraph(nv::Int64, ne::Int64; rng::Random.MersenneTwister, seed::Int64)
   @ Graphs.SimpleGraphs ~/.julia/packages/Graphs/2JiDT/src/SimpleGraphs/generators/randgraphs.jl:45
 [4] SimpleGraph{Int64}(nv::Int64, ne::Int64; rng::Nothing, seed::Int64)
   @ Graphs.SimpleGraphs ~/.julia/packages/Graphs/2JiDT/src/SimpleGraphs/generators/randgraphs.jl:30
 [5] #SimpleGraph#21
   @ ~/.julia/packages/Graphs/2JiDT/src/SimpleGraphs/generators/randgraphs.jl:45 [inlined]
 [6] #erdos_renyi#26
   @ ~/.julia/packages/Graphs/2JiDT/src/SimpleGraphs/generators/randgraphs.jl:166 [inlined]
 [7] top-level scope
   @ REPL[18]:1
 [8] top-level scope
   @ ~/.julia/packages/CUDA/DfvRa/src/initialization.jl:52

julia> erdos_renyi(10, 6, seed=1) # no error with more nodes
{10, 6} undirected simple Int64 graph

This is on julia v1.8.1, Graphs v1.7.3

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @CarloLucibello

      Issue actions

        error in erdos_renyi generator · Issue #173 · JuliaGraphs/Graphs.jl