igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] subtraction?


From: Marco
Subject: Re: [igraph] subtraction?
Date: Thu, 21 May 2009 13:04:48 +0200

Tamas,

I am gonna try it in a minute.
Will let you know.

Thanks!

marco

--
restituiremo il riso ai salici



On Thu, May 21, 2009 at 12:54 PM, Tamas Nepusz <address@hidden> wrote:
>> I have a graph g built in some way (basically random graphs, different
>> models), and a graph h which is the kcore(k) [for one k in N] of g.
>>
>> I use python, btw.
>>
>> I am not sure I understood the use of subgraph here....
> Here's an example. First we generate a graph somehow:
>
>>>> g = Graph.GRG(100, 0.2)
>
> Then we get the k-core indices for each vertex:
>
>>>> g.vs["coreness"] = g.coreness()
>
> We construct h s.t. the coreness index should be greater than or equal
> to 4 for all vertex in h:
>
>>>> h = g.subgraph(g.vs.select(coreness_ge=4))
>
> Now, since we know that all the vertices in h are those that have a
> coreness index of at least 4, we know that the rest must have coreness
> less index of less than 4, so we can select those from g as well:
>
>>>> g2 = g.subgraph(g.vs.select(coreness_lt=4))
>
> Hope this helps.
>
> --
> Tamas
>
> _______________________________________________
> 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]