R: Deleting edges fails silently

Bug #1155254 reported by Alex Lubbock
6
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(file="test.gml",format="gml")
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.

Revision history for this message
Alex Lubbock (alubbock) wrote :
Revision history for this message
Tamás Nepusz (ntamas) wrote :

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.

Changed in igraph:
assignee: nobody → Gábor Csárdi (gabor.csardi)
Changed in igraph:
status: New → Confirmed
importance: Undecided → High
milestone: none → 0.7
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote :

Fixed in a2d868b1be2fda3688cda9b87f68cc8072aa68e0

Changed in igraph:
status: Confirmed → Fix Committed
Revision history for this message
Gábor Csárdi (gabor.csardi) wrote : Continue on github

The development of igraph has moved to github, so please do not comment on this bug here. You are of course welcome to comment on github, here:
https://github.com/igraph/igraph/issues/135

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.