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

Henning Meyerhenke henning.meyerhenke at kit.edu
Thu Jun 22 16:25:34 CEST 2017


Dear Albert,

Thank you again for your interest.

Am 22.06.17 um 15:54 schrieb Albert Cardona:
> Dear all,
> 
> Being overly used to networkx, networkit got me by surprise: calling
> adEdge with a source and target node that have not yet been added via
> addNode results in a segmentation fault in ubuntu 16.04 with python
> 3.6. I had installed networkit via pip.
> 
> I wonder then:
> 
> 1. Is there perhaps a brief guide of key differences between networkx
> and networkit? I have so far not been successful at finding it.

No, not yet.


> 2. If the reason nodes have to be added before calling addEdge relate
> to performance, perhaps an add_edge function could be added to mimic
> the behavior of networkx, with the understanding that it would be
> slower (needs lookups, if statements, etc.) Alternatively, one could
> rename addEdge to addEdge_unsafe, but of course this is undesirable
> for backwards compatibility reasons.

Well, the asserts in the code do not catch the problem in opt (release)
mode... Our documentation could be clearer about what the method expects.

I would be against renaming addEdge for backwards compatibility reasons.
Having a method addEdgeSafely would be possible, I guess. 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...

Best,
Henning

-- 

==========================================================
Karlsruhe Institute of Technology (KIT)
Institute of Theoretical Informatics (ITI)

Prof. Dr. Henning Meyerhenke
Theoret. Informatics / Parallel Computing

Phone: +49-721-608-41876
Web: http://parco.iti.kit.edu/henningm/

KIT - The Research University in the Helmholtz Association
==========================================================


-- 

==========================================================
Karlsruhe Institute of Technology (KIT)
Institute of Theoretical Informatics (ITI)

Prof. Dr. Henning Meyerhenke
Theoret. Informatics / Parallel Computing

Phone: +49-721-608-41876
Web: http://parco.iti.kit.edu/henningm/

KIT - The Research University in the Helmholtz Association
==========================================================

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5399 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.ira.uni-karlsruhe.de/pipermail/networkit/attachments/20170622/c8708f23/attachment.p7s>


More information about the NetworKit mailing list