Closed
Description
the following code fails:
# make a graph with three connected components
graph = SimpleGraph(9)
add_edge!(graph, 1, 2)
add_edge!(graph, 3, 4)
add_edge!(graph, 3, 5)
add_edge!(graph, 4, 5)
add_edge!(graph, 6, 7)
add_edge!(graph, 7, 8)
add_edge!(graph, 8, 9)
loc_x, loc_y = spring_layout(graph, 97339, C=2.0)
with the error:
MethodError: no method matching setindex!(::Int64, ::Float64, ::Int64)
var"#spring_layout#2"(::Float64, ::Int64, ::Float64, ::typeof(GraphPlot.spring_layout), ::LightGraphs.SimpleGraphs.SimpleGraph{Int64}, ::Int64, ::Vector{Float64})@layout.jl:158
top-level scope@Local: 2[inlined]
but works just fine when I omit the C=2.0
. (I am setting the random seed as 97339
.
Metadata
Metadata
Assignees
Labels
No labels