[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Subgraphs Union
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] Subgraphs Union |
Date: |
Fri, 10 Dec 2010 09:48:14 +0100 |
Hi,
it depends what you mean by 'join'-ing them, see ?graph.union and the
other functions in this manual page.
These functions do not consider symbolic vertex names. If you want to
use the vertex names for the join, then take a look at
http://lists.gnu.org/archive/html/igraph-help/2009-10/msg00087.html
Best,
Gabor
On Thu, Dec 9, 2010 at 1:55 PM, Romildo Martins
<address@hidden> wrote:
> Hello,
>
> How to join the subgraphs (sub1 and sub2) to construct the network graph?
> Note that you must include (automatically) the edges (2,4) and (3,5)
>
> Thanks
>
> Romildo Martins Bezerra
>
> #######################
>
> network<- graph(c(0,1,1,2,2,3,3,0,1,3,2,4,3,5,4,5,4,6,5,6), directed=FALSE )
> network <- graph.adjacency(get.adjacency(network),mode="undirected")
> E(network)$capacity<-c(100,120,120,120,140,80,160,100,120,180)
> V(network)$name<-c(0,1,2,3,4,5,6)
>
>
> #show network
> plot(network,vertex.shape="circle",
> layout=layout.kamada.kawai,vertex.label=V(network)$name,
> edge.label=E(network)$capacity)
>
>
> sub1<- graph(c(0,1,1,2,2,3,3,0,1,3), directed=FALSE )
> sub1 <- graph.adjacency(get.adjacency(sub1),mode="undirected")
> V(sub1)$name<-c(0,1,2,3)
> #show sub1
> plot(sub1,vertex.shape="circle",
> layout=layout.kamada.kawai,vertex.label=V(sub1)$name,
> edge.label=E(sub1)$capacity)
>
>
> sub2<- graph(c(0,1,1,2,2,0), directed=FALSE )
> sub2 <- graph.adjacency(get.adjacency(sub2),mode="undirected")
> V(sub2)$name<-c(4,5,6)
> #show sub2
> plot(sub2,vertex.shape="circle",
> layout=layout.kamada.kawai,vertex.label=V(sub2)$name,
> edge.label=E(sub2)$capacity)
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
--
Gabor Csardi <address@hidden> UNIL DGM