[Networkit] Read simple edgelist

Jérôme Deschênes jeromedesch at gmail.com
Tue Nov 24 00:55:42 CET 2015


Hi again,

I have a new (not so hard) problem but I am struggling a bit with it.

I have a new edgelist but this time in this form (starting at zero and with
continuous numbering of nodes):

0 1
0 4
2 3
2 8
... ...

I want to measure the distance between specific nodes. I have another file
with the list of wanted distances:

0 15
0 172
0 23
1 55
1 74
1 198
1 534
,,, ,,,

I naturally want to get the results in a file with the two columns of the
nodes of the desired distances and a third column with the distances.

0 15 2
0 172 5
0 23 10
1 55 6
1 74 4
1 198 7
1 534 24
,,, ,,, ...

What is the best way to do that using networkit.distance?

Thank you.

Jerome


2015-10-07 16:22 GMT-04:00 Jérôme Deschênes <jeromedesch at gmail.com>:

> Thanks again Max.
>
> Nice module.
>
> Just wanted to update you on the fact that the csv file is created and
> work as intended when imported in STATA and in SAS. However the file itself
> is not perfectly formatted: single lines of data are split among multiple
> lines.
>
> On any given line, it would look like this:
>
> old_id, cent1
> ,cent2
>
> But, as said, it doesn't matter as other programs are able to read those
> csv as it.
>
> Jerome
>
>
> 2015-10-02 16:01 GMT-04:00 Christian Staudt <christian.staudt at kit.edu>:
>
>>
>> On 02 Oct 2015, at 20:26, Maximilian Vogel <
>> maximilian.vogel at student.kit.edu> wrote:
>>
>> # ...
>> # if you want a header row, describing the contents
>> helper.exportNodeValues("your_file.csv", mapping, results,
>> ["betweenness","degree"])
>> # else this is sufficient
>> helper.exportNodeValues("your_file.csv", mapping, results)
>>
>> You can also specifiy a different than the default delimiter=','. This
>> should then produce the file in the desired format.
>>
>> I hope this helps,
>> Max
>>
>>
>> We should probably integrate your helper.py code into the project.
>> Chris
>>
>> _______________________________________________
>> NetworKit mailing list
>> NetworKit at ira.uni-karlsruhe.de
>> https://lists.ira.uni-karlsruhe.de/mailman/listinfo/networkit
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ira.uni-karlsruhe.de/mailman/private/networkit/attachments/20151123/ee5d572d/attachment.html>


More information about the NetworKit mailing list