[graph-tool-tickets] [graph-tool] Ticket #119: New Property maps of wrong size after deleting vertices [Status -> closed]

graph-tool webmaster at skewed.de
Tue Dec 4 12:05:54 UTC 2012


#119: New Property maps of wrong size after deleting vertices
closed defect
---------------------------------------------------------------------
Reporter: oleguer.sagarra at gmail.com
Owner: tiago peixoto
Priority: normal
Milestone: (None)
---------------------------------------------------------------------
Changes (by tiago peixoto (2)): 

 * Status from 'new' to 'closed'
 * Resolution from '' to 'wontfix'
---------------------------------------------------------------------
Comment:

This is not really a bug.

Whenever an edge is removed, this is an O(1) operation which does not
change the index of the other edges. This means that the edge property
maps remain unmodified, including their underlying vectors which are
accessible as arrays via the 'a' attribute. This is done like this in
order to ensure that edge deletion is a fast operation.

It would be possible to modify things such that all property map vectors
are resized when an edge is removed, but this operation would be O(E),
and thus very costly for large graphs.

In summary, one should not rely on the fact that `len(eprop.a) == g.num_edges()`,
since it does not need to hold if edges were deleted.

I'll try to make this more clear in the documentation.
--
Ticket URL: <URL:http://graph-tool.skewed.de/ticket/119>
graph-tool <URL:http://graph-tool.skewed.de/>
An efficient python module for graph analysis and manipulation.


More information about the graph-tool-tickets mailing list