Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Neighbors related functions give wrong result after rem_edge! because it just set edge weight to 0 #66

@ChasingZenith

Description

@ChasingZenith

Removing an edge just sets the edge weight to 0 #43
Another bug brought by this implementation is that neighbors related functions such as neighbors, inneighbors and outneighbors give wrong result.

julia> g = SimpleWeightedGraph([1 0 ; 0 1])
g {2, 2} undirected simple Int64 graph

julia> inneighbors(g, 2)
Int64[2]

julia> rem_edge!(g, edgetype(g)(2, 2))

julia> inneighbors(g, 2)
Int64[2] # it will be Int64[] if we use SimpleGraph or SimpleDiGraph

It is because we never dropzeros! every time we remove an edge. I think that should be corrected at least when we run neighbors because rem_edge! is explicitly declaring that link is removed so they should no longer be neighbors to each others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions