igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Extracting sub-graph


From: Håvard Wahl Kongsgård
Subject: Re: [igraph] Extracting sub-graph
Date: Wed, 12 Oct 2011 15:46:19 +0200

Thanks,
g.vs["attr"] = value_list , will work.

-Håvard

On Wed, Oct 12, 2011 at 3:43 PM, Tamás Nepusz <address@hidden> wrote:
>>> Have you imported the "WEAK" constant from the igraph module before? (from 
>>> igraph import WEAK)
>> Nope, do I need to do that?
> Yes. "WEAK" is just a constant that resolves to 1, so if you want mode=WEAK 
> to work, then you need to import that.
>
>> Another issue, I use Read_Ncol() to import a large graph.
>> For vertex attributes is there a similar function useful on large
>> graph?
> No, there isn't.
>
>> Currently I simply loop through a list of vertices, and add the
>> attributes that way, but it's slow.
> You can assign attributes to a whole set of vertices like this:
>
> g.vs["attr"] = value_list
>
> where value_list is a list of attribute values to be assigned to the "attr" 
> attribute of all the vertices. This should be faster than doing something 
> like:
>
> for idx, value in enumerate(value_list):
>    g.vs[idx]["attr"] = value
>
> --
> T.
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>



reply via email to

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