R: Deleting edges fails silently
Bug #1155254 reported by
Alex Lubbock
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
igraph |
Fix Committed
|
High
|
Gábor Csárdi |
Bug Description
Under certain conditions, igraph silently fails to delete edges. Here is an example, using the attached test.gml graph:
g <- read.graph(
ecount(g) ## 4 edges
g[1,3] ## non-zero value, i.e. the edge exists
g[1,3] <- FALSE ## should delete the edge
g[1,3] ## the value is now zero, but the edge still exists
ecount(g) ## still 4 edges
I'm using igraph 0.6.5-1 on R 2.15.1 x86_64 Linux.
If instead I use g[1,3] <- NULL, the edge gets deleted. This problem seems to only occur on certain graphs, the one attached being an example.
Changed in igraph: | |
status: | New → Confirmed |
importance: | Undecided → High |
milestone: | none → 0.7 |
To post a comment you must log in.
I think that your issue occurs on weighted graphs only although I haven't checked that. Anyway, it is definitely inconsistent with the documentation because it says that "The replacement syntax allow the deletion of edges, by specifying FALSE or NULL as the replacement value". I think that internally FALSE gets converted to zero and then you end up with an edge having zero weight - that's why it is not an issue on unweighted graphs.
I'll assign this issue to Gábor because he is the developer of the R interface.