Multigraphs.jl icon indicating copy to clipboard operation
Multigraphs.jl copied to clipboard

Multiple edges should give repeated columns in the incidence matrix

Open scheinerman opened this issue 1 year ago • 0 comments

When a Multigraph has multiple edges, the incidence matrix should have repeated, identical columns. That is, there should be as many columns as there are edges.

julia> using Graphs, Multigraphs

julia> g = Multigraph(4)
{4, 0} undirected Int64 multigraph

julia> add_edge!(g,1,2)
true

julia> add_edge!(g,1,2)
true

julia> add_edge!(g,1,3)
true

julia> incidence_matrix(g,oriented=true)
4×2 SparseArrays.SparseMatrixCSC{Int64, Int64} with 4 stored entries:
 -1  -1
  1   ⋅
  ⋅   1
  ⋅   ⋅

This matrix should have three columns with the first column repeated.

scheinerman avatar Jan 30 '25 20:01 scheinerman