igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Giant Component


From: Gábor Csárdi
Subject: Re: [igraph] Giant Component
Date: Thu, 20 Aug 2009 11:21:11 +0200

On Thu, Aug 20, 2009 at 12:44 AM, Surendar
Swaminathan<address@hidden> wrote:
[...]
> g2<-giant.component(g)
> get.edgelist(g2,names=TRUE)
> throws an error saying g2 is not a graph object.

What is it then? giant.component() returns an igraph graph object, so
if that completes successfully, then g2 it must be and igraph graph
object. So what is g2? Please send the output of

class(g2)

Thanks,
G.

> Thank you
>
> Surendar
>
> On Wed, Aug 19, 2009 at 11:45 AM, Gábor Csárdi<address@hidden> wrote:
>> Hello,
>>
>> add a vertex attribute for the original graph:
>>
>> V(g)$name <- seq_len(vcount(g))-1
>>
>> and then you can query the edgelist using the 'name' vertex attribute:
>>
>> g2 <- giant.component(g)
>> get.edgelist(g2, names=TRUE)
>>
>> Best,
>> Gabor
>>
>> On Wed, Aug 19, 2009 at 8:39 PM, Surendar
>> Swaminathan<address@hidden> wrote:
>>> Hello Gabor,
>>>
>>>  Thank you very much for the reply. Its working perfectly thank you
>>> very much. I am trying to output the edgeliest with Vertex number.
>>>
>>> I want to output the original vertex number that I used for the input.
>>>
>>> I tried doing write.graph(giant,"file name","edgelist")
>>> this writex the output, but it starts with zero.And, also tried
>>> graph.data.frame it does not allow me to do it.
>>>
>>> Earlier I used to find bet<-between(g)
>>> bet<-data.frame(Person=V(g)$name,bet=betweenness)
>>>
>>> is there anyway I can do something like this.
>>>
>>> Thank you very much once again.
>>>
>>> Surendar
>>>
>>> On Tue, Aug 18, 2009 at 12:37 AM, Gábor Csárdi<address@hidden> wrote:
>>>> Surendar,
>>>>
>>>> what is the tail component? Everything else than the largest? Then
>>>> these will do:
>>>>
>>>> giant.component <- function(graph, ...) {
>>>>  cl <- clusters(graph, ...)
>>>>  subgraph(graph, which(cl$membership == which.max(cl$csize)-1)-1)
>>>> }
>>>>
>>>> tail.component <- function(graph, ...) {
>>>>  cl <- clusters(graph, ...)
>>>>  subgraph(graph, which(cl$membership != which.max(cl$csize)-1)-1)
>>>> }
>>>>
>>>> Gabor
>>>>
>>>> On Tue, Aug 18, 2009 at 12:08 AM, Surendar
>>>> Swaminathan<address@hidden> wrote:
>>>>> Hello All,
>>>>>
>>>>>  I have been doing SNA metrics using Igraph in R. I have this
>>>>> question. What I have is node to node link. Is there anyway I can find
>>>>>  Giant and Tail component.
>>>>>
>>>>> Surendar
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> igraph-help mailing list
>>>>> address@hidden
>>>>> http://lists.nongnu.org/mailman/listinfo/igraph-help
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Gabor Csardi <address@hidden>     UNIL DGM
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>
>>
>>
>>
>> --
>> Gabor Csardi <address@hidden>     UNIL DGM
>>
>>
>> _______________________________________________
>> 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
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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