igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] write to file problem


From: Simone Gabbriellini
Subject: Re: [igraph] write to file problem
Date: Thu, 20 Jan 2011 15:57:48 +0100

Hello,

I am on Mac OSX 10.6.6... But I am working with the enthought python
distribution, so I have moved the igraph from its original location,
maybe this can break something?

unfortunately, no file is produced on my machine...

thanks for the second comment!

simone

2011/1/20 Tamas Nepusz <address@hidden>:
> Your code should work; actually, it works fine for me on Linux. Which OS
> are you using?
>
> Just one comment, though: the time required by add_edges() is almost the
> same for one edge as for many edges, so I'd probably generate a list of
> edges to be added and then pass that list to add_edges() at once:
>
> g.add_edges([(v.index, ...) for v in random.sample(...)])
>
> --
> T.
>
> On 01/20/2011 03:49 PM, Simone Gabbriellini wrote:
>> Hello list,
>>
>> I am trying to write to file a graph that I have just generated with:
>>
>> # build graph
>> g = igraph.Graph(top+bottom, directed = False)
>> # add attributes
>> g.vs["type"] = [int(i >= top) for i in xrange(top+bottom)]
>> g.vs["name"] = [v.index for v in g.vs]
>> # add some random edges between top and bottom nodes
>> [g.add_edges((v.index, random.choice(g.vs(type=1)).index)) for v in
>> random.sample(g.vs(type=0), bottom)]
>> # write file
>> g.write_graphml('test.graphml')
>>
>> but nothing happens... is there something I am missing in the writing method?
>>
>> Best regards,
>> Simone
>>
>> _______________________________________________
>> igraph-help mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]