igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] unconnected graph


From: Gábor Csárdi
Subject: Re: [igraph] unconnected graph
Date: Thu, 14 May 2009 10:26:37 +0200

It is a mystery to me why this is a good solution for you, but if it
is good enough, then it is fine.

G.

On Thu, May 14, 2009 at 7:45 AM, gunce orman <address@hidden> wrote:
> I think i found a solution  for my unconnected  graph "g" :
>
>
> if(is.connected(g) == TRUE){
>             print('connected')
>         }else{
>             print('not connected')
>
>                 gg<-graph.empty()
>                 gg<-as.undirected(gg)
>                 gg<-simplify(gg)
>                 dg<-decompose.graph(g)
>                 for ( de in 1:length(dg)){
>                     gx<-as.undirected(dg[[de]])
>                     gx<-simplify(gx)
>                     gg<- graph.union(gg,gx)
>                 }
>                 g<-gg
>
>         }
>
>
>
> On Wed, May 13, 2009 at 9:11 PM, Paul Johnson <address@hidden> wrote:
>>
>> On Wed, May 13, 2009 at 11:58 AM, gunce orman <address@hidden>
>> wrote:
>> > hello,
>> >
>> > I'm trying to transform my unconnected graph to connected graph... I
>> > tried
>> > to link all components but it didn't work.. Can you help me?
>> >
>>
>> This is way too vague!  Why don't you show us your code and maybe we
>> can help.  I'm still new at igraph, but I'm probably able to help on
>> something like this.
>>
>>
>> --
>> Paul E. Johnson
>> Professor, Political Science
>> 1541 Lilac Lane, Room 504
>> University of Kansas
>>
>>
>> _______________________________________________
>> 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]