Skip to content

Commit

Permalink
Implement rem_vertex!,rem_edge!
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Oct 23, 2023
1 parent ba7dc72 commit f245f53
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/IncidenceGraphs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ function Graphs.has_edge(g::IncidenceGraph, vs...)
end
end

Graphs.rem_vertex!(g::IncidenceGraph, v) = deleterow!(g.incidence_matrix, v)
Graphs.rem_edge!(g::IncidenceGraph, e) = deletecolumn!(g.incidence_matrix, e)

function Graphs.neighbors(g::IncidenceGraph, v::Integer)
edges = SparseArrays.nonzeroinds(g[v, :])
mapreduce(, edges) do edge
Expand Down

0 comments on commit f245f53

Please sign in to comment.