-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error for graphs with self loops #41
Comments
I guess this is actually a LightGraphs issue: julia> using LightGraphs
julia> g = Graph(Edge.([1 => 2, 2 => 3]))
{3, 2} undirected simple Int64 graph
julia> adjacency_matrix(g)
3×3 SparseArrays.SparseMatrixCSC{Int64, Int64} with 4 stored entries:
⋅ 1 ⋅
1 ⋅ 1
⋅ 1 ⋅
julia> add_edge!(g, 1 => 1)
true
julia> adjacency_matrix(g)
ERROR: ArgumentError: Illegal buffers for SparseMatrixCSC construction 3 [1, 3, 5, 6] [1, 2, 1, 3, 2] [1, 1, 1, 1, 1, 1]
Stacktrace:
[1] SparseMatrixCSC
@ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/SparseArrays/src/sparsematrix.jl:29 [inlined]
[2] SparseArrays.SparseMatrixCSC(m::Int64, n::Int64, colptr::Vector{Int64}, rowval::Vector{Int64}, nzval::Vector{Int64})
@ SparseArrays /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.7/SparseArrays/src/sparsematrix.jl:44
[3] _adjacency_matrix(g::SimpleGraph{Int64}, T::DataType, neighborfn::typeof(inneighbors), nzmult::Int64)
@ LightGraphs.LinAlg ~/.julia/packages/LightGraphs/IgJif/src/linalg/spectral.jl:63
[4] #adjacency_matrix#2
@ ~/.julia/packages/LightGraphs/IgJif/src/linalg/spectral.jl:25 [inlined]
[5] adjacency_matrix (repeats 2 times)
@ ~/.julia/packages/LightGraphs/IgJif/src/linalg/spectral.jl:20 [inlined]
[6] top-level scope
@ REPL[28]:1 |
Interesting I've been using self edges in GraphMakie without a problem http://juliaplots.org/GraphMakie.jl/stable/generated/plots/#Self-edges Edit: Ah you allready mentioned that it works well on 1.6 |
See: sbromberger/LightGraphs.jl#1594 it looks like it is specific to Julia 1.7. |
@hexaeder on a separate note, GraphMakie looks great! I built my own interactive graph visualization tool here: https://github.com/ITensor/ITensorsVisualization.jl (specific to visualizing tensor networks, but it would pretty be easy to generalize). However it has become pretty outdated from that latest Makie versions, I will try out using your package as a backend. |
Your upstream fix was released in [email protected] :) |
Minimal example:
EDIT: This appears to be specific to Julia 1.7, see sbromberger/LightGraphs.jl#1594.
The text was updated successfully, but these errors were encountered: