igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] unconnected graph


From: gunce orman
Subject: Re: [igraph] unconnected graph
Date: Thu, 14 May 2009 08:45:31 +0300

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


reply via email to

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