[Networkit] addEdge seg faults when invoked with nodes not present in the graph

Matteo Riondato matteo at cs.brown.edu
Thu Jun 22 16:32:50 CEST 2017

> On Jun 22, 2017, at 10:25 AM, Henning Meyerhenke <henning.meyerhenke at kit.edu> wrote:
> I would be against renaming addEdge for backwards compatibility reasons.
> Having a method addEdgeSafely would be possible, I guess.

How about calling it “addEdgeAndNodes” ? “Safely” is not very descriptive, IMHO.

I like my bikeshed blue =) (https://en.wiktionary.org/wiki/bikeshedding <https://en.wiktionary.org/wiki/bikeshedding>)

> I am a bit
> concerned, though, about the theoretical consistency: how can one insert
> an edge between two nodes that are not present in the graph? But I see
> the convenience point...

I tend to agree with you. NetworKit approach is much more granular and feels more correct.

On the other hand, the proposed function would just be a utility function to save the user from having to
check whether the nodes are present, add them if they are not, and then add the edge.
It seems an operation that users would want to do often enough that a utility function would be useful.
It may also have the advantage that it may be able to do all this by manipulating some internals structure not directly accessible to the user.

My 2 cents,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ira.uni-karlsruhe.de/pipermail/networkit/attachments/20170622/b71c5528/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.ira.uni-karlsruhe.de/pipermail/networkit/attachments/20170622/b71c5528/attachment.sig>

More information about the NetworKit mailing list